Does anyone have a working example of a Twilio TLS/SRTP connection that could be shared? The Twilio documentation for pjsip doesn’t have a working TLS example. I spent all morning trying to get my server to connect and it keeps saying registration rejected.
; TWILIO ROUTE --------------
[twilio]
type = registration
outbound_auth = twilio
client_uri = sips:pbx@pbx.pstn.twilio.com
server_uri = sips:pbx.pstn.twilio.com
expiration = 600
[twilio]
type = auth
auth_type = userpass
username = user
password = pass
[twilio]
type = aor
contact = sips:pbx.pstn.twilio.com
qualify_frequency = 60
[twilio]
type = endpoint
context = mainroute
allow = !all,ulaw
from_user = pbx
outbound_auth = twilio
aors = twilio
media_encryption=sdes
rewrite_contact=yes
rtp_symmetric=yes
;[twilio]
;type = identify
;endpoint = twilio
;match = pbx.pstn.twilio.com
; -----------------------------------
<Registration/ServerURI..............................> <Auth..........> <Status.......>
==========================================================================================
twilio/sips:pbx.pstn.twilio.com twilio Rejected
<--- Transmitting SIP response (991 bytes) to UDP:34.226.36.33:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 34.226.36.33:5060;rport=5060;received=34.226.36.33;branch=z9hG4bK92fd.7b47248bfaa806fd7c6b98d0d616238f.0
Via: SIP/2.0/UDP 52.40.141.109:5060;branch=z9hG4bK1000884
Record-Route: <sip:34.226.36.33;lr>
Call-ID: 1502c936-f110fa08-b45fbc6@0.0.0.0
From: <sip:ping@invalid>;tag=uloc-62030df9-23-dbb1b7a1-c9b13e96-ebbf7d45
To: <sip:s@1.2.3.4>;tag=z9hG4bK92fd.7b47248bfaa806fd7c6b98d0d616238f.0
CSeq: 1 OPTIONS
Accept: application/dialog-info+xml, application/xpidf+xml, application/cpim-pidf+xml, application/pidf+xml, application/simple-message-summary, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, application/sdp, message/sipfrag;version=2.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Accept-Encoding: identity
Accept-Language: en
Server: Asterisk PBX 19.4.0
Content-Length: 0
<--- Transmitting SIP request (594 bytes) to TLS:54.172.60.1:5061 --->
REGISTER sips:pbx.pstn.twilio.com SIP/2.0
Via: SIP/2.0/TLS 1.2.3.4:5061;rport;branch=z9hG4bKPjd53e4c95-7218-4b6a-978d-98a7c3932808;alias
From: <sips:pbx@pbx.pstn.twilio.com>;tag=e878992a-f4c1-45d4-b585-12211a592a08
To: <sips:pbx@pbx.pstn.twilio.com>
Call-ID: 93f12e66-4c72-4123-ad20-3336d4c9f90a
CSeq: 62112 REGISTER
Contact: <sips:s@1.2.3.4:5061;transport=TLS>
Expires: 600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 19.4.0
Content-Length: 0