Asterisk IAX2

From open-voip.org

Jump to: navigation, search

IAX2 is Inter-Asterisk eXchange protocol, it using same port for signalong and media and solve many NAT issues. Let's build a simple IAX2 setup where user 1234 call 1235.

first save the original iax configuration file:

 cp /etc/asterisk/iax.conf /etc/asterisk/iax.conf_orig 

make your iax.conf file to:

 [general]
 disallow=all                    ; First disallow all codecs
 allow=ulaw                      ; The voice codec
 allow=gsm
 ;
 [1234]
 type=friend
 host=dynamic
 nat=yes
 context=inbound
 username=1234
 secret=1234
 requirecalltoken=no
 ;
 [1235]
 type=friend
 host=dynamic
 nat=yes
 context=inbound
 username=1235
 secret=1235
 requirecalltoken=no

Change the dial-plan to support iax dialing between extensions:

 [general]
 [globals]
 [inbound]
 exten => _X.,1,dial(IAX2/${EXTEN})
 exten => _X.,2,hangup

We will use Zoiper as the IAX2 dialer to test the setup:

 http://www.zoiper.com/downloads/free/win/Zoiper_Free_2.22_Installer.exe

configure the users 1234 and 1235 on two diffrent PCs:

File:zoiper_account_conf.GIF

verify users registrations on the asterisk cli:

 iax2 show users 
 iax2 show peers

test the setup by calling from 1234 to 1235

File:zoiper_main.GIF

debug iax by

 iax2 set debug
Personal tools