Issue in receiving audio from clients behind NAT


We have asterisk behind NAT and our client is on another external network behind NAT.
We are able to make calls but audio is distorted and robotic voice.

Internal within network, audio quality is good.
issue is coming only when we try to make call from external network.

Codec we are using: ilbc
Client : X-lite

Is their some configuration required in asterisk to solve this issue?
Also, please let us know the best codec to use in our scenario.

Scenario :

Client APP: Xlite
WAN Router : Cisco with Public IP
Firewall: Cisco

End User: Within the Network and Outside the Network (Any Ver in the world).

Out Side Network (External User) -> Cisco Router with PUblic IP -> Firewall -> Asterisk Server - > LAN -> Internal Client.

We are waiting for experts suggestion on our scenario. Thanks in Advance.


A quick google search gives you all the info you need: … erisk.html … +solutions

But to further support your lazyness, let me give you a short recap:

  1. Open SIP and RTP UDP ports on your firewall for the Asterisk server
  2. Set parameters externip, nat and localnet in your sip.conf

After you set this, you will see private/public address change in the SIP headers of messages that Asterisk is sending to clients that are on the internet. Be carefull to enable NAT only for the SIP clients that are NOT on your LAN.

And if you will have your Asterisk server accessible on the internet, be sure to look in the security enhancing techniques of Asterisk/Linux servers, oterwise there is a big chance your Asterisk box can get hacked. You have tons of this in the forum :wink:

If you are getting two way audio, however distorted, you do not have a NAT problem, but rather a general network quality problem (or you are trying to run Asterisk on a VM whose host is not very lightly loaded).

ILBC is a terrible codec–that’s why it sounds so bad. How much bandwidth on the WAN do you have available and how many simultaneous calls are you expecting?