<div dir="ltr"><div>Hi List,</div><div><br></div><div>I have some weird  multipart/mixed;boundary issues.</div><div>I use kamailio 5.3.6 with rtpengine 7.x.x (same with 8.x.x).</div><div><br></div><div>If i try to remove a multipart/mixed and leave only the sdp with filter_body() that works except one thing.</div><div><br></div><div>The sender used IMHO an non RFC compliant version of rfc5621 and wrote the Content-Length Header twice (one in the header, one in the sdp).</div><div>After manipulating the SDP filter_body() lets Content-Length in the sdp (i guess).</div><div>And rtpengine is not happy with the sdp after that.</div><div>rtpengine [rtpengine.c:2588]: rtpp_function_call(): proxy replied with error: Failed to parse SDP<br></div><div><br></div><div>Any ideas how to solve this?</div><div><br></div><div>Kind regards</div><div>Karsten Horsmann</div><div><br></div><div><a href="https://tools.ietf.org/html/rfc5621#section-3.1">https://tools.ietf.org/html/rfc5621#section-3.1</a><br></div><div><br></div><div>route[REMOVE_MULTIPART] {<br>        if (has_body("multipart/mixed")) {<br>                if ($sel(cfg_get.remove.multipart) == 1) {<br>                        if (filter_body("application/sdp")) {<br>                                remove_hf("Content-Type");<br>                                append_hf("Content-Type: application/sdp\r\n");<br>                                msg_apply_changes();<br>                                xlog("L_WARN", "[$cfg(route)] Body part multipart/mixed with application/sdp found\n");<br>                        } else {<br>                                xlog("L_ERROR", "[$cfg(route)] Body part multipart/mixed without application/sdp found\n");<br>                        }<br>                } else {<br>                        xlog("L_INFO", "[$cfg(route)] Body part multipart/mixed found - manipulation disabled\n");<br>                }<br>        }<br>}<br></div><div><br></div><div>-------------------</div><div>INVITE <a href="http://sip:+49XXXXXXXX@172.20.120.57:5060">sip:+49XXXXXXXX@172.20.120.57:5060</a> SIP/2.0<br>Via: SIP/2.0/UDP 172.20.120.51:5061;branch=z9hG4bK-6589-1-0<br>From: sipp <<a href="http://sip:sipp@172.20.120.51:5061">sip:sipp@172.20.120.51:5061</a>>;tag=6589SIPpTag001<br>To: sut <<a href="http://sip:+49XXXXXXXXX@172.20.120.57:5060">sip:+49XXXXXXXXX@172.20.120.57:5060</a>><br>Call-ID: <a href="mailto:1-6589@172.20.120.51">1-6589@172.20.120.51</a><br>CSeq: 1 INVITE<br>Contact: <a href="http://sip:sipp@172.20.120.51:5061">sip:sipp@172.20.120.51:5061</a><br>Max-Forwards: 70<br>Subject: Performance Test<br>Content-Type: multipart/mixed;boundary=sonus-content-delim<br>Content-Length:  1185<br><br>--sonus-content-delim<br>Content-Type: application/sdp<br>Content-Length: 305<br><br>v=0<br>o=Sonus_UAC 895311 862130 IN IP4 8.8.8.8<br>s=SIP Media Capabilities<br>c=IN IP4 8.8.8.8<br>t=0 0<br>m=audio 26088 RTP/AVP 8 0 18 101<br>a=rtpmap:8 PCMA/8000<br>a=rtpmap:0 PCMU/8000<br>a=rtpmap:18 G729/8000<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:18 annexb=no<br>a=fmtp:101 0-15<br>a=sendrecv<br>a=rtcp:26089<br>a=ptime:20<br><br>--sonus-content-delim<br>Content-Type: application/pidf+xml<br><br><?xml version="1.0" encoding="UTF-8"?><presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10" xmlns:cl="urn:ietf:params:xml:ns:pidf:geopriv10:civicLoc"<br>mlns:btd="<a href="http://btd.orange-business.com">http://btd.orange-business.com</a>" entity="<a href="mailto:pres%3Ageotarget@btip.orange-business.com">pres:geotarget@btip.orange-business.com</a>"><tuple id="XXXX"><status><gp:geopriv><gp:location-info><cl:civicAddress><cl:country>DE</cl:countr<br><cl:A1>Some State</cl:A1><cl:A3>Somewhere</cl:A3><cl:A4>Somewhere</cl:A4><cl:A6>Somestreet</cl:A6><cl:YYY>1</cl:YYY><cl:PC>9999</cl:PC><cl:EMERGENCYZONE>XXXXXXX</cl:EMERG<br>CYZONE></cl:civicAddress></gp:location-info><gp:usage-rules></gp:usage-rules></gp:geopriv></status></tuple></presence><br>--sonus-content-delim--<br></div><div><br></div><div>---------------------</div><div>INVITE sip:+49XXXXXXXX@foo SIP/2.0<br>Via: SIP/2.0/TCP 212.XX.XX.XX;branch=z9hG4bKc228.6b8fdf20d79998d1d355feb2dcf5ba63.0<br>From: sipp <sip:sipp@foo>;tag=6589SIPpTag001<br>To: sut <sip:+49XXXXXXXX@foo><br>Call-ID: <a href="mailto:1-6589@172.20.120.51">1-6589@172.20.120.51</a><br>CSeq: 1 INVITE<br>Max-Forwards: 69<br>Content-Length:  347<br>Content-Type: application/sdp<br>P-Asserted-Identity: <sip:+49XXXXXXXX@212.XX.XX.XX><br>Contact: <sip:btpsh-60211bbe-674b-1@212.XX.XX.XX;transport=tcp><br><br>Content-Length: 305<br><br>v=0<br>o=Sonus_UAC 895311 862130 IN IP4 8.8.8.8<br>s=SIP Media Capabilities<br>c=IN IP4 8.8.8.8<br>t=0 0<br>m=audio 26088 RTP/AVP 8 0 18 101<br>a=rtpmap:8 PCMA/8000<br>a=rtpmap:0 PCMU/8000<br>a=rtpmap:18 G729/8000<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:18 annexb=no<br>a=fmtp:101 0-15<br>a=sendrecv<br>a=rtcp:26089<br>a=ptime:20<br></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Mit freundlichen Grüßen<br>*Karsten Horsmann*<br></div></div>