1
  1. I am testing the integration of a SIP Server(just a PBX) with another PBX.
  2. The incoming call comes into the PBX and is sent to my SIP Server.
  3. Once the call arrives on my SIP Server, it is then again sent back to a user who is registered to my PBX. Here we have 2 call legs – one from the caller to PBX and another from Sip Server to called party.
  4. The call is set up correctly and there is no issue with audio as well.
  5. When the called party releases the call, my SIP Server sends a BYE message to called party and caller in the same TCP packet.

Upon running a Wireshark trace I found that BYE message from my SIP Server reaches the called party but never reaches the caller. I know there is a firewall between my SIP Server and PBX.

Question: Is there an option for how to prevent multiple SIP messages in a single TCP packet? Other than using UDP or fight against FW?

>> BYE from SIP Server to called party and it gets a 200 OK:

11:39:03.163: Sending [31,TCP] 462 bytes to 10.cc.dd.ddf:5060 >>>>>

BYE sip:+xxxxxxxxx@10.xx.cc.vv:1122;transport=tcp SIP/2.0

Call-ID: 003BA5CE-58A9-1D9C-ACEB-886231C0AA77-57379@1xx.vv.vv.vvv

<................>

>> BYE from SIP Server to the caller and it never makes it to the PBX:

11:39:03.163: Sending [31,TCP] 448 bytes to 10.cc.dd.ddf:5060 >>>>>

BYE sip:+420702252645@10.cc.cc.bb:5060;transport=tcp SIP/2.0

Call-ID: acda8080-da917a0e-5a26b-8a61610a@10.xx.cc.vvb

Bashab
  • 33
  • 6

1 Answers1

3

Is there an option for how to prevent multiple SIP messages in a single TCP packet?

While the setup your describe is confusing (images with setup and message flow might make it more clear) and the question by itself is likely off-topic (unrelated to programming), this specific part of the question can be answered:
There is no option like this in SIP. While your specific but unknown endpoint or PBX might have such an option it is unlikely. The sender is fully within the specification if it packs multiple SIP messages to the same hop (i.e. SIP endpoint or SIP proxy) into the same TCP connection where they also can end up in the same packet because this is how TCP works. If the recipient has problems with this then it is a bug in the recipient and should be fixed there instead of working around it in every possible peer.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
  • Hi Steffen, Is there a specification which states that multiple SIP messages can be within the same TCP packet? – user1491636 Oct 26 '21 at 14:53
  • @user1491636: Packets are irrelevant for TCP, since from the perspective of the application all is a byte stream. There is no extra SIP specific specification needed for this because this is just how TCP works. If multiple messages can be shortly after each other inside the same TCP connection (which they can) then they can also end up in the same packet. Any applications which blindly assume that a single `send` by the sender will match a single `recv` at the recipient are broken - while this is true for UDP (datagram) it is not true for TCP (stream). – Steffen Ullrich Oct 26 '21 at 15:07