WebRTC no audio in both directions

Hi, I would like to share my struggle with you guys, I am configuring the WebRTC and no audio em both directions, the registration is ok and I can add both channels to the bridge. When I do the same with regular SIP, the audio works perfectly.

Follow the asterisk commands and the SIP trace.

asterisk*CLI> http show status
HTTP Server Status
Prefix:
Server: Asterisk
Server Enabled and Bound to 0.0.0.0:8088

HTTPS Server Enabled and Bound to 0.0.0.0:8089

Enabled URI’s:
/httpstatus => Asterisk HTTP General Status
/phoneprov/… => Asterisk HTTP Phone Provisioning Tool
/metrics/… => Prometheus Metrics URI
/ari/… => Asterisk RESTful API
/ws => Asterisk HTTP WebSocket
Enabled Redirects:
None.

asterisk*CLI> stun show status
Hostname Port Period Retries Status ExternAddr ExternPort
stun1.l.google.com 19305 60 3 OK 108.21.6.11 44948

asterisk*CLI> module show like opus
Module Description Use Count Status Support Level
codec_opus.so OPUS Coder/Decoder 0 Running extended
format_ogg_opus.so OGG/Opus audio 0 Running core
res_format_attr_opus.so Opus Format Attribute Module 1 Running core

asterisk*CLI> rtp set debug on
RTP Packet Debugging Enabled
Got RTP packet from 107.221.54.212:61399 (type 111, seq 044697, ts 2704833521, len 000085)
Got RTP packet from 107.221.54.212:56933 (type 111, seq 023182, ts 3142138303, len 000081)
Got RTP packet from 107.221.54.212:64243 (type 111, seq 036605, ts 3995418841, len 000086)
Got RTP packet from 107.221.54.212:61399 (type 111, seq 044698, ts 2704834481, len 000084)
Got RTP packet from 107.221.54.212:56933 (type 111, seq 023183, ts 3142139263, len 000084)
Got RTP packet from 107.221.54.212:64243 (type 111, seq 036606, ts 3995419801, len 000090)
Got RTP packet from 107.221.54.212:61399 (type 111, seq 044699, ts 2704835441, len 000084)
Got RTP packet from 107.221.54.212:56933 (type 111, seq 023184, ts 3142140223, len 000083)
Got RTP packet from 107.221.54.212:64243 (type 111, seq 036607, ts 3995420761, len 000084)
Got RTP packet from 107.221.54.212:61399 (type 111, seq 044700, ts 2704836401, len 000085)
Got RTP packet from 107.221.54.212:56933 (type 111, seq 023185, ts 3142141183, len 000091)
Got RTP packet from 107.221.54.212:64243 (type 111, seq 036608, ts 3995421721, len 000093)

<— Transmitting SIP response (1547 bytes) to WSS:107.221.54.212:51165 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS 1lutp1hs5lep.invalid;rport=51165;received=107.221.54.212;branch=z9hG4bK3533181
Call-ID: v9tkcrvgqijd2a577it7
From: “300” sip:300@asterisk.iqbot.app;tag=5dh5nnol3i
To: sip:1000@asterisk.iqbot.app;tag=93e4fd11-e373-4cfd-acfb-b7c8559ee1ed
CSeq: 79 INVITE
Server: Asterisk PBX 18.14.0
Contact: sip:192.168.1.6:8089;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: 909

v=0
o=- 4169043501 4 IN IP4 192.168.1.6
s=Asterisk
c=IN IP4 192.168.1.6
t=0 0
a=msid-semantic:WMS *
a=group:BUNDLE 0
m=audio 10044 UDP/TLS/RTP/SAVPF 111 0 126
a=connection:new
a=setup:active
a=fingerprint:SHA-256 05:32:0B:41:E6:70:22:95:41:88:91:06:FF:B5:92:E3:E8:0A:B8:CC:BA:13:18:16:6B:CF:46:D7:A1:74:9B:DB
a=ice-ufrag:6341dd375e7e3b6868c2afd67a711646
a=ice-pwd:77b1cb2632795ad72584a197287f249d
a=candidate:H6cd53f01 1 UDP 2130706431 108.21.6.1 10044 typ host
a=candidate:S6cd53f11 1 UDP 1694498815 108.21.6.11 10044 typ srflx raddr 108.21.6.1 rport 10044
a=rtpmap:111 opus/48000/2
a=rtpmap:0 PCMU/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:404311957 cname:cd2b5b27-6567-4a74-b96b-98170aa011c4
a=msid:be095b8b-1b0c-41f7-96c5-2d769a409c7a 4f8038cf-7f23-4b2b-8c66-9453f44c2c59
a=rtcp-fb:* transport-cc
a=mid:0

<— Received SIP request (445 bytes) from WSS:107.221.54.212:51165 —>
ACK sip:192.168.1.6:8089;transport=ws SIP/2.0
Via: SIP/2.0/WSS 1lutp1hs5lep.invalid;branch=z9hG4bK1711120
Max-Forwards: 69
To: sip:1000@asterisk.iqbot.app;tag=93e4fd11-e373-4cfd-acfb-b7c8559ee1ed
From: “300” sip:300@asterisk.iqbot.app;tag=5dh5nnol3i
Call-ID: v9tkcrvgqijd2a577it7
CSeq: 79 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: outbound
User-Agent: JsSIP 3.10.0
Content-Length: 0

If anyone can help me, I would not be able to thank you.

Best Regards,

Ivan

Your RTP Packet is not sending properly please check once Network Setting .

Thanks, I really appreciate your reply Ankit !

If it helps to find the issue, I will share my router configuration and my rtp.conf setup.

[general]
rtpstart=10000
rtpend=20000
icesupport=yes
strictrtp=no
stunaddr:19305=stun1.l.google.com
[ice_host_candidates]
192.168.1.6 => 108.21.6.11

In my Router, I have a port forward range from 10000 to 20000 to asterisk internal IP address 192.168.1.6. Probably it’s working because the communication using PJSIP channels with Softphone have audio and is stable.

In the last RTP debug I sent, probably I had no added both channels to the Bridge, follow a new chunk with this condition, I see the Sent and Got packages now, it should be different from this?

Sent RTP packet to 107.221.54.212:51678 (via ICE) (type 111, seq 015766, ts 2844817344, len 000068)
Got RTP packet from 107.221.54.212:51678 (type 111, seq 021220, ts 113312192, len 000050)
Sent RTP packet to 107.221.54.212:64383 (via ICE) (type 111, seq 021809, ts 113312160, len 000050)
Got RTP packet from 107.221.54.212:64383 (type 111, seq 038620, ts 2844818310, len 000068)
Sent RTP packet to 107.221.54.212:51678 (via ICE) (type 111, seq 015767, ts 2844818304, len 000068)
Got RTP packet from 107.221.54.212:51678 (type 111, seq 021221, ts 113313152, len 000050)
Sent RTP packet to 107.221.54.212:64383 (via ICE) (type 111, seq 021810, ts 113313120, len 000050)
Got RTP packet from 107.221.54.212:64383 (type 111, seq 038621, ts 2844819270, len 000072)
Sent RTP packet to 107.221.54.212:51678 (via ICE) (type 111, seq 015768, ts 2844819264, len 000072)
Got RTP packet from 107.221.54.212:51678 (type 111, seq 021222, ts 113314112, len 000050)
Sent RTP packet to 107.221.54.212:64383 (via ICE) (type 111, seq 021811, ts 113314080, len 000050)

And my pjsip.conf.

[WSSTRANS]
type=transport
protocol=wss
bind=0.0.0.0:8089
local_net=192.168.1.0/24
external_media_address=108.21.6.11
external_signaling_address=108.21.6.11
allow_reload=yes

Do you see something wrong or lack of parameters ?

Best Regards,

Ivan

Please mark your configurations up as pre-formatted. Whilst this appears wrong, it is actually:

stunaddr=stun1.l.google.com:19305

which looks plausible.

Thanks David, I double check the configuration and it’s typed correctly in my file. For some reason this asterisk forum form is messing the line when I paste.

[general]
rtpstart=10000
rtpend=20000
icesupport=yes
strictrtp=no
stunaddr:19305=stun1.l.google.com

[ice_host_candidates]
192.168.1.6 => 108.21.6.11

BR,

Ivan


[general]
rtpstart=10000
rtpend=20000
icesupport=yes
strictrtp=no
stunaddr=stun1.l.google.com:19305

[ice_host_candidates]
192.168.1.6 => 108.21.6.11

The current Screenshot.

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