This is some sort of optimizer issue in newer gcc.  The following patch from 
the freeswitch tree fixes it, also compiling -O0 will keep it from happening:

:git diff 016550f218fb0ea54aa6163d6a6eb7e02539da5e..HEAD 
libsofia-sip-ua/msg/msg_parser.c
diff --git a/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c 
b/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c
index d75b975..c312445 100644
--- a/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c
+++ b/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c
@@ -2470,8 +2470,6 @@ int msg_header_prepend(msg_t *msg,
 msg_header_t **
 msg_hclass_offset(msg_mclass_t const *mc, msg_pub_t const *mo, msg_hclass_t 
*hc)
 {
-  int i;
-
   assert(mc && hc);
 
   if (mc == NULL || hc == NULL)
@@ -2483,12 +2481,16 @@ msg_hclass_offset(msg_mclass_t const *mc, msg_pub_t 
const *mo, msg_hclass_t *hc)
       if (mc->mc_hash[j].hr_class == hc) {
        return (msg_header_t **)((char *)mo + mc->mc_hash[j].hr_offset);
       }
-  }
-  else
+  } else {
     /* Header has no name. */
-    for (i = 0; i <= 6; i++)
-      if (hc->hc_hash == mc->mc_request[i].hr_class->hc_hash)
-       return (msg_header_t **)((char *)mo + mc->mc_request[i].hr_offset);
+    if (hc->hc_hash == mc->mc_request[0].hr_class->hc_hash) return 
(msg_header_t **)((char *)mo + mc->mc_request[0].hr_offset);
+    if (hc->hc_hash == mc->mc_status[0].hr_class->hc_hash) return 
(msg_header_t **)((char *)mo + mc->mc_status[0].hr_offset);
+    if (hc->hc_hash == mc->mc_separator[0].hr_class->hc_hash) return 
(msg_header_t **)((char *)mo + mc->mc_separator[0].hr_offset);
+    if (hc->hc_hash == mc->mc_payload[0].hr_class->hc_hash) return 
(msg_header_t **)((char *)mo + mc->mc_payload[0].hr_offset);
+    if (hc->hc_hash == mc->mc_unknown[0].hr_class->hc_hash) return 
(msg_header_t **)((char *)mo + mc->mc_unknown[0].hr_offset);
+    if (hc->hc_hash == mc->mc_error[0].hr_class->hc_hash) return (msg_header_t 
**)((char *)mo + mc->mc_error[0].hr_offset);
+    if (hc->hc_hash == mc->mc_multipart[0].hr_class->hc_hash) return 
(msg_header_t **)((char *)mo + mc->mc_multipart[0].hr_offset);
+  }
 
   return NULL;
 }


On Nov 13, 2013, at 4:14 AM, Jabran Bhatti <jabran....@gmail.com> wrote:

> Hello,
> 
> I am running the example program sofsip-cli-0.16 with dummy media
> implementaition. I can successfully register with freeswitch. After
> sending a 180 Ringing, the program tries to respond to an incoming
> INVITE with the following message
> 
>   ------------------------------------------------------------------------
> send 657 bytes to udp/[10.0.10.110]:5060 at 08:38:50.939046:
>   ------------------------------------------------------------------------
>   v=0
>   o=- 7379759665580148502 4675863509426113643 IN IP4 10.0.56.22
>   s=-
>   c=IN IP4 10.0.56.22
>   t=0 0
>   m=audio 16384 RTP/AVP 0
>   a=rtpmap:0 PCMU/8000
>   Via: SIP/2.0/UDP 10.0.10.110;rport=5060;branch=z9hG4bK3pFQt22y2Q01K
>   From: "Extension 1007" <sip:1007@10.0.10.110>;tag=BH2jBj102ZQvm
>   To: <sip:(null)@10.0.56.22>;tag=HFeSteF09p7Fr
>   Call-ID: 97ef089d-c6e1-1231-27bb-000009086510
>   CSeq: 51829843 INVITE
>   Contact: <sip:10.0.56.22>
>   User-Agent: sofia-sip/1.12.11
>   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE,
> SUBSCRIBE, NOTIFY, REFER, UPDATE
>   Supported: timer, 100rel
>   Content-Type: application/sdp
>   Content-Disposition: session
>   Content-Length: 0
> 
> 
> I get this message in the console output by setting TPORT_LOG=1.
> 
> As far as I know, the SDP content should be in the message body
> (resulting in a non-zero content-length). Has anyone else encountered
> this issue?
> This message never shows up in wireshark though, indicating that sofia
> sip does send the weirdly constructed response.
> Anywho, could someone tell me how I could easily get the sdp into the
> message body with nua?
> 
> I also noted that no 100 Trying is sent before the 180 Ringing...
> 
> Many thanks in advance!
> 
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Sofia-sip-devel mailing list
> Sofia-sip-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to