[asterisk-users] pjsip trunking configuration issue

Richard Mudgett rmudgett at digium.com
Thu Feb 8 10:11:21 CST 2018


On Thu, Feb 8, 2018 at 1:53 AM, Kevin Long <kevin.long at haloprivacy.com>
wrote:

>
>
> 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
>

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.


> tlsdontverifyserver=yes
>

>
> [auth-out](!)
> type=auth
> auth_type=userpass
>
> [twilio]
> aors=twilio-aors
>

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.


>
> [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)
>

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180208/42eecb43/attachment.html>


More information about the asterisk-users mailing list