outgoing calls not working with sip trunk with tls PJSIP

Hi!

I have a SIP TRUNK with TLS configured as PJSIP, the incoming calls are working but not the outgoing. I’m having this message.

  • Executing [s@macro-dialout-trunk:27] Dial(“PJSIP/1015-00000015”, “PJSIP/98092201111@+18093303000,300,T”) in new stack
    [2025-11-17 14:58:24] ERROR[46756]: res_pjsip.c:852 ast_sip_create_dialog_uac: Endpoint ‘+18093303000’: Could not create dialog to invalid URI ‘+18093303000’. Is endpoint registered and reachable?
    [2025-11-17 14:58:24] ERROR[46756]: chan_pjsip.c:2698 request: Failed to create outgoing session to endpoint ‘+18093303000’
    [2025-11-17 14:58:24] NOTICE[51393][C-00000024]: app_dial.c:2709 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
    == Everyone is busy/congested at this time (1:0/0/1)
    – Executing [s@macro-dialout-trunk:28] NoOp(“PJSIP/1015-00000015”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 3”) in new stack

This is the configuration in the file pjsip_additional.conf

; Trunks

[+18093303000]
type=aor
qualify_frequency=60

contact=sip:+18093303000@isp.sip.com

support_path=no

[+18093303000]
type=auth
auth_type=userpass
password=8093303000
username=+18093303000

[+18093303000]
type=identify
endpoint=+18093303000

match=isp.sip.com

[+18093303000]
type=registration
endpoint=+18093303000
line=yes
outbound_auth=+18093303000
server_uri=sip:isp.sip.com

client_uri=sip:+18093303000@isp.sip.com

auth_rejection_permanent=no
contact_user=+18093303000
expiration=3600
max_retries=10
outbound_proxy=sip:25.25.25.25;lr
retry_interval=60
transport=transport-tls

[+18093303000]
type=endpoint
aors=+18093303000
disallow=all
outbound_auth=+18093303000
allow=ulaw,g729,alaw
contact_user=+18093303000
context=from-pstn
direct_media=no
dtmf_mode=auto
fax_detect=no
from_domain=isp.sip.com
from_user=+18093303000
media_encryption=sdes
rewrite_contact=yes
rtp_symmetric=yes
t38_udptl=no
t38_udptl_ec=none
t38_udptl_nat=no
transport=transport-tls
trust_id_inbound=no

Thanks in advanced.

You need to escape the ; so it should be \;lr

In general - does the endpoint show in “pjsip show endpoints”? What is its status?

Hi,

Thanks for your help, this is the output for the command “pjsip show endpoints”

issabel*CLI> pjsip show endpoints

Endpoint: <Endpoint/CID…> <State…> <Channels.>

I/OAuth: <AuthId/UserName…>
Aor: <Aor…>
Contact: <Aor/ContactUri…> <Hash…> <RTT(ms)..>
Transport: <TransportId…> <BindAddress…>
Identify: <Identify/Endpoint…>
Match: <criteria…>
Channel: <ChannelId…> <State…> <Time…>
Exten: <DialedExten…> CLCID: <ConnectedLineCID…>

Endpoint: +18093303000 Unavailable 0 of inf
OutAuth: +18093303000/+18093303000
Aor: +18093303000 0
Contact: +18093303000/sip:+18093303000@isp.sip.com e2b65d7994 Unavail nan
Transport: transport-tls tls 0 0 0.0.0.0:5061
Identify: +18093303000/+18093303000
Match: 25.25.25.25/32

Endpoint: 1013/1013 Unavailable 0 of inf
InAuth: auth1013/1013
Aor: 1013 1
Transport: transport-udp udp 0 0 0.0.0.0:5080

Endpoint: 1015/1015 Unavailable 0 of inf
InAuth: auth1015/1015
Aor: 1015 1
Transport: transport-udp udp 0 0 0.0.0.0:5080

Endpoint: dummy_endpoint Unavailable 0 of inf

Objects found: 4

-- Remote UNIX connection
-- Remote UNIX connection disconnected

According to this it is unavailable, which is why the call attempt fails.

I’d break down the problem and verify assumptions:

  1. Does the TLS transport load and operate?
  2. Can the host be reached on the expected hostname and port using TLS?
  3. Does a packet capture show a connection attempt from Asterisk that fails?

thank you i’m very little experience with this but i’m trying to response those questions based on the behavior and config, please be patient with me

Does the TLS transport load and operate? The incoming calls are working, i’m assumig that the TLS are working, but do you have a command in order do i can verify this ?

Can the host be reached on the expected hostname and port using TLS? Yes the hostname can be reached.[root@issabel ~]# telnet isp.sip.com 5061Trying 25.25.25.25…Connected to isp.sip.com.Escape character is ‘^]’.

Does a packet capture show a connection attempt from Asterisk that fails? I do a debug and get only this message,

issabel*CLI> pjsip set logger onPJSIP Logging enabled== Using SIP RTP TOS bits 184== Using SIP RTP CoS mark 5> 0x7fce5c21a0e0 – Strict RTP learning after remote address set to: 192.168.2.18:4004– Executing [8092201111@from-internal:1] Dial(“SIP/1012-00000015”, “PJSIP/8092201111@isp.sip.com”) in new stack[2025-11-18 08:55:55] ERROR[50977]: chan_pjsip.c:2687 request: Unable to create PJSIP channel - endpoint ‘isp.sip.com’ was not found[2025-11-18 08:55:55] NOTICE[82222][C-00000037]: app_dial.c:2709 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)== Everyone is busy/congested at this time (1:0/0/1)– Executing [8092201111@from-internal:2] Hangup(“SIP/1012-00000015”, “”) in new stack== Spawn extension (from-internal, 8092201111, 2) exited non-zero on ‘SIP/1012-00000015’– Executing [h@from-internal:1] Hangup(“SIP/1012-00000015”, “”) in new stack== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/1012-00000015’

TLS adds extra complexity as there are more moving parts, so with little experience it can be more difficult.

The “pjsip show outbound registrations” CLI command would show the outbound registration, and general console output would at least show that the correct endpoint for the incoming call is being used.

This isn’t like your previous log. If you don’t have an endpoint named “isp.sip.com” (which according to the log you don’t) then it won’t work.

Thank you, do you have a documentation in order to configure this setup,

  1. PJSIP Trunk to ISP with TLS with authentication
  2. No TLS verification
  3. outbound calls
  4. inbound calls.

Thanks in advance.

Aside from the general example on the docs site, I don’t have anything specific.

The one that covers the specific error in your last log is Dialing PJSIP Channels - Asterisk Documentation