Asterisk WebRTC Audio Issues_ Fixing No Audio in Browser Calls

This post walks through the real mechanics of Asterisk WebRTC No Audio, the specific points where it breaks, and the commands and configuration checks that resolve each case. It is written for administrators who manage their own Asterisk-based agent web client and want a repeatable diagnostic process rather than a single generic fix.

A browser-based agent logs into a campaign, the call connects, the timer starts running, and then nothing happens on either side. No ringing tone, no voice, sometimes not even a hiss. The call shows as answered in every log, the agent status looks correct, and yet the audio channel stays silent.

This is one of the most common support requests we handle for teams running a WebRTC softphone on top of Asterisk. The frustrating part is that the signalling layer is almost always fine. SIP registration succeeds, the dialog gets established, and the call duration counter keeps ticking. The actual fault sits one layer below, in how the browser and the media server negotiate and exchange the audio stream itself.

How WebRTC Audio Communication Works in Asterisk

Why Asterisk WebRTC No Audio behaves differently from a regular SIP call

A desk phone or a softphone using plain SIP over UDP sends RTP packets directly, with the media path usually following a predictable route through a known set of ports. A browser is far more restrictive. 

It runs WebRTC inside a sandboxed environment that insists on encrypted media (SRTP over DTLS), negotiates its network path through ICE candidates, and only unlocks audio playback once the browser’s own autoplay and permission rules are satisfied.

That means a Asterisk WebRTC No Audio has several additional steps between “the call connected” and “the agent can hear audio”:

  1. The browser gathers ICE candidates (its own local address, any address learned from a STUN server, and sometimes a relayed address through TURN).
  2. Those candidates are exchanged with Asterisk through the SDP inside the SIP messages, carried over the secure websocket transport.
  3. Once a usable candidate pair is selected, the two sides perform a DTLS handshake to agree on encryption keys for the audio stream.
  4. Only after DTLS completes does actual SRTP media start flowing, and only then does a codec actually need to match on both ends.

A failure at any one of those four steps looks identical from the agent’s point of view: the call connects, but no audio is heard in either direction, or audio works in only one direction.

Step 1: Confirm whether it’s a one-way or two-way silence

Before touching configuration, establish exactly what is failing. Ask the agent, or test directly, whether:

  • Neither side hears anything (full two-way silence)
  • The agent hears the customer but the customer cannot hear the agent, or the reverse (one-way audio)
  • Audio starts working after several seconds of silence (a delayed media path)

Each of these points to a different layer of the stack. Full two-way silence usually points to ICE or DTLS failing before any media starts. One-way audio almost always points to NAT or RTP routing, because signalling and one media direction are working while the return path is blocked. 

A delayed start that eventually works points to a slow ICE candidate negotiation, often caused by a missing or unreachable STUN server, where the browser eventually falls back to a working candidate after timing out on the preferred one.

Step 2: Read the browser’s own WebRTC diagnostics first

Before opening a terminal on the server, open chrome://webrtc-internals (or about:webrtc in Firefox) during a live call. This single page answers most of the first-layer questions:

  • Under the active PeerConnection, check the ICE candidate pair that was selected. If it shows a “failed” or “disconnected” state instead of “succeeded,” the problem is ICE connectivity, not Asterisk configuration.
  • Check whether any candidates were gathered at all beyond the local “host” type. If only host candidates appear and no “srflx” (server reflexive) candidate shows up, the browser never successfully reaches the STUN server, which usually means the STUN server address in the agent client configuration is wrong, unreachable, or blocked by an outbound firewall rule.
  • Check the “bytes sent” and “bytes received” counters on the outbound and inbound audio tracks. If bytes sent are climbing but bytes received stays at zero, the agent’s browser is transmitting audio but not receiving any, which narrows the fault to the inbound RTP path from Asterisk WebRTC No Audio.

This step alone often tells you which side of the call needs attention before any PJSIP configuration is touched.

Step 3: Check PJSIP transport and endpoint configuration for the websocket

The most common misconfiguration sits in pjsip.conf (or the equivalent configuration generated by your agent web client), specifically in how the websocket transport and the endpoint’s media settings are defined.

Points to verify on the transport:

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

The transport needs a valid certificate chain if the agent client is served over a secure page, because browsers refuse to open a websocket connection to an untrusted certificate from a page loaded over https. 

A self-signed certificate that the browser has not explicitly trusted will cause the websocket itself to fail silently, which then prevents any SIP signalling, let alone media, from working. Confirm this isn’t the actual root cause by opening the websocket URL directly in a new browser tab and checking for a certificate warning.

On the endpoint, the fields that matter most for audio are:

[agent_endpoint]
type=endpoint
webrtc=yes
dtls_auto_generate_cert=yes

The webrtc=yes shortcut sets most of these automatically in recent Asterisk versions, but on older configurations built manually, a missing media_encryption=dtls or rtcp_mux=yes is enough to prevent the DTLS handshake from ever starting, since the browser will refuse to negotiate plain RTP for a page it considers a secure context.

Step 4: Check the STUN and TURN configuration

If the webrtc-internals output showed the browser was stuck without a server reflexive candidate, the STUN configuration needs attention. In rtp.conf:

stunaddr=stun.l.google.com:19302

A publicly reachable STUN server is enough for most direct network paths. Where agents are behind restrictive corporate firewalls that block the STUN exchange outright, or where Asterisk WebRTC No Audio itself sits behind strict NAT on both sides, a TURN relay becomes necessary, since ICE has no other way to establish a usable path between two endpoints that cannot reach each other directly. 

Without a working TURN relay in that scenario, calls will connect at the signalling layer and then sit in permanent silence because ICE never completes.

STUN and TURN servers handling ICE connectivity and media relay between a WebRTC browser and Asterisk server.

Step 5: Verify codec negotiation

Browsers only offer a specific, narrow set of audio codecs for WebRTC, with Opus as the default preferred codec, alongside basic support for G.711 (ulaw/alaw). If the endpoint’s allowed codec list on the Asterisk side does not include a codec the browser actually offers, SDP negotiation can still technically succeed at the signalling layer in some configurations while leaving no common codec for actual media. 

Check the endpoint’s codec list:

allow=!all,opus,ulaw

If the campaign or trunk only transcodes through G.729 or another narrowband codec not supported by WebRTC in the browser, insert a transcoding step or add ulaw as a fallback so the browser side always has a codec it can actually decode.

Step 6: Check NAT and RTP port routing for one-way audio

If the diagnosis from Step 1 pointed to one-way audio specifically, the fault is almost always in how RTP packets are routed back to the browser after DTLS has already succeeded. 

Confirm:

  • The RTP port range configured in rtp.conf is fully open on the server’s firewall, matching exactly what is configured:
rtpstart=10000
rtpend=20000
  • rtp_symmetric=yes is set on the endpoint, so Asterisk sends return RTP to the actual source address and port it received packets from, rather than the address advertised in the original SDP, which is frequently wrong when the agent is behind NAT.
  • force_rport=yes is set so Asterisk also corrects the SIP signalling path in the same way.
  • If the server itself sits behind NAT (a private network address translated to a public one), external_media_address and external_signaling_address in the transport section are set to the server’s actual public address, not left blank, otherwise Asterisk WebRTC No Audio will advertise its private address in the SDP, which the browser cannot reach at all.

Step 7: Use live packet capture to confirm the fix

Once configuration changes are made, confirm with a live capture rather than guesswork. From the Asterisk CLI:

rtp set debug on
pjsip set logger on

This streams every RTP and SIP packet to the console in real time during a test call, showing exactly which IP and port Asterisk is sending to and receiving from. Compare this against the candidate pair shown in chrome://webrtc-internals from Step 2. A mismatch between the two (Asterisk sending to one address while the browser expects packets on another) confirms the fix landed on the right configuration area, or reveals a remaining gap if the addresses still do not line up.

A quick reference for the four failure points

SymptomUsual Layer at FaultFirst Place to Check
No audio at all, both directionsICE or DTLS negotiationchrome://webrtc-internals candidate state
Agent hears customer, not the reverseNAT / RTP return pathrtp_symmetric, force_rport
Customer hears agent, not the reverseNAT / RTP return pathexternal_media_address
Call connects, long delay before audioSTUN unreachable or timing outstunaddr in rtp.conf
Call connects, audio never startsCodec mismatchallow= list on the endpoint

Frequently asked questions

Not strictly, but without one the browser can only gather local host candidates, which frequently fail to connect once any NAT is involved on either side. A working STUN address resolves the majority of these cases.

One-way audio almost always points to the RTP return path rather than signalling. Check rtp_symmetric, force_rport, and the external address settings on the transport, since these control where Asterisk actually sends return media.

Yes. Browsers only support a narrow codec set for WebRTC, led by Opus with G.711 as a fallback. If the endpoint’s codec list does not include one the browser offers, there is no common codec for media even though signalling is completed.

Indirectly, yes. If the browser does not trust the certificate on the websocket transport, the signalling connection itself may fail or behave unpredictably, which prevents the later ICE and DTLS steps from ever starting correctly.

Open chrome://webrtc-internals during a live test call and read the ICE candidate pair state alongside Asterisk’s own rtp set debug on output. Reading both together narrows the fault to a specific layer within minutes instead of guessing across the whole configuration.

Final note

Most WebRTC audio failures on Asterisk WebRTC No Audio trace back to one of a small number of configuration points: ICE and STUN reachability, the DTLS and encryption settings on the endpoint, codec compatibility with the browser, and NAT-aware RTP routing. Working through these in order, with the browser’s own diagnostics read alongside Asterisk’s logs, turns a silent call from a mystery into a short checklist.

If your agents are still hitting silent calls after working through this list, or the issue is tied to a specific trunk or campaign setup, reach out to DialerKing for a direct configuration review.

Dialerking Note

Leave A Comment

All fields marked with an asterisk (*) are required