<div dir="ltr">Hi guys,<div><br></div><div>I've been using FreeSWITCH for a couple of weeks and built a PBX and B2BUA out of it. I've seen some interesting things that happen when PBXs get m= headers that they don't like (such as Asterisk balking when it gets multiple video streams), and I've seen one recently while calling an old school PBX.</div>
<div><br></div><div>Here's my build:</div><div><br></div><div style>Me(Linphone) -> PBX (FreeSWITCH) -> B2BUA (FreeSWITCH) -> Destination</div><div style><br></div><div style>The B2BUA uses proxy_media mode and doesn't have a problem, but the PBX uses passthrough codecs (so it's reading the SDP packet) and sees a problem, throwing a 500 error back to my softphone</div>
<div style><br></div><div style>The outbound packet from the PBX to the B2BUA:</div><div style><br></div><div style><div>send 1428 bytes to udp/[210.7.45.66]:5060 at 02:46:48.407768:</div><div> ------------------------------------------------------------------------</div>
<div> INVITE <a href="mailto:sip%3A%2B61269337555@210.7.45.66">sip:+61269337555@210.7.45.66</a> SIP/2.0</div><div> Via: SIP/2.0/UDP 210.7.46.240;rport;branch=z9hG4bKZrKQvvHNSy64m</div><div> Max-Forwards: 69</div><div>
From: "Sam Russell" <<a href="mailto:sip%3A%2B6442820079@210.7.46.240">sip:+6442820079@210.7.46.240</a>>;tag=e722ggarBe7je</div><div> To: <<a href="mailto:sip%3A%2B61269337555@210.7.45.66">sip:+61269337555@210.7.45.66</a>></div>
<div> Call-ID: 1d80cd44-781c-1231-8db7-0050568a49fc</div><div> CSeq: 47499340 INVITE</div><div> Contact: <sip:gw+sbc@210.7.46.240:5060;transport=udp;gw=sbc></div><div> User-Agent: FreeSWITCH-mod_sofia/1.3.13b+git~20130223T185558Z~28680c5e58</div>
<div> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE</div><div> Supported: timer, precondition, path, replaces</div><div> Allow-Events: talk, hold, conference, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer</div>
<div> Content-Type: application/sdp</div><div> Content-Disposition: session</div><div> Content-Length: 453</div><div> X-FS-Support: update_display,send_info</div><div> Remote-Party-ID: "Sam Russell" <<a href="mailto:sip%3A%2B6442820079@210.7.46.240">sip:+6442820079@210.7.46.240</a>>;party=calling;screen=yes;privacy=off</div>
<div> </div><div> v=0</div><div> o=FreeSWITCH 1375638308 1375638309 IN IP4 210.7.46.240</div><div> s=FreeSWITCH</div><div> c=IN IP4 210.7.46.240</div><div> t=0 0</div><div> m=audio 32500 RTP/AVP 98 99 100 0 8 101 13</div>
<div> a=rtpmap:98 SPEEX/32000</div><div> a=fmtp:98 vbr=on</div><div> a=rtpmap:99 SPEEX/16000</div><div> a=fmtp:99 vbr=on</div><div> a=rtpmap:100 SPEEX/8000</div><div> a=fmtp:100 vbr=on</div><div> a=rtpmap:101 telephone-event/8000</div>
<div> a=fmtp:101 0-16</div><div> a=ptime:20</div><div> m=video 29910 RTP/AVP 102 103</div><div> a=rtpmap:102 H263-1998/90000</div><div> a=fmtp:102 CIF=1;QCIF=1</div><div> a=rtpmap:103 VP8/90000</div><div><br></div>
<div style>The offending packet that it returns:</div><div style><br></div><div style><div> ------------------------------------------------------------------------</div><div>recv 1357 bytes from udp/[210.7.45.66]:5060 at 02:46:48.739816:</div>
<div> ------------------------------------------------------------------------</div><div> SIP/2.0 200 OK</div><div> Via: SIP/2.0/UDP 210.7.46.240;rport=5060;branch=z9hG4bKZrKQvvHNSy64m</div><div> From: "Sam Russell" <<a href="mailto:sip%3A%2B6442820079@210.7.46.240">sip:+6442820079@210.7.46.240</a>>;tag=e722ggarBe7je</div>
<div> To: <<a href="mailto:sip%3A%2B61269337555@210.7.45.66">sip:+61269337555@210.7.45.66</a>>;tag=teBFaBg5DjBHm</div><div> Call-ID: 1d80cd44-781c-1231-8db7-0050568a49fc</div><div> CSeq: 47499340 INVITE</div><div>
Contact: <sip:+61269337555@210.7.45.66:5060;transport=udp></div><div> User-Agent: FreeSWITCH-mod_sofia/1.2.11+git~20130723T222215Z~55b6b8424f</div><div> Accept: application/sdp</div><div> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE</div>
<div> Supported: timer, precondition, path, replaces</div><div> Allow-Events: talk, hold, conference, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer</div>
<div> Content-Type: application/sdp</div><div> Content-Disposition: session</div><div> Content-Length: 242</div><div> X-FS-Display-Name: Outbound Call</div><div> X-FS-Display-Number: <a href="mailto:sip%3A%2B61269337555@210.7.45.66">sip:+61269337555@210.7.45.66</a></div>
<div> x-inin-crn: 1101488375;loc=%3cRegionDefaultLocation%3e</div><div> X-FS-Support: update_display,send_info</div><div> Remote-Party-ID: "Outbound Call" <<a href="mailto:sip%3A%2B61269337555@210.7.45.66">sip:+61269337555@210.7.45.66</a>>;party=calling;privacy=off;screen=no</div>
<div> </div><div> v=0</div><div> o=FreeSWITCH 914114385 914114386 IN IP4 210.7.45.66</div><div> s=FreeSWITCH</div><div> c=IN IP4 210.7.45.66</div><div> t=0 0</div><div> m=audio 17704 RTP/AVP 8 101</div><div>
a=rtpmap:8 PCMA/8000</div><div> a=rtpmap:101 telephone-event/8000</div><div> a=fmtp:101 0-15</div><div> m=video 0 RTP/AVP 96</div><div> a=rtpmap:96 /0</div><div><br></div><div><br></div><div style>The PBX then balks and sends a 500 error to my softphone</div>
<div style><br></div><div style><div>send 704 bytes to udp/[210.7.45.66]:5060 at 02:46:48.740796:</div><div> ------------------------------------------------------------------------</div><div> BYE sip:+61269337555@210.7.45.66:5060;transport=udp SIP/2.0</div>
<div> Via: SIP/2.0/UDP 210.7.46.240;rport;branch=z9hG4bK1a68ZjKvKgKac</div><div> Max-Forwards: 70</div><div> From: "Sam Russell" <<a href="mailto:sip%3A%2B6442820079@210.7.46.240">sip:+6442820079@210.7.46.240</a>>;tag=e722ggarBe7je</div>
<div> To: <<a href="mailto:sip%3A%2B61269337555@210.7.45.66">sip:+61269337555@210.7.45.66</a>>;tag=teBFaBg5DjBHm</div><div> Call-ID: 1d80cd44-781c-1231-8db7-0050568a49fc</div><div> CSeq: 47499341 BYE</div><div>
Contact: <sip:gw+sbc@210.7.46.240:5060;transport=udp;gw=sbc></div><div> User-Agent: FreeSWITCH-mod_sofia/1.3.13b+git~20130223T185558Z~28680c5e58</div><div> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE</div>
<div> Supported: timer, precondition, path, replaces</div><div> Reason: SIP;cause=488;text="Incomplete offer/answer"</div><div> Content-Length: 0</div><div> </div><div> ------------------------------------------------------------------------</div>
<div><br></div><div><br></div><div style>Then I see this in the logs straight after</div><div style><br></div><div style>2013-08-05 14:46:48.736200 [DEBUG] sofia.c:1431 nua_i_media_error: unknown event 22: 988 Incomplete offer/answer</div>
<div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style>The only thing odd about the SDP packet that I get back is the attribute after the m=video line. I think FreeSWITCH sees this, doesn't ignore the a= line like it should, and then gets upset with not being able to match anything before the "/0". RFC 4566 (5.13) says that </div>
<div style><br></div><div style>"If an attribute is received that is not understood, it MUST be ignored by the receiver."</div><div style><br></div><div style>So FreeSWITCH should be ignoring any "a=" attributes after it gets a "m=" line with a 0 port, but should also ignore the attribute if it can't match (but maybe leave a warning/notice in logs)?</div>
<div style><br></div><div style>Does this look right? Has anyone else seen this, and is there a workaround?</div><div style><br></div><div style>Cheers</div><div style>Sam</div></div></div></div></div>