Zoltan,
I add some issues when trying CPIM contents, and your post arrived just in time.
I have tried your code modification : great !!
Thanks for sharing this helpful trick,
Norbert.
De : EXT [email protected]
[mailto:[email protected]]
Envoyé : mardi 22 mars 2016 14:58
À : [email protected]
Objet : [Sipp-users] get_header: don't search in the message body
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:[email protected]
[...]
Content-Type: multipart/mixed;boundary=++
--++
Content-Type: application/sdp
[...]
--++
Content-Type: message/cpim
[...]
From: <sip:[email protected]>
To: <sip:[email protected]>
[...]
--++--
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:[email protected]>
To: sip:[email protected], <sip:[email protected]>
[...]
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users