Here is pjsip.conf. Please note that pjsip_notify.conf and pjsip_wizard.conf have not been altered from the defaults from install. I’ve only touched the pjsip.conf file.
[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=[ASTERISK_EXTERNAL_IP]
external_signaling_address=[ASTERISK_EXTERNAL_IP]
allow_reload=yes
local_net=192.168.0.0/16
[0.0.0.0-tcp]
type=transport
protocol=tcp
bind=0.0.0.0:5061
external_media_address=[ASTERISK_EXTERNAL_IP]
external_signaling_address=[ASTERISK_EXTERNAL_IP]
allow_reload=yes
local_net=192.168.0.0/16
[0.0.0.0-tls]
type=transport
protocol=tls
bind=0.0.0.0:5161
external_media_address=[ASTERISK_EXTERNAL_IP]
external_signaling_address=[ASTERISK_EXTERNAL_IP]
cert_file=/etc/asterisk/keys/my.crt
priv_key_file=/etc/asterisk/keys/my.key
method=tlsv1
verify_client=no
verify_server=no
allow_reload=yes
local_net=192.168.0.0/16
And here is the output from pjsip set logger on…
PJSIP Logging enabled
<--- Received SIP request (754 bytes) from TLS:[MY_EXTERNAL_IP]:59887 --->
REGISTER sip:[ASTERISK_IP]:5161;transport=tls SIP/2.0
Via: SIP/2.0/TLS [MY_INTERNAL_IP]:51764;rport;branch=z9hG4bKPj94W2M.75PpldG2kSlRI4JeHLI9s2Zajd;alias
Max-Forwards: 70
From: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>;tag=7GduKMj9x1yWS0dDQqj5rSDRujnBDpTA
To: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>
Call-ID: flY12mlvKq7sPYhz6f8NqPsP6HdPBbK0
CSeq: 44943 REGISTER
User-Agent: Mozilla
Supported: outbound, path
Contact: <sip:62441d1ded3d4027a3a8eea9236a258a@[MY_INTERNAL_IP]:51764;transport=TLS;ob>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00009c3fe9b2>"
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
<--- Transmitting SIP response (631 bytes) to TLS:[MY_EXTERNAL_IP]:59887 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TLS [MY_INTERNAL_IP]:51764;rport=59887;received=[MY_EXTERNAL_IP];branch=z9hG4bKPj94W2M.75PpldG2kSlRI4JeHLI9s2Zajd;alias
Call-ID: flY12mlvKq7sPYhz6f8NqPsP6HdPBbK0
From: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>;tag=7GduKMj9x1yWS0dDQqj5rSDRujnBDpTA
To: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>;tag=z9hG4bKPj94W2M.75PpldG2kSlRI4JeHLI9s2Zajd
CSeq: 44943 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1501610140/c2fc61f9853e778ce51d6a2d0d3e0d0b",opaque="0dd579d5158f09e5",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.17.0
Content-Length: 0
<--- Received SIP request (1091 bytes) from TLS:[MY_EXTERNAL_IP]:59887 --->
REGISTER sip:[ASTERISK_IP]:5161;transport=tls SIP/2.0
Via: SIP/2.0/TLS [MY_EXTERNAL_IP]:59887;rport;branch=z9hG4bKPj0gvp.QF-NUY9L7s148.2Wv5EgTdv4qn1;alias
Max-Forwards: 70
From: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>;tag=7GduKMj9x1yWS0dDQqj5rSDRujnBDpTA
To: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>
Call-ID: flY12mlvKq7sPYhz6f8NqPsP6HdPBbK0
CSeq: 44944 REGISTER
User-Agent: Mozilla
Supported: outbound, path
Contact: <sip:62441d1ded3d4027a3a8eea9236a258a@[MY_EXTERNAL_IP]:59887;transport=TLS;ob>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00009c3fe9b2>"
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username="62441d1ded3d4027a3a8eea9236a258a", realm="asterisk", nonce="1501610140/c2fc61f9853e778ce51d6a2d0d3e0d0b", uri="sip:[ASTERISK_IP]:5161;transport=tls", response="da48bbe04e559fb0be073880aacd4f35", algorithm=md5, cnonce="tUW-S.NxV3qwIe6T34xPBGMOLA-t7otR", opaque="0dd579d5158f09e5", qop=auth, nc=00000001
Content-Length: 0
<--- Transmitting SIP response (637 bytes) to TLS:[MY_EXTERNAL_IP]:59887 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS [MY_EXTERNAL_IP]:59887;rport=59887;received=[MY_EXTERNAL_IP];branch=z9hG4bKPj0gvp.QF-NUY9L7s148.2Wv5EgTdv4qn1;alias
Call-ID: flY12mlvKq7sPYhz6f8NqPsP6HdPBbK0
From: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>;tag=7GduKMj9x1yWS0dDQqj5rSDRujnBDpTA
To: <sip:62441d1ded3d4027a3a8eea9236a258a@[ASTERISK_IP]>;tag=z9hG4bKPj0gvp.QF-NUY9L7s148.2Wv5EgTdv4qn1
CSeq: 44944 REGISTER
Date: Tue, 01 Aug 2017 17:55:40 GMT
Contact: <sip:62441d1ded3d4027a3a8eea9236a258a@[MY_EXTERNAL_IP]:59887;transport=TLS;ob>;expires=299
Expires: 300
Supported: path
Server: Asterisk PBX 13.17.0
Content-Length: 0
<--- ARI request received from: [MY_EXTERNAL_IP]:7429 --->
User-Agent: Mozilla
Accept-Language: en-US,en;q=0.5
Accept: application/json
Content-type: text/plain;charset=UTF-8
Host: [ASTERISK_IP]:8088
Connection: keep-alive
Content-Length: 0
endpoint: PJSIP/62441d1ded3d4027a3a8eea9236a258a
timeout: 60
callerId: Call with Test User
api_key: api:43678
app: myapp
body:
(null)
<--- Sending ARI response to [MY_EXTERNAL_IP]:7429 --->
200 OK
Content-type: application/json
{"language":"en","creationtime":"2017-08-01T17:55:40.889+0000","id":"1501610140.1","caller":{"name":"Call with Test User","number":"unknown"},"name":"PJSIP/62441d1ded3d4027a3a8eea9236a258a-00000001","state":"Down","connected":{"name":"Call with Test User","number":""},"accountcode":"","dialplan":{"priority":1,"context":"default","exten":"s"}}
<--- Sending ARI event to [MY_EXTERNAL_IP]:1615 --->
{"type":"ChannelHangupRequest","asterisk_id":"0a:f2:47:14:0e:e0","timestamp":"2017-08-01T17:55:40.922+0000","channel":{"language":"en","creationtime":"2017-08-01T17:55:40.889+0000","id":"1501610140.1","caller":{"name":"Call with Test User","number":"unknown"},"name":"PJSIP/62441d1ded3d4027a3a8eea9236a258a-00000001","state":"Down","connected":{"name":"Call with Test User","number":""},"accountcode":"","dialplan":{"priority":1,"context":"default","exten":"s"}},"application":"myapp"}
<--- Sending ARI event to [MY_EXTERNAL_IP]:1615 --->
{"cause_txt":"Unknown","type":"ChannelDestroyed","asterisk_id":"0a:f2:47:14:0e:e0","timestamp":"2017-08-01T17:55:40.923+0000","channel":{"language":"en","creationtime":"2017-08-01T17:55:40.889+0000","id":"1501610140.1","caller":{"name":"Call with Test User","number":"unknown"},"name":"PJSIP/62441d1ded3d4027a3a8eea9236a258a-00000001","state":"Down","connected":{"name":"Call with Test User","number":""},"accountcode":"","dialplan":{"priority":1,"context":"default","exten":"s"}},"cause":0,"application":"myapp"}
For reference my Asterisk is on a separate network with it’s own external IP. My ARI application is on a different network with it’s own external IP. However this setup works just fine with my old Asterisk server.
Thanks again for the help and taking a look at this. Very much appreciate your input. Let me know if there is anything else I could post that might help.