Hello,

I have a test case where SIPp receives a SIP message carrying a message 
body with CPIM content (the below extracts are simplified to reflect only 
the problematic message elements):

UDP message received

INVITE sip:user@host:port SIP/2.0
From: tel:2110;tag=697848969de74321800c6ec5de2f3236
To: sip:u...@example.com
[...]
Content-Type: multipart/mixed;boundary=++

--++
Content-Type: application/sdp
[...]
--++
Content-Type: message/cpim
[...]
From: <sip:anonymous@anonymous.invalid>
To: <sip:anonymous@anonymous.invalid>
[...]
--++--

CPIM messages can contain From and To headers, and using [last_From:] and 
[last_To:] on the above message when sending a response yields:

UDP message sent

SIP/2.0 100 Trying
From: tel:2110;tag=697848969de74321800c6ec5de2f3236, 
<sip:anonymous@anonymous.invalid>
To: sip:u...@example.com, <sip:anonymous@anonymous.invalid>
[...]

Which is not desirable.

The reason is that the get_header method in sip_parser.cpp searches 
through the entire message, including the message body.

Proposed solution:

*** sip_parser_orig.cpp Thu Mar 17 01:05:48 2016
--- sip_parser.cpp      Tue Mar 22 12:59:13 2016
*************** char * get_header(const char* message, c
*** 139,144 ****
--- 139,150 ----
      }

      src_orig = strdup(message);
+
+     /* find end of SIP headers - perform search only until that */
+     ptr = strstr(src_orig, "\r\n\r\n");
+     if (ptr) {
+         *ptr = 0;
+     }

      do {
          /* We want to start from the beginning of the message each time

Please comment.

Cheers,
Zoltan
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to