Why is FreePBX listening on 5060 for TCP but 9997 for UDP?

I read this article on how to change bindport AND ITS WORKING!!! FINALLY!! Thanks to @tm1000 's reply to this post:

But TCP is still not binding

Why is TCP not binding to new port defined in freepbx sip settings gui and how can i fix?

Thanks

This shows UDP bind to 9997 but TCP still listening on 5060

[email protected]:~# netstat -lnp | grep asterisk
tcp        0      0 192.168.2.200:5060      0.0.0.0:*               LISTEN      2968/asterisk
tcp        0      0 127.0.0.1:5038          0.0.0.0:*               LISTEN      2968/asterisk
tcp        0      0 0.0.0.0:2000            0.0.0.0:*               LISTEN      2968/asterisk
tcp        0      0 0.0.0.0:1720            0.0.0.0:*               LISTEN      2968/asterisk
udp        0      0 0.0.0.0:4569            0.0.0.0:*                           2968/asterisk
udp        0      0 192.1682..200:9997     0.0.0.0:*                           2968/asterisk
udp        0      0 0.0.0.0:5000            0.0.0.0:*                           2968/asterisk
udp        0      0 0.0.0.0:4520            0.0.0.0:*                           2968/asterisk
unix  2      [ ACC ]     STREAM     LISTENING     3819     2968/asterisk       /var/run/asterisk/asterisk.ctl
[email protected]:~#

Try setting your tcpbindaddress to n.n.n.n:9997

where n.n.n.n is appropriate to your deployment, generally

tcpbindaddress=0.0.0.0:9997

will listen to any TCP SIP connections on port 9997 (but no longer on 5060 :wink: )

1 Like

Worked! TCP shows custom bindport now, and TCP remote extension is registered to custom TCP bindport!

Thanks!

This tricks is working to make a call. But “end call” is not working. In the ACK SIP request it is again adding the 5060 port in the contact header when it is TCP and outside network.

If the client is using TCP communication, it added the via header with :5060;transport=tcp. Even if my configuration is -
tcpenable=yes
tcpbindaddr=0.0.0.0:5555