Hi,

Here is one example, the XML body is not standard (yet), so I had to remove it. 
Content-Length is to be checked

```
2016/04/11 16:38:17.645936 192.168.2.2:5062 -> 192.168.100.1:5060
INVITE sip:[email protected] SIP/2.0
via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-18344-1-10
From: "alice" <sip:[email protected]>;tag=183446416897
To: "bob" <sip:[email protected]>
Call-ID: alice-bob-call
CSeq: 2 INVITE
Contact: <sip:[email protected]:5062>
Max-Forwards: 70
Expires: 3600
Content-Type: multipart/mixed;boundary=8920nv9wiwdnnsrnia9buoyci39qsi6x
Content-Disposition: session
User-Agent: SIPp/Linux
Content-Length:   759


--8920nv9wiwdnnsrnia9buoyci39qsi6x
Content-Type: application/some-random-mime+xml
Content-Length: 290

<?xml version="1.0" encoding="UTF-8"?>
<xxxxxxxx>
<xxxxxxxxxxxxxxxx>
<xxxxxxxxx>yyyyyyyy</xxxxxxxxx>
<aaaaaaaaa>bbbbbbbb</aaaaaaaaa>
</xxxxxxxxxxxxxxxx>
</xxxxxxxx>
--8920nv9wiwdnnsrnia9buoyci39qsi6x
Content-Type: application/sdp
Content-Length: 479

v=0
o=- 3669370665 3669370665 IN IP4 192.168.2.2
s=application-media
t=0 0
c=IN IP4 192.168.2.2
m=audio 8000 RTP/AVP 106 96
a=rtcp:8001 IN IP4 192.168.2.2
a=sendrecv
a=rtpmap:106 AMR-WB/16000
a=fmtp:106 octet-align=0; mode-set=4
a=ptime:20
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
m=application 9000 udp XXXXX
8920nv9wiwdnnsrnia9buoyci39qsi6x--
```

The command get_body_part("application/sdp", "$var(sdp)"); writes the following 
content in $var(sdp):

```
Content-Length: 479

v=0
o=- 3669370665 3669370665 IN IP4 192.168.2.2
s=application-media
t=0 0
c=IN IP4 192.168.2.2
m=audio 8000 RTP/AVP 106 96
a=rtcp:8001 IN IP4 192.168.2.2
a=sendrecv
a=rtpmap:106 AMR-WB/16000
a=fmtp:106 octet-align=0; mode-set=4
a=ptime:20
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
m=application 9000 udp XXXXX
```

But the expected content is:

```
v=0
o=- 3669370665 3669370665 IN IP4 192.168.2.2
s=application-media
t=0 0
c=IN IP4 192.168.2.2
m=audio 8000 RTP/AVP 106 96
a=rtcp:8001 IN IP4 192.168.2.2
a=sendrecv
a=rtpmap:106 AMR-WB/16000
a=fmtp:106 octet-align=0; mode-set=4
a=ptime:20
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
m=application 9000 udp XXXXX
```

"Content-Length: 479" is a multipart header and should be ignored. From what I 
understand everything after a "Content-Type:" is considered as a body.

---
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/564#issuecomment-208383612
_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to