<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 8, 2018 at 1:53 AM, Kevin Long <span dir="ltr"><<a href="mailto:kevin.long@haloprivacy.com" target="_blank">kevin.long@haloprivacy.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
Greetings !<br>
<br>
<br>
My goal is to get Twilio trunking working, and with TLS/SRTP.<br>
<br>
I see this concerning message in my log:<br>
<br>
[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’<br>
<br>
<br>
<br>
Thus, ‘pjsip show endpoints’ does not show the endpoint for the Twilio trunk.<br>
<br>
<br>
Hoping for a sanity check of my pjsip.conf file, and what could be causing this.<br>
<br>
A test call form Twilio’s system hits the PBX (over TLS), but always says “No matching endpoint found” in the asterisk log.<br>
<br>
<br>
<br>
pjsip.conf<br>
<br>
[transport-tls]<br>
type = transport<br>
protocol = tls<br>
bind = <a href="http://0.0.0.0:5061" rel="noreferrer" target="_blank">0.0.0.0:5061</a><br>
cert_file=cert_file<br>
priv_key_file=key_file<br>
method=tlsv1<br>
external_media_address=X.Y.Z.D<br>
external_signaling_address=X.<wbr>Y.Z.D<br>
verify_client=no<br>
verify_server=no<br>
allow_reload=yes<br>
<br>
[twilio](!)<br>
type=endpoint<br>
transport=transport-tls<br>
context=from-twilio<br>
disallow=all<br>
allow=ulaw<br>
dtmf_mode=inband<br>
media_encryption=sdes<br>
rtp_symmetric=yes<br>
rewrite_contact=yes<br>
force_rport=yes<br>
canreinvite=no<br></blockquote><div><br></div><div>canreinvite has been replaced by directmedia in chan_sip's config<br>file for at least a decade. It has never existed for chan_pjsip. For<br></div><div>chan_pjsip it is direct_media.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
tlsdontverifyserver=yes<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
[auth-out](!)<br>
type=auth<br>
auth_type=userpass<br>
<br>
[twilio]<br>
aors=twilio-aors<br></blockquote><div><br></div><div>This section looks like you are trying to actually create the twilo endpoint but<br></div><div>you need to include the twilo template you defined earlier: [twilo](twilo). It would<br></div><div>be better if you actually gave the twilo template a different name.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
[twilio-aors]<br>
type=aor<br>
contact=sips:<a href="http://trunkname.pstn.twilio.com:5061" rel="noreferrer" target="_blank">trunkname.pstn.<wbr>twilio.com:5061</a> ;tried with sip: also<br>
<br>
[twilio]<br>
type=identify<br>
endpoint=twilio<br>
match=54.172.60.0<br>
match=54.172.60.1<br>
match=54.172.60.2<br>
match=54.172.60.3<br>
<br>
[endpoint-basic](!)<br>
type=endpoint<br>
transport=transport-tls<br>
context=from-phones<br>
disallow=all<br>
allow=ulaw<br>
<br>
[auth-userpass](!)<br>
type=auth<br>
auth_type=userpass<br>
<br>
[aor-single-reg](!)<br>
type=aor<br>
max_contacts=20<br>
<br>
[1001](endpoint-basic)<br>
auth=auth1001<br>
aors=1001<br>
<br>
[auth1001](auth-userpass)<br>
password=password123<br>
username=1001<br>
<br>
[1001](aor-single-reg)<br>
<br>
<br>
Extensions.conf<br>
<br>
[from-twilio]<br>
exten => _+1NXXXXXXXXX,1,Dial(PJSIP/<wbr>1001)<br>
<br>
[from-phones]<br>
exten => _NXXNXXXXXX,1,Set(CALLERID(<wbr>all)="David" <78451234>)<br>
same => n,Dial(PJSIP/+1${EXTEN}@twilio<wbr>)<br></blockquote><div><br></div><div>You might want to look over config file common syntax [1] and template usage [2].<br></div><div>You might also want to look over pjsip configuration [3].<br></div><div><br></div><div>Richard<br></div></div><br>[1] <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+Configuration+Files">https://wiki.asterisk.org/wiki/display/AST/Asterisk+Configuration+Files</a><br>[2] <a href="https://wiki.asterisk.org/wiki/display/AST/Templates">https://wiki.asterisk.org/wiki/display/AST/Templates</a><br>[3] <a href="https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Sections+and+Relationships">https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Sections+and+Relationships</a><br></div></div>