<div dir="ltr">Hi Răzvan - thanks for the reply<div><br></div><div>Looking into it, our working theory is that the problem is as follows...</div><div><br></div><div>UAC (WebRTC dialer) is sending a corrupted SIP 200OK to an OPTIONS message over WebSocket. Message has a blank line in it and the content length is 0. OpenSIPS sees the blank line as the end of the SIP message but UAC is sending more (garbage text) after the blank line. I assume that what comes after the blank line is buffered and seen as the start of a new SIP message? When the next SIP message comes in it gets appended to the corrupt message segment and when OpenSIPS tries to parse it, it sees it as nonsense (which it is).</div><div><br></div><div>Just waiting on testing a new version of UAC which will hopefully confirm that this is the problem.</div><div><br></div><div>cheers,</div><div><br></div><div>M</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 2 Jun 2021 at 08:57, Răzvan Crainea <<a href="mailto:razvan@opensips.org">razvan@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, Mark!<br>
<br>
Most likely the problem appear prior to that Contact header you're <br>
seeing - somehow OpenSIPS thinks the packet starts with the Contact <br>
token, whereas, most likely, the Contact is part of a previous message, <br>
not shown in this report.<br>
There's no such thing as SIP message fragmentation - it's either UDP or <br>
TCP fragmentation. However, fragmentation only appears when the package <br>
is higher than MTU. I don't think this is the case here - What I think <br>
there is, is a broken UA which is not setting a correct Content-Length, <br>
or is sending garbage after sending the packet. But the only way to <br>
figure out is to make a pcap for the entire connection and see where it <br>
starts breaking.<br>
<br>
Best regards,<br>
<br>
Răzvan Crainea<br>
OpenSIPS Core Developer<br>
<a href="http://www.opensips-solutions.com" rel="noreferrer" target="_blank">http://www.opensips-solutions.com</a><br>
<br>
On 5/26/21 2:15 PM, Mark Allen wrote:<br>
> I'm seeing a weird, intermittent error. The most common occurrence is <br>
> with a 200OK returned by Mid-Registrar on a re-REGISTER using <br>
> registration throttling, but we see it elsewhere. It appears that the <br>
> 200OK message is getting garbled.<br>
> <br>
> We have a bit of a weird setup to overcome issues we were having with <br>
> Mid-Registrar and WebSocket addressing. Mid-Registrar is looping back <br>
> 200OK to OpenSIPS before it then gets sent down the WebSocket. 90+% of <br>
> the time it's absolutely fine, but occasionally the 200OK seems to be <br>
> corrupted.<br>
> <br>
> Here's an example. What we are seeing in this message is...<br>
> <br>
> Contact: <<a href="http://sip:1234@abc.def.com:5060" rel="noreferrer" target="_blank">sip:1234@abc.def.com:5060</a> <<a href="http://sip:1234@abc.def.com:5060" rel="noreferrer" target="_blank">http://sip:1234@abc.def.com:5060</a>>><br>
> User-Agent: MWWRTC 3.4.21042#015#012Accept: <br>
> application/sdp,application/dtmf-relay,text/plain<br>
> <br>
> ...preceding...<br>
> <br>
> SIP/2.0 200 OK<br>
> Via: SIP/2.0/TCP <br>
> 192.168.1.23:5060;received=192.168.1.23;rport=42385;branch=z9hG4bK22a8.4fa6d127.0;i=b4986fe4<br>
> ...etc...<br>
> <br>
> ...so OpenSIPS is failing to parse the message.<br>
> <br>
> What I'd like to know is, is this a sign of SIP message fragmentation?<br>
> <br>
> <br>
> <br>
> Log entries (IP addresses, domains, and extensions changed to protect <br>
> the innocent!):<br>
> <br>
> ERROR:core:parse_method: invalid character :<br>
> DBG:core:tcp_read_req: tcp_read_req end<br>
> INFO:core:parse_first_line: failed to parse the method<br>
> INFO:core:parse_first_line: bad message<br>
> DBG:core:parse_msg: invalid message<br>
> ERROR:core:parse_msg: message=<Contact: <<a href="http://sip:1234@abc.def.com:5060" rel="noreferrer" target="_blank">sip:1234@abc.def.com:5060</a> <br>
> <<a href="http://sip:1234@abc.def.com:5060" rel="noreferrer" target="_blank">http://sip:1234@abc.def.com:5060</a>>>#015#012User-Agent: MWWRTC <br>
> 3.4.21042#015#012Accept: <br>
> application/sdp,application/dtmf-relay,text/plain#015#012SIP/2.0 200 <br>
> OK#015#012Via: SIP/2.0/TCP <br>
> 192.168.1.23:5060;received=192.168.1.23;rport=42385;branch=z9hG4bK22a8.4fa6d127.0;i=b4986fe4#015#012Via: <br>
> SIP/2.0/WSS <br>
> 98kaag0xmybq.invalid;received=4.56.78.110;branch=z9hG4bKU6O3fJQGeLvuACMTXTArJgJW73rOD5dU;rport=52570#015#012From: <br>
> <<a href="mailto:sip%3A1234@abc.def.com" target="_blank">sip:1234@abc.def.com</a> <br>
> <mailto:<a href="mailto:sip%253A1234@abc.def.com" target="_blank">sip%3A1234@abc.def.com</a>>>;tag=Lyk010G476K7xcKrE84M#015#012To: <br>
> <<a href="mailto:sip%3A1234@abc.def.com" target="_blank">sip:1234@abc.def.com</a> <br>
> <mailto:<a href="mailto:sip%253A1234@abc.def.com" target="_blank">sip%3A1234@abc.def.com</a>>>;tag=af78-6213d386c3edcd02707b0c0aa8423d3a#015#012Call-ID: <br>
> 666b5e7c-cef3-f306-4b79-60d3160dc5d0#015#012CSeq: 28825 <br>
> REGISTER#015#012Contact: <br>
> <sips:1234@98kaag0xmybq.invalid;transport=wss>;expires=60;received="sip:<a href="http://4.56.78.110:52570" rel="noreferrer" target="_blank">4.56.78.110:52570</a> <br>
> <<a href="http://4.56.78.110:52570" rel="noreferrer" target="_blank">http://4.56.78.110:52570</a>>"#015#012Server: OpenSIPS (3.1.1 <br>
> (x86_64/linux))#015#012Content-Length: 0#015#012#015#012><br>
> ERROR:core:receive_msg: Unable to parse msg received from <br>
> [<a href="http://192.168.1.23:5060" rel="noreferrer" target="_blank">192.168.1.23:5060</a> <<a href="http://192.168.1.23:5060" rel="noreferrer" target="_blank">http://192.168.1.23:5060</a>>]<br>
> ERROR:core:tcp_handle_req: receive_msg failed<br>
> DBG:core:tcp_read_req: tcp_read_req end<br>
> <br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
> <br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>