I have a Twillo account I need to call out on from PJSIP. It works fine with my sip.conf but I’m failing with PJSIP. Any help would be appreciated.
Working sip.conf:
[general]
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
bindaddr = 192.168.2.2 ; Address to bind to (all addresses on machine)
bindport=5060
port=5060
disallow=all
allow=ulaw
context=mystery_sip ; Send unknown SIP callers to this context
pickupgroup=1
group=1
allowguest=no
dtmfmode=auto ; rfc2833
localnet=192.168.2.0/255.255.255.0
externrefresh=600
alwaysauthreject=yes
srvlookup=yes
preferred_codec_only=yes
useragent=MyPBX
notifyhold=yes
directmedia=yes
session-timers=originate
session-expires=2400
session-minse=300
session-refresher=uas
sendrpid=yes
trustrpid=yes
callcounter=yes
nat=force_rport,comedia
autocreatepeer=no
callevents=yes
[Twilio]
host=pbx.pstn.twilio.com
remotesecret=password
defaultuser=name
type=friend
secret=password
bindport=5060
port=5060
udpenable=yes
tcpenable=yes
preffered_codec_only=yes
fromdomain=pbx.pstn.twilio.com
context=Twilio
insecure=port,invite ; very
disallow=all
allow=ulaw ;,g729
dtmfmode=rfc2833 ; auto
qualify=55000
canreinvite=no
limitonpeers=yes
call-limit=23
And my failing pjsip.conf:
[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0
allow_reload=no
tos=cs3
cos=3
local_net=192.168.2.0/24
external_media_address=myip.no-ip.biz
external_signaling_address=myio.no-ip.biz
[tcptrans]
type=transport
protocol=tcp
bind=0.0.0.0
allow_reload=no
tos=cs3
cos=3
local_net=192.168.233.0/24
local_net=192.168.211.0/24
external_media_address=extrasensory.no-ip.biz
external_signaling_address=extrasensory.no-ip.biz
;===============TRUNK
[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0
allow_reload=no
tos=cs3
cos=3
local_net=192.168.2.0/24
local_net=192.168.2.0/24
external_media_address=myip.no-ip.biz
external_signaling_address=myip.no-ip.biz
[TwilioOut]
type=endpoint
transport=simpletrans
allow=!all,ulaw
auth=TwilioOutAuth
aors=TwilioOut
[TwilioOutAuth]
type=auth
auth_type=userpass
password=password
username=name
[TwilioOut]
type=aor
contact=sip:name@pbx.pstn.twilio.com
contact=sip:pbx.pstn.twilio.com
The dial line is:
same => n(normalcall),dial(PJSIP/TwilioOut/+13101234567,,g)
From the log:
[s@x:5]Dial("PJSIP/174-00000002", "PJSIP/TwilioOut/+1310123567) in new stack
Error messages:
[2023-09-17 11:56:56] ERROR[102420] res_pjsip.c: Endpoint 'TwilioOut': Could not create dialog to invalid URI '+13101234567'. Is endpoint registered and reachable?
[2023-09-17 11:56:56] ERROR[102420] chan_pjsip.c: Failed to create outgoing session to endpoint 'TwilioOut'
[2023-09-17 11:56:56] NOTICE[102447][C-00000001] app_dial.c: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
[2023-09-17 11:56:57] NOTICE[102447][C-00000001] Ext. h: "****** Call from 1 to (13101234567) Sun Sep 17 11:56:57 2023 CHANUNAVAIL 02PJSIP/TwilioOut/+ 3"