This is for the latest Asterisk 15 release.
I’ve been trying to get a WebRTC web softphone working and it’s not coming together. I’m basing it on ARI applications.
When I did everything locally (local ARI application, local asterisk, local client) with self-signed certs, it actually worked fine, incoming and outgoing through the PTSN. The way my dialer works is simple, originate caller -> answer -> originate callee -> answer -> bridge both.
When I moved up to AWS and added proper certificates with a domain name, suddenly I’m not even receiving the calls through the PSTN. I assumed this was an issue with the trunk setup, but it’s actually failing to originate the caller. Endpoint registration works fine, but I’m receiving no SIP INVITE, no messaging or data at all about the call origination in the browser. Here are the logs with every log i could think of turned on:
== WebSocket connection from 'my-public-ip:51596' for protocol 'sip' accepted using version '13'
<--- Received SIP request (568 bytes) from WSS:my-public-ip:51596 --->
REGISTER sip:my_domain.com SIP/2.0
Via: SIP/2.0/WSS qmtiareturj9.invalid;branch=z9hG4bK6067792
Max-Forwards: 69
To: <sip:199@my_domain.com>
From: <sip:199@my_domain.com>;tag=fcdb9arsh8
Call-ID: h5qgerq4d476o2od7m45ti
CSeq: 1 REGISTER
Contact: <sip:2504kgof@qmtiareturj9.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:d13c701c-ef89-43f6-a7d9-2f309d4f705c>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.0.22
Content-Length: 0
<--- Transmitting SIP response (477 bytes) to WSS:my-public-ip:51596 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS qmtiareturj9.invalid;rport=51596;received=my-public-ip;branch=z9hG4bK6067792
Call-ID: h5qgerq4d476o2od7m45ti
From: <sip:199@my_domain.com>;tag=fcdb9arsh8
To: <sip:199@my_domain.com>;tag=z9hG4bK6067792
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1510819348/079cfe75a455c71446af1a4b31c13b6a",opaque="4509d9895748a4a1",algorithm=md5,qop="auth"
Server: Asterisk PBX 15.1.1
Content-Length: 0
<--- Received SIP request (841 bytes) from WSS:my-public-ip:51596 --->
REGISTER sip:my_domain.com SIP/2.0
Via: SIP/2.0/WSS qmtiareturj9.invalid;branch=z9hG4bK6502976
Max-Forwards: 69
To: <sip:199@my_domain.com>
From: <sip:199@my_domain.com>;tag=fcdb9arsh8
Call-ID: h5qgerq4d476o2od7m45ti
CSeq: 2 REGISTER
Authorization: Digest algorithm=MD5, username="199", realm="asterisk", nonce="1510819348/079cfe75a455c71446af1a4b31c13b6a", uri="sip:my_domain.com", response="b4396fb82451509b5c7e3b6b449061b2", opaque="4509d9895748a4a1", qop=auth, cnonce="b68ggku3014f", nc=00000001
Contact: <sip:2504kgof@qmtiareturj9.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:d13c701c-ef89-43f6-a7d9-2f309d4f705c>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.0.22
Content-Length: 0
-- Added contact 'sip:2504kgof@my-public-ip:51596;transport=ws' to AOR '199' with expiration of 600 seconds
== Contact 199/sip:2504kgof@my-public-ip:51596;transport=ws has been created
<--- Transmitting SIP response (441 bytes) to WSS:my-public-ip:51596 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS qmtiareturj9.invalid;rport=51596;received=my-public-ip;branch=z9hG4bK6502976
Call-ID: h5qgerq4d476o2od7m45ti
From: <sip:199@my_domain.com>;tag=fcdb9arsh8
To: <sip:199@my_domain.com>;tag=z9hG4bK6502976
CSeq: 2 REGISTER
Date: Thu, 16 Nov 2017 08:02:28 GMT
Contact: <sip:2504kgof@my-public-ip:51596;transport=ws>;expires=599
Expires: 600
Server: Asterisk PBX 15.1.1
Content-Length: 0
== Endpoint 199 is now Reachable
-- Contact 199/sip:2504kgof@my-public-ip:51596;transport=ws is now Unknown. RTT: 0.000 msec
<--- ARI request received from: 127.0.0.1:37412 --->
user-agent: Shred
Accept: application/json
Authorization: Basic YXN0ZXJpc2s6YXN0ZXJpc2s=
Host: localhost:8088
Connection: close
Content-Length: 0
endpoint: PJSIP/199/sip:2504kgof@my-public-ip:51596;transport=ws
app: dial
channelId: 9c42c498-36f4-4625-8056-fae0b00170c8
body:
(null)
-- Called 199/sip:2504kgof@my-public-ip:51596;transport=ws
<--- Sending ARI event to 127.0.0.1:37404 --->
{
"type": "Dial",
"timestamp": "2017-11-16T08:02:50.883+0000",
"dialstatus": "",
"forward": "",
"dialstring": "199/sip:2504kgof@my-public-ip:51596;transport=ws",
"peer": {
"id": "9c42c498-36f4-4625-8056-fae0b00170c8",
"name": "PJSIP/199-00000001",
"state": "Down",
"caller": {
"name": "",
"number": ""
},
"connected": {
"name": "",
"number": ""
},
"accountcode": "",
"dialplan": {
"context": "default",
"exten": "s",
"priority": 1
},
"creationtime": "2017-11-16T08:02:50.883+0000",
"language": "en"
},
"asterisk_id": "12:c2:e5:0d:62:ee",
"application": "dial"
}
<--- Sending ARI response to 127.0.0.1:37412 --->
200 OK
Content-type: application/json
{
"id": "9c42c498-36f4-4625-8056-fae0b00170c8",
"name": "PJSIP/199-00000001",
"state": "Down",
"caller": {
"name": "",
"number": ""
},
"connected": {
"name": "",
"number": ""
},
"accountcode": "",
"dialplan": {
"context": "default",
"exten": "s",
"priority": 1
},
"creationtime": "2017-11-16T08:02:50.883+0000",
"language": "en"
}
== DTLS ECDH initialized (automatic), faster PFS enabled
<--- Sending ARI event to 127.0.0.1:37404 --->
{
"type": "ChannelHangupRequest",
"timestamp": "2017-11-16T08:02:50.910+0000",
"channel": {
"id": "9c42c498-36f4-4625-8056-fae0b00170c8",
"name": "PJSIP/199-00000001",
"state": "Down",
"caller": {
"name": "",
"number": ""
},
"connected": {
"name": "",
"number": ""
},
"accountcode": "",
"dialplan": {
"context": "default",
"exten": "s",
"priority": 1
},
"creationtime": "2017-11-16T08:02:50.883+0000",
"language": "en"
},
"asterisk_id": "12:c2:e5:0d:62:ee",
"application": "dial"
}
<--- Sending ARI event to 127.0.0.1:37404 --->
{
"type": "Dial",
"timestamp": "2017-11-16T08:02:50.910+0000",
"dialstatus": "NOANSWER",
"forward": "",
"dialstring": "199/sip:2504kgof@my-public-ip:51596;transport=ws",
"peer": {
"id": "9c42c498-36f4-4625-8056-fae0b00170c8",
"name": "PJSIP/199-00000001",
"state": "Down",
"caller": {
"name": "",
"number": ""
},
"connected": {
"name": "",
"number": ""
},
"accountcode": "",
"dialplan": {
"context": "default",
"exten": "s",
"priority": 1
},
"creationtime": "2017-11-16T08:02:50.883+0000",
"language": "en"
},
"asterisk_id": "12:c2:e5:0d:62:ee",
"application": "dial"
}
<--- Sending ARI event to 127.0.0.1:37404 --->
{
"type": "ChannelDestroyed",
"timestamp": "2017-11-16T08:02:50.911+0000",
"cause": 0,
"cause_txt": "Unknown",
"channel": {
"id": "9c42c498-36f4-4625-8056-fae0b00170c8",
"name": "PJSIP/199-00000001",
"state": "Down",
"caller": {
"name": "",
"number": ""
},
"connected": {
"name": "",
"number": ""
},
"accountcode": "",
"dialplan": {
"context": "default",
"exten": "s",
"priority": 1
},
"creationtime": "2017-11-16T08:02:50.883+0000",
"language": "en"
},
"asterisk_id": "12:c2:e5:0d:62:ee",
"application": "dial"
}
You can see the channel just immediately hangs up, no SIP is ever even sent. Wondering if anyone has some ideas about what’s going on?