Howto configure Asterisk NAT on AWS EC2 Instance

Howto configure Asterisk NAT on AWS EC2 Instance

asterisk

On EC2 Instance Amazon, when we install asterisk, we maybe get the problem with audio on that. So we have to configure NAT setting to fix that.

Step 1: Find the EC2 Public IP in your asterisk server.

You can go to Amazon web interface and go to EC2 instance and see that.

Example: your IP address is 54.43.57.45

Step 2: Configura nat setting on Asterisk

$ vi /etc/asterisk/sip.conf
#add the two lines in your sip.conf
localnet=10.0.0.0/255.0.0.0
localnet=192.168.0.0/255.255.0.0
externip=54.43.57.45
Step 3: Configure nat on Users/Extensions on your Asterisk (sip.conf or users.conf)
[user01]
secret=fdjf93fsf
alwaysauthreject=yes
disallow=all
;allow=g722
;allow=g729
allow=ulaw
;allow=alaw
type=friend
nat=yes
Step 4:  Restart or reload asterisk after changing the configuration
/etc/init.d/asterisk restart

Step 5: You can use ngrep and sniffer sip package

ngrep -qt -W byline port 5060

 

Thanks for using IThelpblog.com.

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>