SIP Behind NAT and Firewalls: Fixing One-Way Audio, Dropped Registrations and SIP ALG
Why VoIP breaks behind NAT and firewalls, and how to fix one-way audio, dropped registrations and SIP ALG problems on enterprise networks.
Most VoIP problems that get blamed on the carrier start much closer to the desk: in the router, the firewall or the NAT device sitting between the phone system and the internet. One-way audio, calls that drop at exactly 30 seconds and phones that silently stop receiving calls are classic symptoms of SIP and NAT disagreeing. This article explains why that happens and how to configure the edge so IP telephony behaves predictably.
Why SIP and NAT don’t get along
SIP was designed with the assumption that endpoints have reachable addresses. A phone or PBX writes its own IP address and port into the SIP message body (SDP) to tell the other side where to send audio. Behind NAT, that address is private, something like 192.168.1.20, and meaningless on the public internet.
The result is predictable. Signaling often works, because the device opened the connection outbound and the NAT tracks it. Media fails, because the remote side tries to send RTP to an address it cannot reach. That is the textbook origin of one-way or no audio.
A second issue is state. NAT devices and firewalls keep a table of active flows and expire idle UDP entries, sometimes after only 30 to 60 seconds. If a phone registers and then stays quiet, the mapping disappears and inbound calls no longer find their way back.
The usual suspects
SIP ALG. Many routers ship with a SIP Application Layer Gateway enabled by default. In theory it rewrites private addresses in SIP packets. In practice it frequently rewrites them incorrectly, breaks TLS-encrypted signaling it cannot read, or mangles headers. When troubleshooting, disabling SIP ALG is usually the first step.
Short UDP timeouts. If inbound calls fail intermittently while outbound calls work, check the firewall’s UDP session timeout and the registration interval of the phones or PBX. The registration refresh or keepalive needs to happen more often than the NAT entry expires.
Asymmetric routing and dual WAN. With two internet links, signaling can leave through one link and media through the other, or responses can return on a different path than the request. The carrier then sees traffic from an IP address it does not associate with your trunk.
Hard-coded media ports. RTP uses a range of UDP ports negotiated per call. If the firewall only allows a narrow range, or the PBX and firewall disagree on that range, some calls work and others do not.
Edge configuration that holds up
- Disable SIP ALG unless you have a specific, tested reason to keep it.
- Restrict SIP and RTP traffic to the signaling and media IP ranges your provider publishes, instead of opening ports to the whole internet.
- Align the RTP port range on the PBX with the firewall rule, and document it.
- Use keepalives: SIP OPTIONS or CRLF pings at an interval shorter than the NAT timeout.
- Configure the PBX with its public address or use symmetric response routing (rport), so replies go back to where packets actually came from.
- Consider SIP over TLS with SRTP. Encryption protects the call and also stops middleboxes from rewriting what they should not touch.
- For dual WAN, pin voice traffic to one link with a defined failover policy rather than load balancing per packet.
Where a session border controller belongs
For larger deployments, a session border controller (SBC) is the cleaner answer. It sits at the network edge, terminates SIP on both sides, handles address translation correctly, anchors media, enforces security policy and normalizes the differences between internal equipment and the carrier. Instead of every phone negotiating with the internet, one well-configured device does it. For smaller sites, a hosted PBX achieves a similar effect by moving the NAT problem to infrastructure designed for it.
Where Ring fits
Ring is a SUTEL-licensed carrier (resolution RCS-251-2019) operating a 100% IP network under ASN AS274239, with POPs in San José and Virginia and direct SNT interconnection. Our SIP trunks at sip.cr work with customer PBXs and SBCs and include +506 4600-XXXX numbering and numbers in 70+ countries. If you prefer not to manage the edge at all, Ping virtual PBX at ping.cr keeps the phone system in the network. Either way, our 24/7 support team can help you read the traces and find where the audio is getting lost.