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

[incoming_calls]
                   [phones]
                   include => internal
                   include => remote
                   [internal]
                   exten => _2XXX,1,NoOp()
                   exten => _2XXX,n,Dial(IAX2/${EXTEN},30)
                   exten => _2XXX,n,Playback(the-party-you-are-calling&is-curntly-unavail)
                   exten => _2XXX,n,Hangup()
                   [remote]
                   exten => _1XXX,1,NoOp()
                   exten => _1XXX,n,Dial(IAX2/osaka/${EXTEN})
                   exten => _1XXX,n,Hangup()
                   [osaka_incoming]
                   include => internal

               Using Templates in Your Configuration Files

               There is a little-known secret in Asterisk config files that is so brilliant that we had to
               devote a little section to it.

               Let us say that you have 20 SIP phones that are all pretty much identical in terms of
               how they are configured. The documented way to create them is to specify the param-
               eters for each. Part of such a sip.conf file might look like this:
                   [1000]
                   type=friend
                   context=internal
                   host=dynamic
                   disallow=all
                   allow=ulaw
                   dtmfmode=rfc2833
                   maibox=1000
                   secret=AllYourSetsAreBelongToUs

                   [1001]
                   type=friend
                   context=internal
                   host=dynamic
                   disallow=all
                   allow=ulaw
                   dtmfmode=rfc2833
                   maibox=1001
                   secret=AllYourSetsAreBelongToUs

                   [1002]
                   type=friend
                   context=internal
                   host=dynamic


                                                         Using Templates in Your Configuration Files | 115
   138   139   140   141   142   143   144   145   146   147   148