SIP ALG stands for Application Layer Gateway and is common in all many commercial routers. Its purpose is to prevent some of the problems caused by router firewalls by inspecting VoIP traffic (packets) and if necessary modifying it.
Many routers have SIP ALG turned on by default.
There are various solutions for SIP clients behind NAT, some of them in the client side (STUN, TURN, ICE), others are in the server side (Proxy RTP as RtpProxy, MediaProxy).
Generally speaking, ALG works typically in the client side LAN router or gateway. In some scenarios, some client-side solutions are not valid, for example, STUN with symmetrical NAT router. If the SIP proxy doesn't provide a server-side NAT solution, then an ALG solution could have a place.
An ALG understands the protocol used by the specific applications that it supports (in this case SIP) and does a protocol packet-inspection of traffic through it. A NAT router with a built-in SIP ALG can re-write information within the SIP messages (SIP headers and SDP body) making signalling and audio traffic between the client behind NAT and the SIP endpoint possible.
Even though SIP ALG is intended to assist users who have phones on private IP addresses (Class C 192.168.X.X), in many cases it is implemented poorly and actually causes more problems than it solves. SIP ALG modifies SIP packets in unexpected ways, corrupting them and making them unreadable. This can give you unexpected behaviour, such as phones not registering and incoming calls failing.
Therefore if you are experiencing problems we recommend that you check your router settings and turn SIP ALG off if it is enabled.
If you are still having problems after disabling SIP ALG, please check your firewall configuration.
Most home/residential routers have a web interface. Typically this is 192.168.1.1 but you just check your default gateway by typing ipconfig in Windows command prompt or ifconfig on Linux systems from any connected device on the same LAN.
If your router does not have a web interface you will most likely need a Telnet client to login.
If you don't have a telnet client installed we recommend Smartty (smartty.sysprogs.com)
Connect in telnet to the IPv4 address of your gateway and hit enter again.
Disable the option SIP Pass through under Advanced Settings / WAN -> NAT Pass through.
If your router doesn't have this option SIP ALG may be disabled via Telnet.
nvram get nf_sip
(It should return a "1")
nvram set nf_sip=0
nvram commit
Reboot
SIP ALG cannot be disabled. (See above on how to get around this)
Go to Firewall > Firewall Rules > Custom FirewallAccess Rules
Click the "Disabled" check box next to any rules named LAN-2-INTERNET-SIP and INTERNET-2-LAN-SIP
This disables SIP ALG.
Navigate to the web interface
-> Select Configuration
-> Select NAT
-> Select ALG
-> Disable SIP ALG
(Homehubs)SIP ALG cannot be disabled in the settings of BT HomeHubs but can be disabled with BT Business Hub versions 3 and higher.
-> Go to System Summary and ensure that the firmware is up to date (1.1.1.06 or later).
-> f needed, update firmware by going to System Management > Firmware Upgrade.
-> Go to Firewall > General.
-> Ensure that Firewall and Remote Management are enabled (checked).
-> Ensure that the following are disabled (unchecked):
-> SPI (Stateful Packet Inspection)
-> DoS (Denial of Service)
-> Block WAN Request
-> SIP ALG
-> Click Save.
-> Browse to IPADDRESS/f_general_hidden.htm.
-> Set UDP Timeout to 300 seconds.
-> Go to Firewall > Access Rules.
-> Whitelist VoiceHost IP ranges
Save all changes.
In 'Advanced' settings --> 'Application Level Gateway (ALG) Configuration' un-tick the 'SIP' option.
No ALG function available - Consider using a public STUN server
DrayTek Vigor 2760 devices, the option can be found in the regular interface at Network -> NAT -> ALG.
If your device does not have a web interface then you'll need a telnet client.
You will be prompted to provide a username and/or password. These are the same credentials used to access the router's web interface.
Afterwards, type in these commands:
sys sip_alg 0
sys commit
On Draytek Vigor2750 and Vigor2130 please use these commands instead:
kmodule_ctl nf_nat_sip disable
kmodule_ctl nf_conntrack_sip disable
Huawei E5330
Navigate to the web interface
Click Settings.
Enter the required username and password, then click Log In.
Note: The default username and password is admin.
Click the Security dropdown.
Click SIP ALG Settings.
Untick the Enable SIP ALG box.
Click Apply.
Fortigate:
Disabling the SIP ALG in a VoIP profile
SIP is enabled by default in a VoIP profile. If you are just using the VoIP profile for SCCP you can use the following command to disable SIP in the VoIP profile.
config voip profile
edit VoIP_Pro_2
config sip
set status disable
end
The SIP ALG setting is usually found in the Security menu.
Type the following into the CLI
To check if currently enabled or disabled run show security alg status | match sip
To disable run:
configure
set security alg sip disable
commit
Check for a SIP ALG option in the Administration tab under 'Advanced'.
You should also disable the SPI Firewall option.
Disable SIP Helper.
Look for a 'SIP ALG' checkbox in 'WAN' settings.
Under 'NAT Filtering' uncheck the option 'SIP ALG'
Port Scan and DoS Protection should also be disabled.
Disable STUN in VoIP phone's settings.
No ALG feature - Consider using a public STUN server
To disable SIP ALG you need to telnet into your Speed touch router and type the following:
-> connection unbind application=SIP port=5060
-> saveall
2017/18 See Huawei (HG633)
Open Command Prompt – “Start” → “Run” → type “cmd” and press “Enter”.
In Command Prompt, type “telnet 192.168.1.254” and press enter. 192.168.1.254 is the default IP address of the router. If you are running on Windows 7/8/8.1/10, you might need to install the telnet client from “Control Panel” → “Programs and Features” → “Turn Windows features on and off”.
The default username is “Administrator”, and there is no default password, leave blank.
Type “connection unbind application=SIP port=5060” and press “Enter”.
Type “ saveall ” and press “Enter”.
Type “exit” and press “Enter” to exit the telnet session.
Depending on the version of Tomato, SIP ALG can be found under Advanced then Conntrack / Netfilter in the Tracking/NAT Helpers section. If you find SIP checked then SIP ALG is enabled. Uncheck it to disable it.
Navigate to your routers web interface.
The default username is admin and the default password is admin.
On the left, click on Advanced Setup and then click on NAT and then click on ALG.
Uncheck the box by SIP Enabled. (Some TP firmware shows this as SIP Transformations which is the same thing).
Click Save/Apply.
Go to Advanced > Options.
Disable (uncheck) SIP.
Disable (uncheck) RTSP.
Click Apply.
Use the configuration tree if supported: system -> conntrack -> modules -> sip -> disable
Alternatively, you can SSH into the device and run the following commands:
configure
set system conntrack modules sip disable
commit
save
exit
SIP ALG cannot be disabled in the settings of SuperHubs.
Please see our workarounds at the top of the page.
2018 Onwards - See Huawei (HHG2500)
Type the following into the CLI
configure
set system conntrack modules sip disable
commit
save
exit
Under Network or Advanced -> ALG un-tick the options Enable SIP ALG and Enable SIP Transformations.
Telnet commands must be used to disable SIP ALG with some other Zyxel routers.