freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

Too long Reason header swallowed

Open dcw67 opened this issue 3 years ago • 3 comments

Describe the bug

A BYE message with a Reason: header that is longer than 128 characters get responded to on the B leg with a 200 OK as expected but is not forwarded across a bridge back to the A leg.

To Reproduce

Send a BYE packet containing a Reason head with a long text description. For example:

BYE sip:[email protected]:5060 SIP/2.0 Via: SIP/2.0/UDP 139.162.48.4:5060;branch=z9hG4bK-10866-1-6 Route: sip:103.26.173.62;lr;ftag=9ra9N222HeQ8e From: sip:[email protected];tag=10866SIPpTag011 To: "614xxxxxxxx" sip:[email protected];tag=9ra9N222HeQ8e Call-ID: 690b9544-d34d-123a-a98a-b2ad0b93b34a CSeq: 2 BYE Contact: sip:[email protected]:5060 Max-Forwards: 70 Content-Length: 0 Reason: Q.850;cause=16;text="The call has ended because there is no longer any parties left in the call. This is an exceptionally long reason header and will probably break things" User-Agent: SONUS SBCSWeLite 9.0.4v316 Azure Ribbon

Expected behaviour Expected the BYE to pass back through the bridge to the A leg. This does not occur resulting in the A leg remaining up until the A leg hangs up.

Package version or git hash

FreeSWITCH Version 1.10.7-release-19-883d2cb662~64bit (-release-19-883d2cb662 64bit)

Trace logs FS log and PCAPS attached

Network topology is:

offnet -> routing node routing_node -> FS SBC (2 x interfaces) FS SBC -> proxy proxy -> CPE

In attached PCAPS:

offnet -> 192.168.153.38 192.168.153.38 -> 192.168.153.39 (private interface) 103.26.173.42 (public interface) -> 103.26.173.62 103.26.173.62 -> 139.162.48.4

In LongReasonHeaderCustomerLeg.pcap the BYE arrives at SBC In LongReasonHeaderInternalLeg.pcap te BYE is not sent to the routing node

LongReasonHeader.zip

backtrace from core file n/a

dcw67 avatar Dec 10 '21 05:12 dcw67

Hello, has anyone made a patch? This problem happens frequently for me.

gilles0606 avatar Mar 10 '22 07:03 gilles0606

Long Reason headers will be truncated to 128 bytes in mod_sofia.c:490+501. A quick hack could be to enhance the char array.

#1293 is the same issue

kukies007 avatar Jun 23 '22 11:06 kukies007

A quick hack could be to enhance the char array.

hello, increasing the size is not a solution, since the next sbc freeswitch in the call, will have the same problem I made a patch that corrects the field https://github.com/signalwire/freeswitch/pull/1789

gilles0606 avatar Sep 02 '22 06:09 gilles0606

hello @dcw67 i recently had the same problem and my partial solution is fix with

<action application="export" data="disable_q850_reason=true"/>

bit4bit avatar Mar 31 '23 15:03 bit4bit