Asterisk WewRTC one way audio

Hi ! I have already read people that have the same problem as me but nothing works …
So, a call between two webrtc client (ws) works perfectly. The problem is when I call a webrtc client from a simple sip phone (udp->ws), got one way audio, I can’t hear the sip phone …
Is it normal ? have I to install a gateway ?

There is my pjsip.conf :

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

[transport-ws]
type=transport
protocol=ws
bind=0.0.0.0

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[199]
type=endpoint
aors=199
auth=199
use_avpf=yes
media_encryption=dtls
dtls_ca_file=/etc/asterisk/keys/ca.crt
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
webrtc=yes
media_use_received_transport=yes
rtcp_mux=yes
context=diese
disallow=all
allow=ulaw
allow=alaw
allow=opus

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

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

[200]
type=endpoint
aors=200
auth=200
use_avpf=yes
media_encryption=dtls
dtls_ca_file=/etc/asterisk/keys/ca.crt
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
webrtc=yes
media_use_received_transport=yes
rtcp_mux=yes
context=diese
disallow=all
allow=ulaw
allow=alaw
allow=opus

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

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

[portierdiese]
type=endpoint
context=diese
disallow=all
allow=ulaw
allow=opus
allow=alaw
auth=portierdiese
aors=portierdiese

[portierdiese]
type = auth
auth_type = userpass
password = 9999
username = portierdiese

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

rtp.conf :

[general]
;
; RTP start and RTP end configure start and end addresses
;
; Defaults are rtpstart=5000 and rtpend=31000
;
rtpstart=10000
rtpend=20000
icesupport = true
stunaddr = stun.l.google.com:19302

Thx for help !

I’m not able to find something bad in logs … Is it possible to have two way audio between a sip client and webRTC client ? My webRTC client don’t hear the sip phone.

Hi ! I have a Asterisk 18 and communication between two webRTC client work fine. However, when I call a webRTC client with a simple SIP phone, I get a one way audio problem. I can’t hear the sip phone from the webRTC client. So my question is simple : is it possible to fix it ? Or I need to install a gateway, change the phone to webRTC ?

Thanks !

Asterisk is a back to back user agent, so should treat the two sides independently, by default. It shouldn’t matter whether the other side is SIP, analogue, H.323, Skinny, ISDN, etc.

You need to provide details of the SDP being sent on both legs.

@RobMat try debugging the rtp flow using rtp set debug on to observe which if it’s not sending to private ip instead. You might have to mess around with your client application too. Add stun address to the app’s settings. Try testing with different clients, like AntiSip. Zoiper and Linphone didn’t work for me when I was trying this out. Our usecase involved video as well though.
Not sure if it will help but still here’s our issue thread Webrtc SipML 5 audio issue + asterisk

HI ashishj, thank you for your response. I used rtp debug to see what happens and I got this :


In this case I used stun google server address.
I think that you are true, the sip softphone is on a private ip address (VPN).

After, I added “direct_media = no” and rtp_symetric = yes" in pjsip.conf for the softphone and now there is two way audio but it is really really hard to hear to sofphone from the webrtc phone …

I try to use Opus instead of the 711 codecs but I still have the same problem.

I don’t know if it can be a hardware problem or still be a communication problem. Do you see somethings wrong in log ?

For simple calls, if you use the same codec on both sides, Asterisk will not touch the media beyond, possibly, changing packet boundaries. That means any lack of amplitude is an issue between the phones and isn’t affected by Asterisk.

For future reference, photographs, and other image representations, of logs are difficult to use and you can easily take the actual text of the log from the log file (generally preferred), or copy it as text, from the terminal emulator window.

Ok I’m sorry, it’s because I’m using VNC.
Ok so there is not something wrong in RTP packets, because I see ice support for the webRTC phone and I don’t understand if my softphone is on a good ip adress or behind nat …

Is it just a volume issue or are there packet losses as well? You can check that using some channel stats command on asterisk. If it’s strictly a volume issue then seems to be an issue with the softphone or the hardware it’s running on. You can look into the Volume dialplan function to amplify the audio. I haven’t tried it personally though.

Hi, thank you for your help, it was a microphone issue. My SIP softphone is in fact a intercom with a Raspberry, the problem was just the volume of it… Anyway, I’m grateful to you !

1 Like

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