Please help.
The problem is one way audio (as always). RTC client to RTC client no problem. RTC client audio to WebRTC jsSip client via ice nog problem. But Audio from RTC client to WebRTC jsSip client no go.
Anybody a suggestion how to solve this. Please help.
We tryed also the playback function and that also does not work to the WebRTC jsSip client. So its not the RTC client that does not send any audio. Also the RTC to RTC on any internal networks or over VPN works.
It looks like Asterisk does no do the RTC to WebRTC audio in the correct way.
We have the following setup.
WebRTC jsSip client (ext. 6002,ip:5.132… ) ↔ firwall (Portmapping, PublicIP: 185.50…) ↔ Asterix 23.0.0 (Intern ip: 10.55… ) ↔ firwall (Portmapping) ↔ firwall (Direct VPN) ↔ RTC client (ext. 5001, 10.192…).
-–rtp.conf—
[general]
rtpstart=10000
rtpend=20000
icesupport=true
stunaddr = 74.125.250.129:19302
rtpbindaddr = 0.0.0.0
[ice_host_candidates]
10.55… => 185.50…
-– pjsip.conf —
[global]
type=global
user_agent=AsteriskPBX
endpoint_identifier_order=ip,username,anonymous
; -------------------------------
; TRANSPORT (VERPLICHT)
; -------------------------------
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
[transport-wss]
type = transport
protocol = wss
bind = 0.0.0.0
external_media_address = 185.50…
external_signaling_address = 185.50…
local_net=10.55…/24
local_net=10.192…/16
[transport-tcp]
type = transport
protocol=tcp
bind=0.0.0.0
; -------------------------------
; 5001 - C# SIP client
; -------------------------------
[5001]
type=endpoint
context=internal
disallow=all
allow=ulaw
aors=5001
auth=auth5001
callerid=“CSharp Client #5001” <5001>
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
[5001]
type=aor
max_contacts=1
remove_existing=yes
qualify_frequency=0
[auth5001]
type=auth
auth_type=userpass
username=5001
password=#############
; -------------------------------
; 6002 - WebRTC browser endpoint
; -------------------------------
[6002]
type=endpoint
context=from-webrtc
disallow=all
allow=ulaw
webrtc=yes
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
auth=auth6002
aors=6002
callerid=“WebRTC Browser 6002” <6002>
transport=transport-wss
[auth6002]
type=auth
auth_type=userpass
username=6002
password=#######
realm=pbx.syscon.nl
[6002]
type=aor
max_contacts=5
remove_existing=yes
qualify_frequency=0
-–Extensions.conf —
[general]
static=yes
writeprotect=no
; -------------------------------
; Internal
; -------------------------------
[internal]
; 5001
exten => 5001,1,NoOp(Call to 5001)
exten => 5001,2,Dial(PJSIP/5001,20)
exten => 5001,3,Hangup()
exten => 7000,1,NoOp(TEST 7000 Playback from WebRTC)
same => n,Answer()
same => n,Wait(2)
same => n,Playback(demo-congrats)
same => n,Wait(2)
same => n,Hangup()
; -------------------------------
; WebRTC browser context
; -------------------------------
[from-webrtc]
; WebRTC browser
exten => _1XXX,1,NoOp(WebRTC belt intern ${EXTEN})
same => n,Dial(PJSIP/${EXTEN},20)
same => n,Hangup()
; (6002)
exten => 6002,1,NoOp(to WebRTC browser)
same => n,Dial(PJSIP/6002,20)
same => n,Hangup()
exten => 7000,1,NoOp(TEST 7000 Playback from WebRTC)
same => n,Answer()
same => n,Wait(2)
same => n,Playback(demo-congrats)
same => n,Wait(2)
same => n,Hangup()
exten => 7001,1,NoOp(TEST 7001 Echo from WebRTC)
same => n,Answer()
same => n,Wait(1)
same => n,Echo()
same => n,Hangup()
exten => 7002,1,NoOp(TEST 7002 Milliwatt )
same => n,Answer()
same => n,MixMonitor(/tmp/7002-${UNIQUEID}-mix.wav,t(/tmp/7002-${UNIQUEID}-tx.wav))
same => n,Wait(2)
same => n,Milliwatt()
same => n,Hangup()
Log from the WebRTC client JsSip.
09:13:14.370 Connection to wss://pbx…nl:8089/ws
09:13:14.371 JsSIP debug enabled (see browser console for full SIP traces)
09:13:14.373 Connecting WebSocket…
09:13:14.511 WebSocket connected ✓
09:13:14.592 SIP registered ✓
09:13:24.737 Calling sip:5001@pbx…nl
09:13:24.737 PeerConnection config: {“iceServers”:[{“urls”:“stun:stun.l.google.com:19302”}]}
09:13:24.741 newRTCSession (local)
09:13:27.556 session: connecting
09:13:27.559 local ICE candidate: candidate:2043630356 1 udp 2113937151 8f5607fc-4e41-4981-af41-bde8163de060.local 65146 typ host generation 0 ufrag rK64 network-cost 999
09:13:27.626 local ICE candidate: candidate:40620887 1 udp 1677729535 5.132… 8977 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag rK64 network-cost 999
09:13:27.676 SDP [local offer] received/generated
09:13:27.677 SDP [local] audio direction: sendrecv
09:13:27.677 SDP [local] connection IP: 5.132…
09:13:27.978 session: progress (180/183)
09:13:33.517 SDP [remote answer] received/generated
09:13:33.518 SDP [remote] audio direction: sendrecv
09:13:33.518 SDP [remote] c= line is private (10.55…), but ICE provides a public candidate → the media path runs via ICE, not via c=. This is OK.
09:13:33.519
Remote (PBX) offers a public ICE candidate: 185.50… — NAT traversal should now work. Check the incoming RTP packets in the RTP Statistics tab.
09:13:33.526 session: accepted (200 OK)
09:13:33.527 session: confirmed — call active
09:13:33.528 RTP statistics monitoring started (every 1s)
09:13:33.528 remoteAudio connected via getReceivers() fallback
09:13:33.542 audio meter attached to received stream
09:13:33.570
audio unlocked and playing ✓
09:13:33.571 audio playback started ✓ (via fallback)
09:13:34.531
Received audio codec: PCMU payload type 0 — this matches the RTC client (PCMU). No transcoding; this should work.
09:13:34.531
DTLS connected — SRTP cipher: AES_CM_128_HMAC_SHA1_80 — the browser can decrypt incoming SRTP. If the audio level still remains at 0, the problem is not in the encryption layer.
09:13:55.311 session: ended (Terminated)
09:13:55.313 Call ended
RTP log Asterisk:
Got RTP packet from 10.192…:5004 (type 00, seq 042490, ts 4132590683, len 000160)
Sent RTP packet to 5.132…:58195 (via ICE) (type 00, seq 049389, ts 4132590680, len 000170)
Got RTP packet from 5.132…:58195 (type 00, seq 017163, ts 1942172644, len 000170)
Sent RTP packet to 10.192…:5004 (type 00, seq 040401, ts 1942172640, len 000160)
Got RTP packet from 10.192…:5004 (type 00, seq 042491, ts 4132590843, len 000160)
Sent RTP packet to 5.132…:58195 (via ICE) (type 00, seq 049390, ts 4132590840, len 000170)