Asterisk 15 WebRTC Configured SIPML5 - but couldnt hear audio in browser


#1

Hi,
I tried Asterisk 15 latest version and successfully installed it. I followed the tutorial to configure webRTC
https://wiki.asterisk.org/wiki/display/AST/Configuring+Asterisk+for+WebRTC+Clients

Everything is working and I didnt get any error in console. Also, I can able to call from browser and status changing to InCall but the only issue is I could not hear the audio from browser?
Is it normal ? Could someone please help me

Thanks

-- Contact webrtc_client/sips:webrtc_client@xxxxx:50605;transport=ws;rtcweb-breaker=no is now Unknown.

== Endpoint webrtc_client is now Reachable
== Setting global variable ‘SIPDOMAIN’ to ‘xxxx’
== DTLS ECDH initialized (automatic), faster PFS enabled
– Executing [200@default:1] Answer(“PJSIP/webrtc_client-00000000”, “”) in new stack
> 0x7ffab402c7f0 – Strict RTP learning after remote address set to: 122.174.231.175:60011
– Executing [200@default:2] Playback(“PJSIP/webrtc_client-00000000”, “”/var/lib/asterisk/sounds/en/demo-congrats"") in new stack
– <PJSIP/webrtc_client-00000000> Playing ‘/var/lib/asterisk/sounds/en/demo-congrats.slin16’ (language ‘en’)
> 0x7ffab402c7f0 – Strict RTP learning after ICE completion
– Executing [200@default:3] Hangup(“PJSIP/webrtc_client-00000000”, “”) in new stack
== Spawn extension (default, 200, 3) exited non-zero on ‘PJSIP/webrtc_client-00000000’


#2

I have had this same issue and solution was problems with firewall, set properly rtp.conf


#3

Thanks for you reply.
but can you please tell me the property name should I change.
or should I provide my host name

I also turned off firewalld in my Centos 7 Server


#4
[rtp.conf]

icesupport=yes
stunaddr = stun.1.google.com:19302


#5

I tried but it seems not working.


#6

In extensions.conf
I have only the following code
[default]
exten => 200,1,Answer()
same => n,Playback(demo-congrats)
same => n,Hangup()

will that be a issue?


#7

From the Asterisk CLI enable rtp debug and see where the packets are being sent and make sure they are being sent to the appropriate address. You can use the following commands to enable/disable rtp debug:

CLI> rtp set debug on
CLI> rtp set debug off

Also increase the debug level and enable sip tracing for your channel driver in Asterisk. Then post the results here for the call in question. See Collecting Debug Information on the wiki for how to enable more debugging and sip tracing.


#8

Thank you Kharwell

It seems packets are sent to my IP address. please take a look on logs

*CLI> core set verbose 5
Console verbose was 3 and is now 5.
*CLI> core set debug 5
Core debug was OFF and is now 5.
*CLI> module reload logger
Module ‘logger’ reloaded successfully.
*CLI> Asterisk Queue Logger restarted
== WebSocket connection from ‘122.164.218.255:51353’ for protocol ‘sip’ accepted using version ‘13’
– Added contact ‘sips:webrtc_client@122.164.218.255:51353;transport=ws;rtcweb-breaker=no’ to AOR ‘webrtc_client’ with expiration of 200 seconds
– Contact webrtc_client/sips:webrtc_client@122.164.218.255:51353;transport=ws;rtcweb-breaker=no is now Unknown.
== Setting global variable ‘SIPDOMAIN’ to ‘asterisk.org
== DTLS ECDH initialized (automatic), faster PFS enabled
– Executing [200@default:1] Answer(“PJSIP/webrtc_client-00000001”, “”) in new stack
– Executing [200@default:2] Playback(“PJSIP/webrtc_client-00000001”, “demo-congrats”) in new stack
Sent RTP packet to 122.164.218.255:53847 (type 111, seq 003393, ts 000096, len 000070)
– <PJSIP/webrtc_client-00000001> Playing ‘demo-congrats.slin16’ (language ‘en’)
Sent RTP packet to 122.164.218.255:53847 (type 111, seq 003394, ts 001056, len 000069)
Sent RTP packet to 122.164.218.255:53847 (type 111, seq 003395, ts 002016, len 000070)
Sent RTP packet to 122.164.218.255:53847 (type 111, seq 003396, ts 002976, len 000070)
Sent RTP packet to 122.164.218.255:53847 (type 111, seq 003397, ts 003936, len 000070)


#9

So if Asterisk is sending out the rtp packets and they are going to the right (negotiated/expected) place (ip:port) then the next step is to figure out if they are getting to the browser hosted machine.

The easiest way to do this is is to use something like wireshark and get a packet capture.

Before that I’d double check, and rule out the obvious. For instance make sure the sound on the system is not muted and turned up to a sufficient level. Make sure too the browser itself is not muting the audio (tab mute for instance). Are you expecting the sound to come out a speaker, but headphones are plugged in? etc… Somewhat silly I know but sometimes it’s easy to overlook the obvious :smiley:


#10

Actually I just learned that if rtp debug is on then if ICE is negotiated then in it will say something along the lines of “(via ICE)” in the output. As this is not shown in your log then chances are ICE negotiation failed, thus DTLS didn’t get negotiated.


#11

Ok thanks

I disabled ;icesupport=true and test

Still i couldnt hear the sound


#12

WebRTC requires ICE, DTLS, and SRTP. You can’t disable it. They are foundational aspects. If you are planning to use WebRTC in any capacity you need to learn the basics of them including how to debug and understand what is going on. WebRTC can, and WILL, fail to work like you’re seeing.


#13

Hi Jcolp,

Thank you. I have started to read about Asterisk for the past 10 days. I read so many answers from you from installation, troubleshooting.

your answers really helped me. I will try to read the basics of webrtc and fix it.

If you can suggest me any articles that would be helpful.

Thanks

Saravana


#14

I am using Google cloud server. Do you think any settings related to the machine.

Thanks


#15

Depending on how the networking is done it could be the cause.