Summary:ASTERISK-13982: [patch] blank lines in _sip_tcp_helper_thread caused by sip dummy packages
Reporter:Kristijan Vrban (vrban)Labels:
Date Opened:2009-04-18 03:46:56Date Closed:2009-09-10 16:39:56
Versions:Frequency of
Environment:Attachments:( 0) sip_dummy_packages.patch
Description:hello, i tested TLS/TCP with a softphone called PhonerLite (based on oSIP) And when i used it, the TCP buffer in _sip_tcp_helper_thread always was filled with a blank line. Because the softphone broadcast empty SIP dummy packages as NAT opener.

This was very annoying, because the dummy SIP package contents only a single "\r\n", with the effect, that a real SIP messages was getting this extra blank line from the dummy package because it was still in the buffer, and so the parse_request and get_header function was not capable to work proper. I my case this was the reason the return value for the Content-Length was always 0 and
no sdp was read.

attached is a patch for this issue, but i am not sure if this should go into chan_sip because it is a fix for crappy SIP dummy packages send by other. But it is good to know what could go wrong in the _sip_tcp_helper_thread function and have a possible solution.
Comments:By: Olle Johansson (oej) 2009-09-10 14:37:40

This is very common behaviour, but I haven't seen it on TCP as there are other ways to keep the TCP session alive. I think we should be prepared to handle this.

By: Russell Bryant (russell) 2009-09-10 16:39:56

I believe this should be fixed by revision 203779 in Asterisk trunk.  Please reopen if you still have a problem.