No voice while making external calls – NAT configuration – Asterisk 1.8.13

asteriskubuntu-12.04

As we were trying to setup our Asterisk server, we went on a huge problem: The inability to make call to or from external devices connected to the server. In fact, I can dial and answer the call on both side, but I can't hear anything.

I've browsed hours of content on the Internet, looking for tutorials on how to correctly setup the NAT with sip.conf, but without any effective results.

Here's our sip.conf

[general]
bindaddr=0.0.0.0
localnet=192.168.1.0/255.255.255.0
externhost=mydynhost.dyndns.org
externrefresh=10
nat=yes
register => username:****@montreal.voip.ms:5060
registertimeout=15
registerattempts=0

[voipms]
canreinvite=no
context=voipms
host=montreal.voip.ms
secret=****
type=peer
defaultuser=username
disallow=all
allow=ulaw
fromuser=username
trustrpid=yes
sendrpid=yes
insecure=invite
nat=yes

[1000]
type=friend
context=phones
host=dynamic
defaultuser=1000
secret=****

[1001]
type=friend
context=phones
host=dynamic
defaultuser=1001
secret=****

extensions.conf

[phones]
include => internal
include => voipms

[internal]
exten => _1XXX,1,Answer()
exten => _1XXX,n,Dial(SIP/${EXTEN})
exten => _1XXX,n,Hangup()

[voipms]
include => voipms-inbound
include => voipms-outbound

[voipms-outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@voipms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Dial(SIP/1${EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(SIP/${EXTEN}@voipms)
exten => _011.,n,Hangup()
exten => _00.,1,Dial(SIP/${EXTEN}@voipms)
exten => _00.,n,Hangup()

[voipms-inbound]
exten => somenumber,1,Answer()

In rtp.conf the following values are set:

  • rtpstart=10001
  • rtpend=20000

As you can see, we don't have a static IP address and we are using a dynamic DNS service to refresh it when it changes.

My question is simple, how can we make our current setup working with other devices not in our private network? Note that I only want to contact people using a 4 digit extension number. These extensions will allow "local" users to call themselves without using the VoIP.ms service. I'll test external calls after when the NAT will be working.

If you need more information, please just ask!
Thanks!
Dave

EDIT: Also, if it can help. I'm testing my calls with X-Lite (http://www.counterpath.com/x-lite-download.html) and my Android 4.2.2 device using the embedded SIP client available in the Phone.apk application.

Best Answer

After asking directly to the community of forums.asterisk.org, the member david55 help me out to find my solution.

Click here to access it