VOS3000 SIP ALG and NAT problems
When phones or gateways sit behind a router, two things go wrong: the router changes SIP it should not touch, and it forgets connections VOS3000 still needs.
Updated · By the VOS3000 Web team
Quick answer: SIP ALG on a router rewrites or drops SIP packets and is the usual cause of one-way audio, lost registrations and 408s behind NAT. Turn it off, keep the NAT binding open with short registrations or VOS3000's NAT keep messages, and let media proxy relay RTP for devices behind NAT.
- First fix
- Disable SIP ALG on the router
- NAT keep
- SS_SIP_NAT_KEEP_ALIVE_PERIOD, 30 s
- Fallback
- Media proxy (SS_MEDIA_PROXY_BEHIND_NAT)
- Proof
- Private IP in Contact or SDP c=
The symptoms
- One-way or no audio: the call connects, but RTP goes to a private address that cannot be reached.
- Registrations drop: a phone shows as registered, then disappears from Online phone, or inbound calls to it fail.
- 408 Request Timeout or ConnectionTimeout (-41): VOS3000 sends a request and the reply never gets through the router.
Step 1: prove it with a capture
Capture the call on the VOS3000 server (see debug trace and SIP capture) and read the INVITE or REGISTER from the device behind NAT:
| Look at | Sign of a NAT problem |
|---|---|
| Contact | A private address such as 192.168.x.x, 10.x.x.x or 172.16–31.x.x, while the packet came from a public IP. |
| SDP c= | A private address: VOS3000 or the far end will send RTP there and it is lost. |
| Via | An address or port that does not match where the packet really came from. |
If you can, capture on the device too. When the same message leaves the device with one set of addresses and arrives at VOS3000 with another you did not set up, SIP ALG is rewriting it.
Step 2: turn off SIP ALG
SIP ALG tries to fix NAT by rewriting the addresses in SIP and SDP. It often rewrites only some headers, breaks on non-standard ports, or drops packets it does not understand. Turn it off on every router and firewall between the device and VOS3000:
| Device | Command or setting |
|---|---|
| Cisco IOS | no ip nat service sip udp port 5060 |
| Juniper SRX | set security alg sip disable |
| MikroTik | /ip firewall service-port disable sip |
| Home and office routers | Look for "SIP ALG", "SIP helper" or "SIP passthrough" in the web page and turn it off; reboot if needed. |
Step 3: keep the NAT binding open
A router forgets a UDP mapping after a period of silence. Keep traffic flowing:
- Shorter registrations: VOS3000 has
SS_ENDPOINT_NAT_EXPIRE(300 seconds by default, 60 to 86400) next toSS_ENDPOINT_EXPIRE(3600 seconds), the terminal registration expiry times. - NAT keep messages: for devices that cannot refresh with REGISTER, VOS3000 sends a small UDP message.
SS_SIP_NAT_KEEP_ALIVE_MESSAGEsets the content (HELLO by default; empty sends nothing) andSS_SIP_NAT_KEEP_ALIVE_PERIODthe period, 30 seconds by default.
Both are softswitch parameters, set in the system parameters.
Step 4: let VOS3000 answer where the packet came from
In a gateway's Additional settings > Protocol > SIP, Reply address and Request address set to Socket (the manual's recommendation) make VOS3000 send SIP back to the IP and port the packet came from, not to the private address in Via or Contact. Nat media sdp ip first makes VOS3000 prefer the SDP address for returning RTP, so leave it off for devices whose SDP holds a private IP.
Step 5: media proxy as the fallback
If audio still fails, let VOS3000 relay the RTP. With SS_MEDIA_PROXY_MODE on Auto and SS_MEDIA_PROXY_BEHIND_NAT on (both defaults), VOS3000 relays audio for registered terminals behind NAT. For a single gateway, set its Media proxy to On. Open the RTP ports (10000 to 39999 by default) on your firewall. See media proxy and one-way audio.
Questions about this topic
What is SIP ALG?
A router feature that rewrites the IP addresses inside SIP messages as they pass through NAT. Many routers do it badly, so VoIP providers usually ask for it to be turned off.
Why do phones behind NAT stop receiving calls after a few minutes?
The router forgets the NAT binding when no packets pass, so VOS3000 can no longer reach the phone. Shorter registrations or NAT keep messages keep the binding open.
Does media proxy fix one-way audio behind NAT?
Usually. With media proxy, VOS3000 relays RTP and sends it back to the address the audio really comes from, not the private IP in the SDP.
How do I know SIP ALG is on?
Capture the same call on both sides of the router. If the Contact, Via or SDP lines change in a way you did not configure, something in between is rewriting SIP.
Run VOS3000 without the server work
Pick a VOS3000 server hosted by us, or have us install VOS3000 on your own server. VOS3000 Web and the Android app come with it.
Keep reading
One-way or no audio
Why audio fails on some calls and how to fix it with media proxy and codecs.
Media proxy
What On, Off, Auto and Must on do, how Auto decides, and what it costs in bandwidth.
SIP registration failed
Get SIP phones registered: credentials, SIP port, firewall and lock checks.
Debug trace and SIP capture
Trace call signalling in the desktop client, read Call analysis, or capture SIP with tcpdump and sngrep.