Platform Guide

Asterisk Call Quality Troubleshooting

9 min read  ·  Updated April 2026

Audio quality problems in Asterisk — one way audio, choppy calls, echo, robotic voices — all have specific root causes you can find in the RTP statistics and debug output. Here's how to diagnose and fix each one systematically.

In this guide

1. Reading Asterisk RTP statistics

Asterisk logs RTP statistics at call teardown when rtcpstats=yes is enabled. These stats are your first diagnostic tool:

; Enable in rtp.conf [general] rtcpstats=yes rtpchecksums=yes ; Output in Asterisk log at call end: ; Got RTCP report from 192.168.1.100:10001 ; PT: 200(Sender Report) ; Reception reports ; Fraction lost: 0/256 ; Packets lost: 0 ; Highest seq no received: 1234 ; Interarrival jitter: 240 (30ms) ; Last SR: 1234567890 ; Delay since last SR: 0

Key values to check: Fraction lost (0 = no loss, 256 = 100% loss), Packets lost (cumulative), Interarrival jitter (in RTP timestamp units — divide by 8 for ms on G.711). Also check via the CLI during an active call:

; During active call rtp set debug on core show channel SIP/1001-00000001

2. Diagnosing one way audio in Asterisk

One way audio in Asterisk is almost always a NAT or direct_media issue. Check these in order:

Step 1 — Check direct_media

With direct_media=yes (default in chan_sip, configurable in PJSIP), Asterisk re-INVITEs to get media flowing directly between endpoints. If one endpoint is behind NAT, direct media will fail. Set direct_media=no to force all media through Asterisk and test.

Step 2 — Check RTP debug output

rtp set debug ip 192.168.1.100 ; Shows RTP packets to/from that IP ; Look for packets in both directions

Step 3 — Check the SDP in the INVITE

Enable SIP/PJSIP debug and look at the SDP c= line. If it contains a private RFC 1918 address, NAT is the issue. For PJSIP, set external_media_address on the transport.

3. Echo cancellation in Asterisk

Echo in Asterisk calls comes from acoustic feedback at an analog endpoint (handset or speakerphone) being picked up by the microphone. Asterisk includes the OSLEC and SPEEX echo cancellers.

; In chan_dahdi.conf (for analog lines) echocancel=yes echocancelwhenbridged=yes echotraining=800 ; For SIP calls, echo is usually at the endpoint ; Check the phone's acoustic echo cancellation settings ; Also check: is direct_media=yes causing echo on re-INVITE?

For SIP-to-SIP calls with echo, the most common cause is direct_media=yes with a re-INVITE that changes the media path after the call connects. Disable direct_media as a test.

4. Choppy or robotic audio

Choppy audio in Asterisk calls is caused by packet loss or jitter exceeding the jitter buffer. Diagnose with:

; Check RTP stats at call end in /var/log/asterisk/full ; Look for: ; Packets lost > 0 ; Interarrival jitter > 160 (20ms at 8000Hz) ; Also check server CPU during calls top -b -n 1 | head -20 ; Check for packet loss on the network interface ip -s link show eth0

Robotic audio specifically (as opposed to occasional clips) often indicates codec transcoding — Asterisk is converting between codecs in the media path. Check the codec negotiation and try to establish a direct codec path without transcoding.

5. direct_media and media path

direct_media (called canreinvite in old chan_sip) controls whether Asterisk tries to get out of the media path. When enabled:

Recommendation: Set direct_media=no by default. Enable it selectively only for internal calls between endpoints on the same LAN where NAT is not a factor.

6. Jitter buffer configuration

; In rtp.conf [general] ; Enable adaptive jitter buffer jbenable=yes jbmaxsize=200 ; max buffer in ms (default 200) jbresyncthreshold=1000 ; For specific calls in dialplan ; Use JITTERBUFFER application same => n,JITTERBUFFER(adaptive,default,200,1000)

The adaptive jitter buffer automatically adjusts depth based on observed jitter. For most deployments, the defaults work well. Increase jbmaxsize to 200-300ms for high-jitter paths. Don't exceed 300ms or you introduce noticeable conversational latency.

Frequently asked questions

How do I fix one way audio in Asterisk?

One way audio in Asterisk is almost always NAT or direct_media. First set direct_media=no to force media through Asterisk. If that fixes it, NAT is the cause — configure external_media_address in PJSIP transport or nat=yes in chan_sip with your external IP. Use rtp set debug to see exactly which direction packets are flowing.

How do I check RTP statistics in Asterisk?

Enable rtcpstats=yes in rtp.conf. Asterisk logs RTP statistics at call teardown showing packets lost, jitter, and sequence numbers. During an active call use rtp set debug ip [address] to see live packet flow. Check /var/log/asterisk/full for RTCP report entries.

What causes choppy audio in Asterisk?

Choppy audio in Asterisk is caused by RTP packet loss or jitter exceeding the jitter buffer. Check RTCP stats for Packets lost > 0 and Interarrival jitter. Also check server CPU — high CPU causes RTP send scheduling delays that appear as jitter. Robotic audio specifically often indicates codec transcoding.

Having call quality issues in Asterisk?

Paste your Asterisk SIP debug or RTP statistics into SIPSymposium. The analyzer identifies one-way audio causes, codec transcoding paths, and RTP quality issues.

Analyze my trace Create free account
Related guides