#991170 asterisk: chan_sip stream transport breaks after NUL characters in message body

Package:
asterisk
Source:
asterisk
Description:
Open Source Private Branch Exchange (PBX)
Submitter:
Ondřej Holas
Date:
2021-07-16 13:15:04 UTC
Severity:
important
Tags:
#991170#5
Date:
2021-07-16 12:13:23 UTC
From:
To:
When chan_sip processes incoming SIP message and its body contains NUL
characters (for example due to deflate encoding), reading body from buffer
stops at the NUL character, thus ignoring the rest of the buffer and waiting
for additional incoming data to catch up all data of size indicated in
the Content-Length header. Effectively this behavior causes breakup of
SIP communication - ignoring subsequent messages and returning errors
"method not implemented".

Steps to reproduce:

- set up Linhone for Android to register with Asterisk
- in rasterisk, turn on debugging for the new peer: "sip set debug peer
xxxx"
- in Linphone's settings, turn on Settings/Contacts/Friendlist subscribe
- in rasterisk, wait for the SUBSCRIBE message with deflated body
- in Linphone, try to place a call
- the INVITE message is not processed as chan_sip believes to be
continuation
  of body belonging to the preceding SUBSCRIBE message

#991170#10
Date:
2021-07-16 12:58:36 UTC
From:
To:
Important thing to note - the problem applies to stream transports - TCP and
TLS. In the steps to reproduce, the first one should be:


- set up Linphone for Android to register with Asterisk USING TCP OR TLS<br><br>Ondrej<br><br>