[SR-Users] [NATHELPER] bug in SDP parsing when dealing with multi-part bodies ?

Pascal Maugeri pascal.maugeri at gmail.com
Wed May 12 17:12:18 CEST 2010


Hi

I got the following error when dealing with SIP INVITE with multi-part when
the client is behind NAT:

May 12 15:27:04 test /usr/sbin/kamailio[1792]: ERROR: nathelper
[nathelper.c:2954]: can't extract body from the message


The SIP INVITE message looks like:

INVITE sip:toto at test.net <sip%3Atoto at test.net> SIP/2.0
[...]
Content-Type: multipart/mixed;boundary=gnkr
Content-Length: 659

--gnkr
Content-Type: application/sdp
Content-Length: 330

v=0
o=pascal 1273565967736 1273565967737 IN IP4 10.1.1.226
[...]


It looks the Content-length within the multi-part is not accepted.

I fixed it changing the source code of parser/sdp/sdp_helpr_funcs.c,
in get_sdp_hdr_field() function:

        switch(hdr->type){
                case HDR_CONTENTTYPE_T:
                case HDR_CONTENTDISPOSITION_T:
                case HDR_CONTENTLENGTH_T:


replaced with:


        switch(hdr->type){
                case HDR_CONTENTTYPE_T:
                case HDR_CONTENTDISPOSITION_T:

(I'm using kamailio 3.0.1)

Cheers
Pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100512/0aed11be/attachment.htm>


More information about the sr-users mailing list