SIP ALG: What It Is, Why It Breaks VoIP Calls, and How to Disable It
SIP ALG (Session Initiation Protocol Application Layer Gateway) is a router or firewall feature that inspects SIP packets and rewrites IP addresses and ports inside them so that VoIP can work through NAT. In practice it is one of the most common causes of one-way audio, phones that will not register, and calls that drop after about 30 seconds. For most modern VoIP setups the right answer is to disable it.
What SIP ALG is supposed to do
SIP carries IP addresses and ports inside its own messages, in the Via, Contact, and SDP c= and m= lines. When a phone behind NAT sends these, they contain private addresses (for example 192.168.1.50) that the outside world cannot reach.
A SIP ALG tries to help. It watches SIP traffic passing through the router and rewrites those private addresses to the router's public address and opens the matching media ports. In theory this makes NAT transparent to VoIP.
Why SIP ALG breaks calls
The idea is sound, but implementations vary widely and many are buggy. Common failure modes:
- Wrong or partial rewriting. Headers or SDP are changed inconsistently, so the far end sends media or signaling to an unreachable address.
- Conflict with modern clients and servers. Phones and PBXs now handle NAT themselves using
rport, keep-alives, STUN, or ICE. An ALG that also rewrites packets can corrupt what they already fixed. - Broken timers and registrations. Bad handling of
Expiresor connection tracking causes registrations to drop and inbound calls to stop ringing. - No help with encryption. An ALG cannot rewrite SIP carried over TLS, and it cannot touch SRTP media, so it only adds risk to the part it can see.
Symptoms that point to SIP ALG
| Symptom | Likely mechanism |
|---|---|
| One-way audio or no audio | SDP or media ports rewritten incorrectly |
| Calls drop at ~30 seconds | ACK or in-dialog requests sent to a wrong address after Contact rewrite |
| Phones show registered, but inbound calls never ring | Stale or wrong NAT binding for the Contact |
| Registration fails intermittently | ALG mishandles Expires or retransmissions |
| Works on mobile data, fails on office Wi-Fi | The office router's ALG is interfering |
How to confirm SIP ALG is the problem
Do not guess. Compare what the phone sent with what the provider received.
- Capture at the phone or PBX side. Run
tcpdump -n -i any -w sip-local.pcap port 5060(or capture on the LAN interface), then place a call. - Capture at the provider or server side if you control it, or ask your provider for a trace.
- Open both in Wireshark and compare the
Via,Contact, and SDPc=lines of the same INVITE.
If the addresses and ports in the packet that arrived differ from the ones the phone sent, in a way your own NAT handling did not intend, something in the path is rewriting SIP. An ALG on the router is the usual cause.
A quick test: move SIP signaling to a non-standard port, or switch to SIP over TLS. ALGs usually key on port 5060, and they cannot inspect TLS. If problems disappear, suspect the ALG.
How to disable SIP ALG
Exact steps depend on the device and firmware, so always check the vendor documentation for your model. The setting is usually called one of these:
- SIP ALG
- SIP passthrough
- SIP helper
- SIP transformations or SIP inspection
Consumer and small-office routers. Log in to the admin page (commonly 192.168.1.1 or 192.168.0.1) and look under WAN, NAT, Advanced, or Firewall settings for the options above, then disable and save. Reboot the router if the setting does not take effect.
Firewalls and routers with a command line (examples).
# MikroTik RouterOS
/ip firewall service-port set sip disabled=yes
# Ubiquiti EdgeOS
set system conntrack modules sip disable
# Juniper SRX
set security alg sip disable
# Cisco ASA
policy-map global_policy
class inspection_default
no inspect sip
Linux routers. The kernel's SIP connection-tracking helper is nf_conntrack_sip. Make sure it is not loaded and that automatic helper assignment is off.
Other vendors. Fortinet, SonicWall, Palo Alto, and others expose this as a SIP helper, SIP transformations, or an ALG toggle in their firewall or VoIP settings. Vendor knowledge-base articles cover model-specific steps. SignalWire's FreeSWITCH documentation also has a page on ALG behavior.
If the device has no option to disable it, place the phones or PBX behind a router that does, or put the ISP device in bridge mode.
Better than disabling: make NAT handling explicit
Disabling the ALG removes the interference. For reliable VoIP, also make NAT handling deliberate:
- Use
rportand symmetric responses (RFC 3581) so replies return to the real source port. - Send keep-alives (SIP OPTIONS or CRLF) to hold NAT bindings open.
- Use TLS for signaling and SRTP for media where supported. This also protects calls from eavesdropping and makes ALG interference impossible.
- Use STUN or ICE on clients that support them. See NAT traversal with STUN, TURN and ICE.
- Anchor media on the server side with a media proxy such as rtpengine so endpoints only need to reach one public address.
Server-side settings that help
On FreeSWITCH, NAT-related options in the SIP profile (such as ext-rtp-ip, ext-sip-ip, and aggressive NAT detection) control which addresses are advertised. On Kamailio, the nathelper module and rtpengine handle NAT detection and media anchoring. See Kamailio load balancing and open-source SBC with Kamailio and rtpengine.
When SIP ALG is actually fine
Almost never, for modern deployments. The rare exceptions are old, unmanaged endpoints that cannot do any NAT handling themselves on a simple network. Even then, a controlled alternative such as a session border controller or a SIP-aware proxy is more predictable than a router feature you cannot inspect. See what a session border controller does.
Frequently asked questions
Should SIP ALG be on or off?
Off, in nearly all cases. Modern phones, PBXs, and cloud voice providers handle NAT themselves, and an active ALG usually causes more problems than it solves.
Will disabling SIP ALG break anything else?
It does not affect web traffic or normal applications. It only stops the router from rewriting SIP. If a very old endpoint relied on it, you may need to configure NAT settings on that device instead.
Why do I still get one-way audio after disabling it?
Other causes include blocked RTP ports, double NAT, wrong external IP settings on the PBX, or codec mismatches. See VoIP latency, jitter and quality troubleshooting and SIP response codes and troubleshooting.
Does SIP over TLS avoid SIP ALG problems?
Largely yes, because the ALG cannot read encrypted SIP. You still need correct NAT handling for the media, which is why SRTP plus a media proxy is the most robust setup.
References
- RFC 3581: Symmetric Response Routing (rport)
- RFC 4787: NAT Behavioral Requirements for Unicast UDP
- RFC 8445: Interactive Connectivity Establishment (ICE)
- SignalWire FreeSWITCH documentation: ALG
Chasing intermittent one-way audio or registration problems? Our custom VoIP development and troubleshooting team diagnoses NAT and SIP issues with packet-level evidence.
Related Services
Keep Reading
Discussion
0Join the conversation
Sign in with your preferred account to comment, reply, and keep the discussion useful for other engineers.
Takes a few seconds. No separate password required.
Controva LLC
Engineering Team
We build digital empires that scale. Specializing in high-performance web architecture, AI automation, and headless commerce.
Work with us