[asterisk-bugs] [Asterisk 0010947]: Content-Type: multipart/mixed not recognised correctly (SIP-T on not working)

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Nov 15 05:12:59 CST 2007


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=10947 
====================================================================== 
Reported By:                gasparz
Assigned To:                oej
====================================================================== 
Project:                    Asterisk
Issue ID:                   10947
Category:                   Channels/chan_sip/Interoperability
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.12.1  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             10-11-2007 08:57 CDT
Last Modified:              11-15-2007 05:12 CST
====================================================================== 
Summary:                    Content-Type: multipart/mixed not recognised
correctly (SIP-T on not working)
Description: 
In fundtion find_sdp the recognition of the application/sdp is based on a
false presummtion: that there is only one header and the content-type
header is the first one.

To be able to accept SIP-T messages RFC 3372 defines 2 headers in the SDP
body:
Content-type: application/sdp;
Content-disposition: session; handling=required;

some implementations of SIP-T invert the order of the headers (totally
acceptable)

Content-Type: multipart/mixed;boundary=sonus-content-delim
MIME-Version: 1.0

--sonus-content-delim
Content-Disposition: session; handling=required
Content-Type: application/sdp

My patch does a better parsing based on the following algorithm:
Find delimiter
Search headers until found an empty line
if in these headers we find a Content-Type: application/sdp header we put
the start of the sdp to the empty line
The last line of the sdp is either the previous line of the delimiter or
the last line in the message (if the SDP part is the last part from the
multipart message and there is no delimiter at the end)

How to reproduce:
Send the following invite:
INVITE sip:+number at ip_address:5060 SIP/2.0.
Via: SIP/2.0/UDP ip_address:5060;branch=z9hG4bK02B04622ae828267f1c.
From: <sip:+number at ip:5060;isup-oli=0>;tag=gK0210492c.
To: <sip:+:+number at ip_address:5060>.
Call-ID: 134846_30026 at ip.
CSeq: 9886 INVITE.
Max-Forwards: 70.
Allow: INVITE,ACK,CANCEL,BYE,PRACK,UPDATE,OPTIONS.
Accept: application/sdp, application/isup, application/dtmf,
application/dtmf-relay,  multipart/mixed.
Contact: <sip:+number at ip:5060>.
P-Asserted-Identity: <sip:+number at ip:5060>.
Supported: 100rel.
Content-Length:  618.
Content-Type: multipart/mixed;boundary=sonus-content-delim.
MIME-Version: 1.0.
.
--sonus-content-delim.
Content-Disposition: session; handling=required.
Content-Type: application/sdp.
.
v=0.
o=Sonus_UAC 17967 3264 IN IP4 ip.
s=SIP Media Capabilities.
c=IN IP4 media_ip.
t=0 0.
m=audio 14870 RTP/AVP 0 8 18 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=no.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=sendrecv.
a=maxptime:20.
.
--sonus-content-delim.
Content-Disposition: signal; handling=optional.
Content-Type: application/isup; version=gr317; base=gr317.
.
.. .
..........hF.R$
...BdVWW.....Cq.6=.....#b.....
--sonus-content-delim--.


the path is against 1.4.13 but I can't select it from the list
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 11-15-07 05:12  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 89280

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r89280 | oej | 2007-11-15 05:12:58 -0600 (Thu, 15 Nov 2007) | 5 lines

Improve support for multipart messages. Code by gasparz, changes
by me (mostly formatting). Thanks, gasparz!

Closes issue http://bugs.digium.com/view.php?id=10947

------------------------------------------------------------------------ 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-15-07 05:12  svnbot         Checkin                                      
11-15-07 05:12  svnbot         Note Added: 0073686                          
11-15-07 05:12  svnbot         Status                   new => assigned     
11-15-07 05:12  svnbot         Assigned To               => oej             
======================================================================




More information about the asterisk-bugs mailing list