Page 135 - Asterisk™: The Future of Telephony
P. 135

Configuring the Channel Configuration File (iax.conf)
               Like the rest of this chapter, we’re attempting to get you up and running quickly with
               the smallest configuration file set possible in order to minimize the problems you may
               have in configuring your devices. Just like the sip.conf file, iax.conf requires only a few
               simple lines to get our IAX phone registered to Asterisk. Let’s take a look:
                   [general]
                   autokill=yes
                   [idefisk]
                   type=friend
                   host=dynamic
                   context=phones
               Yes, really, that’s all you need to get your softphone up and running. It’s not the most
               secure or feature-rich configuration (we’re not even using a password), but this will
               work.

               In the [general] section of our iax.conf file, we have a single option: autokill= yes. We
               use this option to avoid things from stalling when a peer does not ACK (reply) to our
               NEW packet (new call setup request) within 2000 milliseconds. Instead of the reply to
               value yes, you can set this to the number of milliseconds to wait for the ACK to our
               NEW packet. You can control the autokill option for each individual peer by defining
               qualify for those peers that you know may be on poor network connections.
               The rest of the file contains the definition for our softphone. We define the type as
               friend, which tells Asterisk we will send calls to this device and also accept calls from
               this device. A friend is a shortcut for defining a separate peer (send calls to the soft-
               phone),  and  user  (accept  calls  from  the  softphone).  We  could  also  have  defined
               individual definitions for the peer and user like so:
                   [idefisk]
                   type=user
                   context=phones

                   [idefisk]
                   type=peer
                   host=dynamic
               Once you’ve configured your iax.conf file, save the file and reload the IAX2 channel
               module from your Asterisk console with module reload chan_iax2.so. Confirm your
               new peer exists by running iax2 show peers.
                   localhost*CLI> iax2 show peers
                   Name/Username    Host                 Mask             Port          Status
                   idefisk          (Unspecified)   (D)  255.255.255.255  0             Unmonitored
                   1 iax2 peers [0 online, 0 offline, 1 unmonitored]







                                                                 Configuring an IAX Softphone | 107
   130   131   132   133   134   135   136   137   138   139   140