Pjsip Trunking Configuration Issue
Greetings !
My goal is to get Twilio trunking working, and with TLS/SRTP.
I see this concerning message in my log:
[Feb 7 16:50:26] ERROR[20596] res_sorcery_config.c: Could not create an object of type ‘endpoint’ with id ’twilio’ from configuration file ‘pjsip.conf’
Thus, ‘pjsip show endpoints’ does not show the endpoint for the Twilio trunk.
Hoping for a sanity check of my pjsip.conf file, and what could be causing this.
A test call form Twilio’s system hits the PBX (over TLS), but always says “No matching endpoint found” in the asterisk log.
pjsip.conf
[transport-tls]
type = transport protocol = tls bind = 0.0.0.0:5061
cert_file=cert_file priv_key_file=key_file method=tlsv1
external_media_address=X.Y.Z.D
external_signaling_address=X.Y.Z.D
verify_client=no verify_server=no allow_reload=yes
[twilio](!)
type=endpoint transport=transport-tls context=from-twilio disallow=all allow=ulaw dtmf_mode=inband media_encryption=sdes rtp_symmetric=yes rewrite_contact=yes force_rport=yes canreinvite=no tlsdontverifyserver=yes
[auth-out](!)
type=auth auth_type=userpass
[twilio]
aors=twilio-aors
[twilio-aors]
type=aor contact=sips:trunkname.pstn.twilio.com:5061 ;tried with sip: also
[twilio]
type=identify endpoint=twilio match=54.172.60.0
match=54.172.60.1
match=54.172.60.2
match=54.172.60.3
[endpoint-basic](!)
type=endpoint transport=transport-tls context=from-phones disallow=all allow=ulaw
[auth-userpass](!)
type=auth auth_type=userpass
[aor-single-reg](!)
type=aor max_contacts=20
[1001](endpoint-basic)
auth=auth1001
aors=1001
[auth1001](auth-userpass)
password=password123
username=1001
[1001](aor-single-reg)
Extensions.conf
[from-twilio]
exten => _+1NXXXXXXXXX,1,Dial(PJSIP/1001)
[from-phones]
exten => _NXXNXXXXXX,1,Set(CALLERID(all)=”David” <78451234>)
same => n,Dial(PJSIP/+1${EXTEN}@twilio)
—
3 thoughts on - Pjsip Trunking Configuration Issue
Are you sure you want “inband” and not “rfc4733”?
“canreinvite” and “tlsdontverifyserver” aren’t valid endpoint parameters which is why the endpoint is failing to load.
@Kevin:
Were such invalid endpoint parameters settings reported on Asterisk CLI ?
My system reported:
Could not find option suitable for category ‘asterisk8’ named ‘foo’ at line
15 of /etc/asterisk/pjsip.conf
when I added ( at line 15 of /etc/asterisk/pjsip.conf):
foo=bar
2018-02-08 14:48 GMT+01:00 George Joseph:
canreinvite has been replaced by directmedia in chan_sip’s config file for at least a decade. It has never existed for chan_pjsip. For chan_pjsip it is direct_media.
This section looks like you are trying to actually create the twilo endpoint but you need to include the twilo template you defined earlier: [twilo](twilo). It would be better if you actually gave the twilo template a different name.
You might want to look over config file common syntax [1] and template usage [2]. You might also want to look over pjsip configuration [3].
Richard
[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Configuration+Files
[2] https://wiki.asterisk.org/wiki/display/AST/Templates
[3]
https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Sections+and+Relationships