Registrar Server: Asterisk 20
SIP Trunk Provider: Vonage
WebRTC App (custom): JsSIP library
I have a softphone app that currently functions well allowing WebRTC users (User1 and User2 configured) to call one another in the browser. We can also receive incoming calls from external cell phones that correctly routes the cell phone to the User in the browser because the Vonage number correctly gets tied to the user agent when an incoming call is detected.
The issue is that an outbound call cannot be completed from a User to a cell phone. I’m not convinced that the issue is with the JsSIP application since we can call other browser agents and can receive a call from a cell phone externally, rather I think I’m missing something in my configuration on Asterisk’s side (pjsip.conf and extensions.conf).
I have successfully linked a purchased number from Vonage to my asterisk server and white listed the server for the Access Control List on my Vonage dashboard.
Here are relevant parts of my pjsip.conf:
; Above this I have added and bound wss and udp transports
; == ACL
[acl] ; Opperates on all pjsip traffic (can also be in acl.conf)
type=acl
;permit=0.0.0.0/0.0.0.0
permit=216.147.0.0/18 ; vonage SIP IP
permit=168.100.64.0/18 ; vonage SIP IP
permit=172.30.240.0/20 ; Local host IP (for the WebRTC agent to connect to the asterisk server)
; Templates for WebRTC here... it includes user the [context-out] from the dialplan to attempt to call a cell phone externally
; Define the Vonage SIP trunk endpoint
[vonage-endpoint]
type=endpoint
context=context-in
disallow=all ; First, disallow all codecs
outbound_auth=vonage-auth
aors=vonage-aor
allow=alaw
allow=ulaw
allow=g729
allow=iLBC
allow=g722
allow=speex16
transport=transport-udp
from_user=126225807890 ; Purchased number from Vonage
from_domain=rts-voip.sip-us.vonage.com
; Define authentication for the Vonage SIP trunk
[vonage-auth]
type=auth
auth_type=userpass
username=RTSUser1960
password=<OurSecret10> ; Hidden for obvious reasons
; Define the AOR for the Vonage SIP trunk
[vonage-aor]
type=aor
contact=sip:rts-voip.sip-us.vonage.com ; The Vonage SIP domain;[vonage-auth]
qualify_frequency = 120
; Define outbound registration to Vonage
[vonage-reg]
type=registration
outbound_auth=vonage-auth
server_uri=sip:rts-voip.sip-us.vonage.com
client_uri=sip:126225807890@rts-voip.sip-us.vonage.com
; Web RTC user agent configuration below
Then here is my dialplan:
[general]
static = yes
writeprotect = yes
autofallthrough = no
clearglobalvars = no
[subscriptions]
exten => 100,hint,PJSIP/User1
exten => 200,hint,PJSIP/User2
[context-out]
exten => _+X.,1,Set(CALLERID(num)=12622580789) ; Forcing setting the Vonage number as Caller ID
same => n,Goto(${EXTEN:1},1) ; Remove '+' and proceed
exten => _X.,1,Set(CALLERID(num)=12622580789) ; Again, forcing setting the Caller ID
same => n,Dial(PJSIP/${EXTEN}@vonage-endpoint,60,tr) ; Route calls through Vonage trunk
same => n,Hangup()
; Internal extensions
exten => 100,1,Dial(PJSIP/User1,30)
exten => 100,n,Answer()
exten => 100,n,Hangup()
exten => 200,1,Dial(PJSIP/User2,30)
exten => 200,n,Answer()
exten => 200,n,Hangup()
; context in set below
Is there something I am missing from this configuration that would allow one of our user agents to be able to make an outbound call to a cell phone?
The SIP messages indicate a 403 forbidden from Vonage.
<— Transmitting SIP request (1124 bytes) to UDP:216.147.2.1:5060 —>
INVITE sip:14128410367@rts-voip.sip-us.vonage.com SIP/2.0
Via: SIP/2.0/UDP 5.78.95.23:5060;rport;branch=z9hG4bKPjf783a5eb-6b97-4fc7-bf8c-4035a2249c3c
From: sip:12622580789@rts-voip.sip-us.vonage.com;tag=343a0a1b-0182-46cc-801f-9f1a470ae2cb
To: sip:14128410367@rts-voip.sip-us.vonage.com
Contact: sip:12622580789@5.78.95.23:5060
Call-ID: 57f1af1a-1ffd-48c4-b326-d2b6ffb85f71
CSeq: 26226 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 18.22.0
Content-Type: application/sdp
Content-Length: 400
v=0
o=- 618589327 618589327 IN IP4 5.78.95.23
s=Asterisk
c=IN IP4 5.78.95.23
t=0 0
m=audio 16038 RTP/AVP 0 8 18 97 9 117 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:9 G722/8000
a=rtpmap:117 speex/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:60
a=sendrecv
<— Received SIP response (455 bytes) from UDP:216.147.2.1:5060 —>
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 5.78.95.23:5060;rport=5060;branch=z9hG4bKPjf783a5eb-6b97-4fc7-bf8c-4035a2249c3c;received=5.78.95.23
From: sip:12622580789@rts-voip.sip-us.vonage.com;tag=343a0a1b-0182-46cc-801f-9f1a470ae2cb
To: sip:14128410367@rts-voip.sip-us.vonage.com;tag=29282836ac15fec28406232a030b63ac.555c
Call-ID: 57f1af1a-1ffd-48c4-b326-d2b6ffb85f71
CSeq: 26226 INVITE
Server: Nexmo Customer Proxy - AWS - 01
Content-Length: 0
<— Transmitting SIP request (472 bytes) to UDP:216.147.2.1:5060 —>
ACK sip:14128410367@rts-voip.sip-us.vonage.com SIP/2.0
Via: SIP/2.0/UDP 5.78.95.23:5060;rport;branch=z9hG4bKPjf783a5eb-6b97-4fc7-bf8c-4035a2249c3c
From: sip:12622580789@rts-voip.sip-us.vonage.com;tag=343a0a1b-0182-46cc-801f-9f1a470ae2cb
To: sip:14128410367@rts-voip.sip-us.vonage.com;tag=29282836ac15fec28406232a030b63ac.555c
Call-ID: 57f1af1a-1ffd-48c4-b326-d2b6ffb85f71
CSeq: 26226 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 18.22.0
Content-Length: 0
<— Transmitting SIP response (519 bytes) to WSS:71.229.193.201:50337 —>
SIP/2.0 403 Forbidden
Via: SIP/2.0/WSS qm1b695rd59b.invalid;rport=50337;received=71.229.193.201;branch=z9hG4bK7881733
Call-ID: ogj65tp0pfclfcm5vbgi
From: “User2” sip:User2@asterisk.rts-cloud.com;tag=088ehqhdr4
To: sip:14128410367@rts-voip.sip-us.vonage.com;tag=c533460e-f5a5-4d84-a939-bdd04bdfeda1
CSeq: 8933 INVITE
Server: Asterisk PBX 18.22.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER
Reason: Q.850;cause=21
Content-Length: 0
<— Received SIP request (477 bytes) from WSS:71.229.193.201:50337 —>
ACK sip:14128410367@rts-voip.sip-us.vonage.com SIP/2.0
Via: SIP/2.0/WSS qm1b695rd59b.invalid;branch=z9hG4bK7881733
Max-Forwards: 69
To: sip:14128410367@rts-voip.sip-us.vonage.com;tag=c533460e-f5a5-4d84-a939-bdd04bdfeda1
From: “User2” sip:User2@asterisk.rts-cloud.com;tag=088ehqhdr4
Call-ID: ogj65tp0pfclfcm5vbgi
CSeq: 8933 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: outbound
User-Agent: JsSIP 3.10.1
Content-Length: 0
<— Transmitting SIP request (474 bytes) to WSS:71.229.193.201:24738 —>
OPTIONS sip:2deq6lcc@71.229.193.201:24738;transport=ws SIP/2.0
Via: SIP/2.0/WSS 5.78.95.23:8089;rport;branch=z9hG4bKPjbfc4ab5d-262f-4bf6-b1e7-8b0728c403f7;alias
From: sip:User1@ubuntu-8gb-hil-1;tag=2ae677f3-27e5-4463-ad20-f6e2e17bb154
To: sip:2deq6lcc@71.229.193.201
Contact: sip:User1@ubuntu-8gb-hil-1:5060;transport=ws
Call-ID: 669b4a71-20d8-4526-8c59-dc31dbc626af
CSeq: 56806 OPTIONS
Max-Forwards: 70
User-Agent: Asterisk PBX 18.22.0
Content-Length: 0
<— Received SIP response (472 bytes) from WSS:71.229.193.201:24738 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS 5.78.95.23:8089;rport;branch=z9hG4bKPjbfc4ab5d-262f-4bf6-b1e7-8b0728c403f7;alias
To: sip:2deq6lcc@71.229.193.201;tag=kd8n8vkcds
From: sip:User1@ubuntu-8gb-hil-1;tag=2ae677f3-27e5-4463-ad20-f6e2e17bb154
Call-ID: 669b4a71-20d8-4526-8c59-dc31dbc626af
CSeq: 56806 OPTIONS
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Accept: application/sdp, application/dtmf-relay
Supported: outbound
Content-Length: 0