SIP ALG (Application Layer Gateway)
A SIP ALG is a router feature that rewrites SIP packets to help them cross NAT. In practice it often corrupts messages and breaks calls, so most PBX vendors advise turning it off.
Published 8 November 2026 · 1 min read · By SpaGreen Creative
Short answer
A SIP ALG (Application Layer Gateway) is a router or firewall function that inspects SIP packets and rewrites the addresses inside them to assist NAT traversal, often incorrectly.
Because SIP carries IP addresses inside its messages, router manufacturers added a feature meant to help: a SIP Application Layer Gateway. The ALG watches for SIP traffic on port 5060, parses each packet, and replaces the private addresses in Via, Contact and SDP with the router's public address. RFC 3027 discusses this class of mechanism and its difficulties.
In theory this lets SIP work behind NAT with no client configuration. In practice ALG implementations are frequently buggy. They rewrite fields they should not, mangle authentication headers so that passwords no longer verify, miss packets on non-standard ports while altering others, and cannot touch TLS traffic at all while still interfering with the RTP that goes with it. The resulting problems look random: registrations that drop every few minutes, calls that ring but fail on answer, one-way audio that depends on who called whom.
Most PBX vendors, including the Asterisk project and the distributions built on it, recommend disabling SIP ALG on the router. Proper NAT traversal is better handled by the client with STUN and ICE and by the server with its own NAT settings. The option is usually under the firewall, NAT or advanced section of the router's admin interface, sometimes labelled "SIP helper" or "SIP passthrough".
Sources and further reading
- RFC 3261: SIP: Session Initiation Protocolwww.rfc-editor.org
- RFC 3027: Protocol Complications with the IP Network Address Translatorwww.rfc-editor.org
This article is published by SpaGreen Creative, the maker of SIPdia. Product names mentioned belong to their owners. Where it describes other software, treat the steps as general guidance and check the official documentation linked above.
