calricon.
VoIP & Telecom

Fixing ViciDial and Asterisk One-Way Audio from SIP ALG & RTP

Nov 15, 2026/4 min read/Verified Production Playbook

calricon / field note

ViciDial and Asterisk calls frequently connect with clean SIP

Nov 15, 2026/VoIP & Telecom
356
Advertisement

Fixing ViciDial and Asterisk One-Way Audio from SIP ALG & RTP Mismatches

In production ViciDial contact centers and Asterisk PBX deployments, calls routinely connect, ring, and show active in the dialer—yet agents hear nothing from the customer, or the customer hears silence from the agent. Running asterisk -rx "rtp set debug on" during an affected call immediately reveals the asymmetry: Asterisk logs continuous Sent RTP packet to lines with zero matching Got RTP packet from entries.

The verified root cause is media-path divergence between SIP signaling and UDP RTP caused by router SIP ALG (Application Layer Gateway) packet mangling, mismatched rtp.conf firewall ranges, or missing symmetric RTP directives. Because SIP signaling (port 5060) and RTP media (UDP 10000–20000) travel independent network paths, a call can establish cleanly while audio packets are silently routed to a private RFC 1918 IP or dropped by an intermediate firewall.



Problem Diagnosis & Root Cause Architecture


  • Router SIP ALG SDP Corruption: Enterprise and consumer routers with SIP ALG (often labeled SIP Helper or SIP Fixup) enabled attempt to rewrite Contact and SDP c= / m= lines in flight—frequently corrupting port mappings or double-translating addresses already handled by Asterisk.

  • rtp.conf vs. Firewall Port Range Mismatch: Asterisk allocates RTP media ports dynamically from /etc/asterisk/rtp.conf (default 10000–20000). If host iptables/nftables or cloud security groups only allow a narrower range (e.g., 10000–10500), calls assigned ports above 10500 suffer total silence.

  • Missing Symmetric RTP & Direct Media Bypass: Without rtp_symmetric=yes and direct_media=no (or nat=force_rport,comedia in legacy chan_sip), Asterisk sends outbound RTP to the unreachable private IP advertised in the remote SDP rather than the actual source IP/port of incoming RTP packets.

  • Expired NAT Pinholes on Silent Intervals: Stateful firewalls expire UDP NAT bindings after 30–120 seconds of inactivity; without qualify_frequency or rtp_keepalive, intermittent one-way audio strikes mid-call.



Always diagnose SIP signaling and RTP media independently. Confirm the SDP c= IP and media port in pjsip set logger on (or sngrep), then verify bidirectional packet flow with rtp set debug on.


Why Standard Implementations Fail

Opening Only Port 5060 in Cloud Security Groups

Allowing UDP/TCP 5060 lets calls ring and connect, but blocks the entire dynamic RTP media plane—producing 100% silent calls across every trunk.



Running pjsip reload After Editing Transport NAT Settings

In Asterisk res_pjsip, changes to [transport-udp] (such as external_media_address or local_net) without allow_reload=yes do not take effect until a full core restart now.



Ignoring Agent-Side Router SIP ALG

Even when server-side rtp.conf and NAT rules are spotless, an office or home router running SIP ALG in front of a remote agent's softphone corrupts the SDP answer and breaks return audio.



Validated Step-by-Step Resolution Playbook

Step 1: Verify Unidirectional RTP with Asterisk CLI and sngrep

Enable live RTP debugging during a test call to confirm whether Asterisk is transmitting audio without receiving return RTP packets.



# Enable RTP packet debug during a single test call (turn off immediately after)
asterisk -rx "rtp set debug on"
# Look for both "Got RTP packet from" and "Sent RTP packet to"
asterisk -rx "rtp set debug off"

# Inspect SDP c= and m= lines in live SIP signaling
sngrep -d any port 5060


Step 2: Align rtp.conf and Host Firewall UDP Ranges

Verify the exact RTP range in /etc/asterisk/rtp.conf and ensure your host firewall and cloud security group allow the full UDP range bidirectionally.



; /etc/asterisk/rtp.conf
[general]
rtpstart=10000
rtpend=20000


# Open the exact RTP UDP range in iptables / ufw
iptables -A INPUT -p udp --dport 10000:20000 -j ACCEPT
ufw allow 10000:20000/udp


Step 3: Configure Symmetric RTP and NAT Directives in PJSIP (or chan_sip)

On PJSIP endpoints and transports in /etc/asterisk/pjsip.conf, enforce direct_media=no, rtp_symmetric=yes, force_rport=yes, and rewrite_contact=yes alongside explicit external_media_address and local_net on the transport.



[transport-udp]
type=transport
protocol=udp
bind=https://www.google.com/url?q=https://www.google.com/url?q%3Dhttp://0.0.0.0:5060%26source%3Dgmail%26ust%3D1794815927131000%26sa%3DE&source=gmail&ust=1794816269706000&sa=E
local_net=https://www.google.com/url?q=https://www.google.com/url?q%3Dhttp://10.0.0.0/8%26source%3Dgmail%26ust%3D1794815927131000%26sa%3DE&source=gmail&ust=1794816269706000&sa=E
local_net=https://www.google.com/url?q=https://www.google.com/url?q%3Dhttp://192.168.0.0/16%26source%3Dgmail%26ust%3D1794815927131000%26sa%3DE&source=gmail&ust=1794816269706000&sa=E
external_media_address=203.0.113.25
external_signaling_address=203.0.113.25

[carrier-trunk]
type=endpoint
context=from-trunk
disallow=all
allow=ulaw
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
rtp_keepalive=15

For legacy ViciDial chan_sip peers in sip.conf, set externip=203.0.113.25, localnet=https://www.google.com/url?q=https://www.google.com/url?q%3Dhttp://10.0.0.0/255.0.0.0%26source%3Dgmail%26ust%3D1794815927131000%26sa%3DE&source=gmail&ust=1794816269706000&sa=E, nat=force_rport,comedia, and qualify=yes.



Step 4: Disable SIP ALG on Intermediate Routers and Firewalls

Log into any MikroTik, Cisco, SonicWall, or office gateway sitting in front of agents or trunks and disable SIP ALG / SIP Transformations so SDP headers pass untouched.



# Example: Disable SIP ALG on MikroTik RouterOS
/ip firewall service-port disable sip


Step 5: Restart Transports and Verify Bidirectional RTP

Apply transport changes with a clean Asterisk restart during a maintenance window and confirm both Got RTP packet and Sent RTP packet appear in live calls.



asterisk -rx "core restart gracefully"
asterisk -rx "pjsip show transports"
Advertisement
Engineering Advisory 48-Hour Audit Turnaround

Experiencing this issue in your production systems?

Calricon conducts senior-level VoIP, SIP trunking, Asterisk, and cloud infrastructure audits. We review your live configs, identify packet drops or contention bottlenecks, and provide exact remediation runbooks.