If like me, you've spent months on IT Support, trying to find out why a perfectly installed FreePBX/Asterisk system just will not work with an external SIP extension, then I really feel for you!
Asterisk is great "When It Works", but when it doesn't, You probably end up with many headaches and increased stress levels.
Well, today - FINALLY - I've fixed the issue with no sound on external sip calls and am going to reveal just how I did it.
No sound with SIP | No Sound With Asterisk| No Sound With NAT
To correctly troubleshoot your issue, make sure that the following steps are taken.
On your router, open up the following ports and forward them to your asterisk box. Your asterisk box may be in the form of (FreePBX, AsteriskNOW, or TrixBox)- They all use the same format
Once these ports have been forwarded to the IP of your Asterisk server, give your router a reboot. Re-Login to your router just to reconfirm that the posts are in fact pointing to the correct IP of the Asterisk Server.
The next step is to ensure that you configure your NAT settings on the Asterisk server correctly. The following image shows how best to set up your settings.
If you're behind a router with a Static IP but your internal network (including Asterisk) is on a 192.168.x.x network, these settings apply to you. If not, simply change these to work with your network setup.
Another important tip for troubleshooting your sound issue is to make sure that you enable the codecs that you will be using. If you're using a soft-phone for example, make sure it supports calling with your enabled codecs. If not - Make sure you enable them in Asterisk. If they're not listed, try a different soft-phone but generally, you should be okay.
All the other configuration options are not external to Asterisk. This is where I went wrong. I tried tweaking and changing asterisk settings for months to no avail.
If you have No Audio - It's to do with your ROUTER or FIREWALL. If you've configured the ports as I've shown above, there are only a few things left to check.
1. Internal firewall. If you're using a soft-phone on a machine, make sure the firewall is disabled for testing. If it works, you need to open up the same ports on the machine as you did in the router.
2. Router. Many of today's commercial routers implement SIP ALG (Application-level gateway), coming with this feature enabled by default. While ALG could help in solving NAT related problems, the fact is that many routers' ALG implementations are wrong and break SIP.
THIS WAS WHAT WAS WRONG WITH MY SETUP Everything on my router was in fact correct. I had never heard of ALG before, mainly because there was no mention of it on my routers administrator panel anywhere. Even though ALG was not mentioned on my router page, it's still there and active, just not visible on the front end.
I had to telnet into my router and login and then issue a command to turn ALG off.
List of routers with SIP ALG enabled
The following is a list containing SIP ALG router models, their issues, and how to disable SIP ALG (enabled by default in most of the cases). Please add more data to this list if you have experimented problems due to a SIP ALG router.
Models: ST530 v6(firmware >= 22.214.171.124) comes with SIP ALG enabled by default. NAT type: symmetrical Issues:
No incoming calls.
It replaces the private IP appearing in SIP headers with the public IP using a dumb text replacement. If for example, the private IP appears in the "Call-ID" it replaces it too (that it's completely unnecessary).
The ALG replaces the private address in the "Call-ID" header (not needed at all). Some phones (as Linksys with the latest firmware) encode the "Call-ID" value in the "Refer-To" header (by escaping the dots) so the private IP appearing there is not replaced with the public IP. This causes that the call transfer fails since the proxy/PBX/endpoint will not recognise the dialog info.
To disable SIP ALG: ToDo no ALG related options found via web and telnet. No idea of how to disable it. To disable SIP ALG on WRT610N: Web Interface: Administration, Management, under heading 'Advanced Features' SIP ALG, can be disabled.
Models: 800 comes with SIP ALG enabled by default. To disable SIP ALG:
~# telnet firewall config system settings set sip-helper disable set sip-nat-trace disable endconfig system session-helperdelete 12 end