PJSIP Works On UDP But Not TCP

Home » Asterisk Users » PJSIP Works On UDP But Not TCP
Asterisk Users 4 Comments

Hi all,

I have Asterisk 13 running and I’m currently trying to get PJSIP working on TCP.

My transport looks like this. My box is not behind NAT.

[transport-tcp]
type=transport protocol=tcp bind=0.0.0.0:5061

My endpoint looks like this:

[user1]
type=endpoint transport=transport-tcp context=local_out disallow=all allow=alaw allow=ulaw allow=g722
auth=user1
aors=user1
direct_media=no rtp_symmetric=yes force_rport=yes rewrite_contact=yes

[user1]
type=auth auth_type=userpass password3456
username=user1

[user1]
type=aor remove_existing=yes max_contacts=1

I have two endpoints user1 and user 2. Both are able to register fine.

With both endpoints I can call into asterisk and do an echo test without issue or listen to music.

However, when trying to call one endpoint from another, nothing happens.

My dialplan is fine. Switching the transport to UDP allows me to call between endpoints.

In TCP however, I can see PJSIP send an invite, but then receives no responses.

I’ve spent all evening trying to figure it out and am a bit stumped now, since changing to UDP works straight away.

I’m testing with a snom 760 and cSipSimple, calls don’t work in either direction and regardless of local network or mobile network.

Any help would be greatly appreciated.

Kind Regards,

Chirag

4 thoughts on - PJSIP Works On UDP But Not TCP

  • Joshua Colp wrote:

    Joshua…I did that but now my endpoints won’t register.

    Kind Regards,

    Chirag

  • Chirag Desai wrote:

    That should have no impact on things. Can you clarify what you mean by it doesn’t register? What happens?

  • Joshua Colp wrote:

    *> >> >*
    *> >> >* > Remove “transport=transport-tcp” from your endpoints.
    *> >> >> >* Joshua…I did that but now my endpoints won’t register.
    *

    Ignore me…it’s working! Thanks so much 🙂