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

Next, configure your IAX2 softphone to register to Asterisk. If the phone successfully
               registers, you’ll see something like:

                   *CLI>     -- Registered IAX2 '1001' (UNAUTHENTICATED) at 192.168.1.104:4569

               Configuring the Dialplan
               In order to allow calling between our two Asterisk boxes over the IAX2 trunk, we need
               to configure a simple dialplan. The following dialplan will send all extensions in the
               1000 range (1000–1999) to Osaka, and all extensions in the 2000 range (2000–2999)
               to Toronto. Our example is going to assume that you have configured a pair of IAX2
               softphones, but feel free to utilize a SIP phone if you’ve already configured one (or two).
               Just be aware that you’ll need to change the Dial() application to send the call to the
               SIP phone via the SIP protocol instead of IAX2 (i.e. Dial(SIP/${EXTEN},30) instead of
               Dial(IAX2/${EXTEN},30)).
               The extensions.conf file on Toronto:

                   [globals]
                   [general]
                   autofallthrough=yes

                   [default]
                   [incoming_calls]
                   [phones]
                   include => internal
                   include => remote
                   [internal]
                   exten => _1XXX,1,NoOp()
                   exten => _1XXX,n,Dial(IAX2/${EXTEN},30)
                   exten => _1XXX,n,Playback(the-party-you-are-calling&is-curntly-unavail)
                   exten => _1XXX,n,Hangup()
                   [remote]
                   exten => _2XXX,1,NoOp()
                   exten => _2XXX,n,Dial(IAX2/toronto/${EXTEN})
                   exten => _2XXX,n,Hangup()
                   [toronto_incoming]
                   include => internal
               The extensions.conf file on Osaka:

                   [globals]
                   [general]
                   autofallthrough=yes

                   [default]


               114 | Chapter 4: Initial Configuration of Asterisk
   137   138   139   140   141   142   143   144   145   146   147