Asterisk 18.13.0 webrtc no sound, what else can i do?

So here i am trying to make a phone call from the browsers, using jssip. Everything is working fine. Except,… no sound at all in the browser.

Notes

  • 172.26.5.114 is the private amazon aws IP
  • 63.33.37.83 is the public ip address of the server
  • Running coturn on the same server on port 5349 with the url stun.nme.mobi:5349 (Trickle ICE)

rtp.conf

[general]
rtpstart=10000
rtpend=20000
rtpchecksums=no
dtmftimeout=3000
rtcpinterval=5000
strictrtp=no
icesupport=yes
stunaddr=stun.l.google.com:19302

[ice_host_candidates]
172.26.5.114 => 63.33.x.x

pjsip.conf

[wss]
type=transport
protocol=wss
bind=0.0.0.0

[webrtc_test]
type=aor
max_contacts=1
remove_existing=yes

[webrtc_test]
type=auth
auth_type=userpass
username=webrtc_test
password=webrtc_test

[webrtc_test]
type=endpoint
aors=webrtc_test
auth=webrtc_test
webrtc=yes
context=test
disallow=all
allow=opus,alaw
transport=wss

extensions.conf

[test]
exten => _.!,1,Answer()
same => n,Verbose(channeluniqueid ${CDR(uniqueid)})
same = n,Playback(hello-world)
same = n,Hangup()

rtp debug

Got  RTP packet from    77.168.x.x:58845 (type 111, seq 026370, ts 449068677, len 000085)
Sent RTP packet to      77.168.x.x:58845 (via ICE) (type 111, seq 006264, ts 001920, len 000083)
Sent RTP packet to      77.168.x.x:58845 (via ICE) (type 111, seq 006265, ts 002880, len 000117)
Got  RTP packet from    77.168.x.x:58845 (type 111, seq 026371, ts 449069637, len 000091)

psjip logger

WebSocket Connection Established
REGISTER sip:janus.nme.mobi SIP/2.0
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;branch=z9hG4bK3892468
Max-Forwards: 69
To: <sip:webrtc_test@janus.nme.mobi>
From: <sip:webrtc_test@janus.nme.mobi>;tag=kj1md5db8r
Call-ID: 8d4tejabgt13fjc29oi673
CSeq: 1 REGISTER
Contact: <sip:q93gt968@p9q7iag2aqmr.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:4c14167c-abf4-4c94-b1b4-175ccc3fadf6>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: path,gruu,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0

SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;rport=52724;received=77.168.x.x;branch=z9hG4bK3892468
Call-ID: 8d4tejabgt13fjc29oi673
From: <sip:webrtc_test@janus.nme.mobi>;tag=kj1md5db8r
To: <sip:webrtc_test@janus.nme.mobi>;tag=z9hG4bK3892468
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1659928373/7e43e41c51d1dc269ab85ae40e5f0e1b",opaque="42b86bcf7c844890",algorithm=MD5,qop="auth"
Server: Asterisk PBX 18.13.0
Content-Length:  0

REGISTER sip:janus.nme.mobi SIP/2.0
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;branch=z9hG4bK5984966
Max-Forwards: 69
To: <sip:webrtc_test@janus.nme.mobi>
From: <sip:webrtc_test@janus.nme.mobi>;tag=kj1md5db8r
Call-ID: 8d4tejabgt13fjc29oi673
CSeq: 2 REGISTER
Authorization: Digest algorithm=MD5, username="webrtc_test", realm="asterisk", nonce="1659928373/7e43e41c51d1dc269ab85ae40e5f0e1b", uri="sip:janus.nme.mobi", response="aa983974c00cc38765e10493daea35f7", opaque="42b86bcf7c844890", qop=auth, cnonce="brt11os6r2ue", nc=00000001
Contact: <sip:q93gt968@p9q7iag2aqmr.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:4c14167c-abf4-4c94-b1b4-175ccc3fadf6>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: path,gruu,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;rport=52724;received=77.168.x.x;branch=z9hG4bK5984966
Call-ID: 8d4tejabgt13fjc29oi673
From: <sip:webrtc_test@janus.nme.mobi>;tag=kj1md5db8r
To: <sip:webrtc_test@janus.nme.mobi>;tag=z9hG4bK5984966
CSeq: 2 REGISTER
Date: Mon, 08 Aug 2022 03:12:53 GMT
Contact: <sip:q93gt968@p9q7iag2aqmr.invalid;transport=ws>;expires=599
Expires: 600
Server: Asterisk PBX 18.13.0
Content-Length:  0

INVITE sip:test@janus.nme.mobi SIP/2.0
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;branch=z9hG4bK7520843
Max-Forwards: 69
To: <sip:test@janus.nme.mobi>
From: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
Call-ID: mpo34hgs5sg9ma519159
CSeq: 5007 INVITE
Contact: <sip:q93gt968@p9q7iag2aqmr.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 1873

v=0
o=- 1396531432475531040 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS b09efb30-e4bb-4704-9786-dcef0b77eabf
m=audio 62335 UDP/TLS/RTP/SAVPF 111 63 103 9 0 8 105 13 110 113 126
c=IN IP4 192.168.1.151
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:3287916621 1 udp 2122260223 192.168.1.151 62335 typ host generation 0 network-id 1 network-cost 10
a=candidate:2373606589 1 tcp 1518280447 192.168.1.151 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=ice-ufrag:RwmG
a=ice-pwd:lp4Rx/OErEaJxy/o7HRdSTEQ
a=ice-options:trickle
a=fingerprint:sha-256 0C:68:9B:57:4C:F7:F6:E9:8C:D9:D3:A1:B8:2A:47:00:78:9D:35:9B:0C:18:22:3F:48:86:DB:EF:BF:24:40:1F
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:b09efb30-e4bb-4704-9786-dcef0b77eabf 0b50f193-25aa-49bf-9b44-0c98a2cef0e0
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:103 ISAC/16000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:3898086782 cname:cNHbfSSzkICRo6xe
a=ssrc:3898086782 msid:b09efb30-e4bb-4704-9786-dcef0b77eabf 0b50f193-25aa-49bf-9b44-0c98a2cef0e0
a=ssrc:3898086782 mslabel:b09efb30-e4bb-4704-9786-dcef0b77eabf
a=ssrc:3898086782 label:0b50f193-25aa-49bf-9b44-0c98a2cef0e0

SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;rport=52724;received=77.168.x.x;branch=z9hG4bK7520843
Call-ID: mpo34hgs5sg9ma519159
From: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
To: <sip:test@janus.nme.mobi>;tag=z9hG4bK7520843
CSeq: 5007 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1659928383/bd5250c33d15723f39b1a354a67aad64",opaque="30e5a91225aaf8a6",algorithm=MD5,qop="auth"
Server: Asterisk PBX 18.13.0
Content-Length:  0

ACK sip:test@janus.nme.mobi SIP/2.0
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;branch=z9hG4bK7520843
Max-Forwards: 69
To: <sip:test@janus.nme.mobi>;tag=z9hG4bK7520843
From: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
Call-ID: mpo34hgs5sg9ma519159
CSeq: 5007 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0

INVITE sip:test@janus.nme.mobi SIP/2.0
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;branch=z9hG4bK7369993
Max-Forwards: 69
To: <sip:test@janus.nme.mobi>
From: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
Call-ID: mpo34hgs5sg9ma519159
CSeq: 5008 INVITE
Authorization: Digest algorithm=MD5, username="webrtc_test", realm="asterisk", nonce="1659928383/bd5250c33d15723f39b1a354a67aad64", uri="sip:test@janus.nme.mobi", response="b0654029f7c81db5c9a286d617a96b05", opaque="30e5a91225aaf8a6", qop=auth, cnonce="6mffn5hkf6r0", nc=00000001
Contact: <sip:q93gt968@p9q7iag2aqmr.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 1873

v=0
o=- 1396531432475531040 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS b09efb30-e4bb-4704-9786-dcef0b77eabf
m=audio 62335 UDP/TLS/RTP/SAVPF 111 63 103 9 0 8 105 13 110 113 126
c=IN IP4 192.168.1.151
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:3287916621 1 udp 2122260223 192.168.1.151 62335 typ host generation 0 network-id 1 network-cost 10
a=candidate:2373606589 1 tcp 1518280447 192.168.1.151 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=ice-ufrag:RwmG
a=ice-pwd:lp4Rx/OErEaJxy/o7HRdSTEQ
a=ice-options:trickle
a=fingerprint:sha-256 0C:68:9B:57:4C:F7:F6:E9:8C:D9:D3:A1:B8:2A:47:00:78:9D:35:9B:0C:18:22:3F:48:86:DB:EF:BF:24:40:1F
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:b09efb30-e4bb-4704-9786-dcef0b77eabf 0b50f193-25aa-49bf-9b44-0c98a2cef0e0
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:103 ISAC/16000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:3898086782 cname:cNHbfSSzkICRo6xe
a=ssrc:3898086782 msid:b09efb30-e4bb-4704-9786-dcef0b77eabf 0b50f193-25aa-49bf-9b44-0c98a2cef0e0
a=ssrc:3898086782 mslabel:b09efb30-e4bb-4704-9786-dcef0b77eabf
a=ssrc:3898086782 label:0b50f193-25aa-49bf-9b44-0c98a2cef0e0

SIP/2.0 100 Trying
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;rport=52724;received=77.168.x.x;branch=z9hG4bK7369993
Call-ID: mpo34hgs5sg9ma519159
From: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
To: <sip:test@janus.nme.mobi>
CSeq: 5008 INVITE
Server: Asterisk PBX 18.13.0
Content-Length:  0

SIP/2.0 200 OK
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;rport=52724;received=77.168.x.x;branch=z9hG4bK7369993
Call-ID: mpo34hgs5sg9ma519159
From: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
To: <sip:test@janus.nme.mobi>;tag=7606781b-4295-464a-801d-379abe75943c
CSeq: 5008 INVITE
Server: Asterisk PBX 18.13.0
Contact: <sip:172.26.5.114:8443;transport=ws>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 90;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length:   837

v=0
o=- 1314854688 4 IN IP4 172.26.5.114
s=Asterisk
c=IN IP4 172.26.5.114
t=0 0
a=msid-semantic:WMS *
a=group:BUNDLE 0
m=audio 17582 UDP/TLS/RTP/SAVPF 111 8 126
a=connection:new
a=setup:active
a=fingerprint:SHA-256 4F:7D:46:76:9A:13:C7:51:4C:15:F7:E6:38:A5:96:51:FE:74:FA:D2:84:A2:81:50:9C:65:02:1F:D0:55:DA:9B
a=ice-ufrag:07afbe5d4c4c04a6235a4f8843f6d447
a=ice-pwd:3c8abebc164095e25dd6c23f1d0b9cd2
a=candidate:H3f212553 1 UDP 2130706431 63.33.37.83 17582 typ host
a=rtpmap:111 opus/48000/2
a=fmtp:111 useinbandfec=1
a=rtpmap:8 PCMA/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:20
a=sendrecv
a=rtcp-mux
a=ssrc:1537588246 cname:f5cea711-4ea8-495f-a364-12d99b419d15
a=msid:6bef77a6-bd39-4167-84c8-27cff3998daa be869bc4-7082-4bcc-b547-a6a51cc94d7d
a=rtcp-fb:* transport-cc
a=mid:0

ACK sip:172.26.5.114:8443;transport=ws SIP/2.0
Via: SIP/2.0/WSS p9q7iag2aqmr.invalid;branch=z9hG4bK1975193
Max-Forwards: 69
To: <sip:test@janus.nme.mobi>;tag=7606781b-4295-464a-801d-379abe75943c
From: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
Call-ID: mpo34hgs5sg9ma519159
CSeq: 5008 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0

BYE sip:q93gt968@77.168.x.x:52724;transport=ws;ob SIP/2.0
Via: SIP/2.0/WSS 172.26.5.114:8443;rport;branch=z9hG4bKPj6ec11e2b-2103-45ee-8c60-78beaee6cb08;alias
From: <sip:test@janus.nme.mobi>;tag=7606781b-4295-464a-801d-379abe75943c
To: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
Call-ID: mpo34hgs5sg9ma519159
CSeq: 23919 BYE
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: Asterisk PBX 18.13.0
Content-Length:  0

SIP/2.0 200 OK
Via: SIP/2.0/WSS 172.26.5.114:8443;rport;branch=z9hG4bKPj6ec11e2b-2103-45ee-8c60-78beaee6cb08;alias
To: <sip:webrtc_test@janus.nme.mobi>;tag=p52pgr858c
From: <sip:test@janus.nme.mobi>;tag=7606781b-4295-464a-801d-379abe75943c
Call-ID: mpo34hgs5sg9ma519159
CSeq: 23919 BYE
Supported: outbound
Content-Length: 0

From the Asterisk side media appears to be flowing. You’d likely want to examine the browser side instead.

Hi jcolp,

Thank you for the quick response. After taking a 24 hour break. And looking at the scenario again. I thought, “why i am so stupid”.

The reason there was no sound was simple. Forgot to create an audio element after a succesfull user agent instantiation.

var webPhoneSocket = new JsSIP.WebSocketInterface(ctbMethod.asterisk.fullUrl);

    var configuration = {
        sockets: [webPhoneSocket],
        uri: 'sip:webrtc_test@janus.nme.mobi',
        password: 'webrtc_test'
    };

    var ua = new JsSIP.UA(configuration);

    ua.start();

    // Register callbacks to desired call events
    var eventHandlers = {
        'progress': function (e) {
            console.log('call is in progress');
        },
        'failed': function (e) {
            console.log('call failed with cause: ' + e.data.cause);
        },
        'ended': function (e) {
            console.log('call ended with cause: ' + e.data.cause);
        },
        'confirmed': function (e) {
            console.log('call confirmed');
        },
    };

    var options = {
        'eventHandlers': eventHandlers,
        'mediaConstraints': {'audio': true},
        'stun_servers': 'stun.l.google.com:19302',
    };

    setTimeout(() => {
        var session = ua.call('sip:test@janus.nme.mobi', options);
        if (session) {
            session.connection.addEventListener('addstream', (e) => {
                var audio = document.createElement('audio');
                audio.srcObject = e.stream;
                audio.play();
            });
        }
    }, 2000)
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.