Unable to call URI via TCP or TLS

Hello everyone. I’ve recently started toying with SIP and Asterisk to learn, and got two phones to talk to each other perfectly.

Now I wanted to make the server connect to pexip.me, which is a gateway my employer uses to connect to Microsoft Teams calls. The gateway supports connection via either TCP or TLS, but not UDP.

The extensions file contains the following:

[internal]
exten => _1XX,1,Dial(PJSIP/${EXTEN})

exten = 999,1,Answer()
same = n,Wait(1)
same = n,Playback(/tmp/anka)
same = n,Hangup()

exten = 800,1,Dial(PJSIP/dummy/sip:test@pexip.me)
exten = 801,1,Dial(PJSIP/dummy/sip:test@pexip.me\;transport=tcp)
exten = 802,1,Dial(PJSIP/dummy/sip:test@ygg1.vp.vc\;transport=tcp)
exten = 803,1,Dial(PJSIP/dummy/sip:test@185.94.243.219\;transport=tcp)
exten = 804,1,Dial(PJSIP/test@pexip)
exten = 805,1,Dial(PJSIP/pexip/sip:test@ygg1.vp.vc)
exten = 806,1,Dial(PJSIP/pexip/sips:test@ygg1.vp.vc:5061)

The endpoints in pjsip.conf file look like this:

[dummy]
type=endpoint
allow=!all,g722,alaw,ulaw

[pexip]
type=endpoint
allow=!all,g722,alaw,ulaw
aors=pexip

[pexip]
type=aor
contact=sips:ygg1.vp.vc:5061
contact=sips:ygg2.vp.vc:5061

Currently, none of the 80x extensions work.

  • 800 and 805 causes NAPTR resolution to be performed, then SRV resolution which indicates that TCP connection must be used (there are no UDP SRV records, see VoIP Toolbox), but then proceeds to attempt to connect via UDP anyway, which times out.
  • 801 and 802 attempts NAPTR resolution, and then immediately returns 503 without attempting to connect via TCP.
  • 803, 804 and 806 directly returns 503, with no NAPTR resolution.

I am using Asterisk 22.1.0 on Debian Bookworm, as available in http://deb.freepbx.org/freepbx17-prod (but without FreePBX, only the Asterisk daemon is running)

Is a TCP or TLS transport configured?

Alright, my bad.

I literally started toying with Asterisk yesterday, and I thought considering it required binding to a port, transports were used only for inbound connections, and that they wouldn’t be required for outbound connections. Configuring a TCP endpoint fixed the problem!

Many thanks for your help.