Hi all,
I am not able to hear any audio on my sipML5 based sip phone. Not able to send audio to asterisk either. (one-way audio issues)
My stack:
I have my asterisk (15.x version) deployed on AWS cloud, with all the ports open (since we are in the development phase). I am using open source sipML5, jssip,(web browser) and zoiper(mobile app) as SIP softphones. I am testing with SIP and PJSIP as well since most of the help from community forums and on the internet is mainly related to SIP, but I eventually want to move to PJSIP. Here I am posting only SIP-related information.
Since Asterisk is on AWS I’ve taken care of NAT settings, localnet, external address etc. I have confirmed that these settings are working fine by testing with a remote phone which is not behind NAT.
---------------------------------- sip.conf related info ----------------------------
[general]
udpenable=yes
preferred_codec_only=yes
disallow=all
allow=ulaw
localnet=172.31.xx.xx
externip=3x.xxx.xxx.xxx
externaddr=3x.xxx.xxx.xxx
;media_address=3x.xxx.xxx.xxx
directmedia=no
nat=force_rport,comedia
sipdebug=no
udpbindaddr=0.0.0.0:5060
realm=3x.xxx.xxx.xxx ;replace with your Asterisk server public IP address or host
srvlookup=yes
transport=udp,ws,wss
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/asterisk/keys/asterisk.pem
// endpoint related info
[sipML5](sipphone)
secret=test123
avpf=yes
;encryption=yes
force_avp=yes
nat=force_rport,comedia
qualify=yes
allow=opus
icesupport=yes
directmedia=no
dtlsenable=yes
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass
// zoiper endpoint
[zoiper](sipphone)
secret=test123
------------------------------ extensions.conf info ------------------------
[outgoing]
exten => 100,1,Answer()
same => n,Wait(3)
same => n,Playback(hello-world)
same => n,HangUp()
exten => _+1NXXNXXXXXX,1,Set(CALLERID(all)="xxxx-name" <xxx-number>)
;same => n, MixMonitor(dialRecord.wav)
;same => n,Dial(PJSIP/${EXTEN}@bandwidth)
same => n,Dial(SIP/bandwidth/${EXTEN})
-------------------------------------- My testings -----------------------------------------
From the above dial plan when I dial 100 it should play me hello-world, with zoiper mobile app on wifi(NAT) and mobile data(no NAT situation), I am able to connect to asterisk and hear proper audio and also I am seeing RTP packets communication between zoiper and asterisk.
But when I am using sipML5 or JsSIP on a web browser using wifi(NAT) I am not able to hear any audio and when I looked at RTP logs, asterisk is sending packets but my sip phones are not able to send or receive RTP packets.
Just to confirm whether audio is flowing on other side are not, I switched on the mix monitor to record the call and called the number(+18xxxxxxxx). PSTN calls are routed using bandwidth.com. From recorded files, we heard only the audio coming from PSTN numbers(basically from bandwidth.com SIP trunk side). NO audio is heard from our sip phones(sipML5 & JsSIP).
So I concluded my SIP phones(behind NAT) are able to connect to asterisk but are not able to stream media.
When I compared the SIP, RTP logs of Zoiper phone with sipML5 I was able to point out where it is going wrong. I am posting only a few lines of the log here.
------------------------------------ sip and RTP logs -------------------------------
- Zoiper - audio is properly heard.
<--- SIP read from UDP:183.82.101.16:62226 --->
INVITE sip:100@3x.xxx.xxx.xxx;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 183.82.101.16:62226;branch=z9hG4bK-524287-1---309d1fdb4ab1ca4a;rport
Max-Forwards: 70
Contact: <sip:zoiper@183.82.101.16:62226;transport=UDP>
To: <sip:100@3x.xxx.xxx.xxx;transport=UDP>
From: <sip:zoiper@3x.xxx.xxx.xxx;transport=UDP>;tag=e4e93b7e
Call-ID: v6Uh7NLXGAbKdWsHsEeSQw..
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rv2.8.98-mod
Allow-Events: presence, kpml, talk
Content-Length: 243
v=0
o=Zoiper 0 0 IN IP4 183.82.101.16
s=Zoiper
c=IN IP4 183.82.101.16
t=0 0
m=audio 48974 RTP/AVP 3 101 0 8
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
<------------->
--- (13 headers 12 lines) ---
Sending to 183.82.101.16:62226 (NAT)
Sending to 183.82.101.16:62226 (NAT)
Using INVITE request as basis request - v6Uh7NLXGAbKdWsHsEeSQw..
Found peer 'zoiper' for 'zoiper' from 183.82.101.16:62226
- sipML5 - NO audio here.
<--- SIP read from WS:183.82.101.16:46592 --->
INVITE sip:100@3x.xxx.xxx.xxx SIP/2.0
**Via: SIP/2.0/WSS df7jal23ls0d.invalid;branch=z9hG4bKZBcZP96NIolHKdbxd5zp2rRk5smZkkFI;rport**
From: "mani"<sip:sipML5@3x.xxx.xxx.xxx:8089>;tag=GBbh4mDfnCSKTvGlhWCi
To: <sip:100@3x.xxx.xxx.xxx>
Contact: "mani"<sips:sipML5@df7jal23ls0d.invalid;rtcweb-breaker=yes;click2call=no;transport=wss>;impi=sipML5;ha1=fe9562fbc96caa7b9f22f48e0f793337;+g.oma.sip-im;language="en,fr"
Call-ID: b4d8d078-61e9-88a3-b634-f97b1ca659ad
CSeq: 40220 INVITE
Content-Type: application/sdp
Content-Length: 2343
Max-Forwards: 70
User-Agent: IM-client/OMA1.0 sipML5-v1.2016.03.04
Organization: Doubango Telecom
v=0
o=- 4621740257673597000 2 IN IP4 127.0.0.1
s=Doubango Telecom - chrome
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS HzQQGimngTroDGrSh8ytB45F9gUjsGOdweaN
m=audio 48115 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 183.82.101.16
a=rtcp:34046 IN IP4 183.82.101.16
a=candidate:1726473678 1 udp 2122260223 172.16.16.232 48115 typ host generation 0 network-id 1 network-cost 10
a=candidate:1726473678 2 udp 2122260222 172.16.16.232 34046 typ host generation 0 network-id 1 network-cost 10
a=candidate:677648702 1 tcp 1518280447 172.16.16.232 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=candidate:677648702 2 tcp 1518280446 172.16.16.232 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=candidate:3887063930 1 udp 1686052607 183.82.101.16 48115 typ srflx raddr 172.16.16.232 rport 48115 generation 0 network-id 1 network-cost 10
a=candidate:3887063930 2 udp 1686052606 183.82.101.16 34046 typ srflx raddr 172.16.16.232 rport 34046 generation 0 network-id 1 network-cost 10
a=candidate:3887063930 2 udp 1686052606 103.211.39.31 34046 typ srflx raddr 172.16.16.232 rport 34046 generation 0 network-id 1 network-cost 10
a=candidate:3887063930 1 udp 1686052607 103.211.39.31 48115 typ srflx raddr 172.16.16.232 rport 48115 generation 0 network-id 1 network-cost 10
a=ice-ufrag:mF6c
a=ice-pwd:WX33wemVnD/tDpzEUjItVF1n
a=ice-options:trickle
a=fingerprint:sha-256 2F:BE:20:A4:07:6A:FA:E6:20:D5:EF:7E:2B:EF:EA:6B:B2:9D:6F:63:D3:5E:96:FE:09:86:7C:7A:3A:C6:2B:38
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2089471130 cname:AMMlgiq5w9sv/WqR
a=ssrc:2089471130 msid:HzQQGimngTroDGrSh8ytB45F9gUjsGOdweaN 8f0bee3a-8bd1-4a03-8377-8fd917f5ec7e
a=ssrc:2089471130 mslabel:HzQQGimngTroDGrSh8ytB45F9gUjsGOdweaN
a=ssrc:2089471130 label:8f0bee3a-8bd1-4a03-8377-8fd917f5ec7e
<------------->
--- (12 headers 45 lines) ---
Using INVITE request as basis request - b4d8d078-61e9-88a3-b634-f97b1ca659ad
Found peer 'sipML5' for 'sipML5' from 183.82.101.16:46592
I have found where it is going wrong (SIP headers). And I found this problem might be related to ICE negotiations.
So far, I have found two threads having similar problems:
https://forums.asterisk.org/viewtopic.php?f=1&t=90167
From these, I have learned that either I should use a STUN server and/or need to check my sipML5 library (webRTC communications).
----------------------------- my questions ----------------------
1. Is there anything wrong in my config files that might be causing this problem.
2. Are there any problems apart from what I identified (failed ICE negotiations)
3. Any solutions to solve this problem