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

disallow=all
                   allow=ulaw
                   dtmfmode=rfc2833
                   maibox=1002
                   secret=AllYourSetsAreBelongToUs
               Seems like a lot of extra typing, cutting, and pasting, yes? And what if you decide that
               you are going to change the context for your sets to another name. Not looking good,
               is it?
               Enter the template. Let’s create the same SIP friends as we did above, only this time
               using the template construct:

                   [sets](!) ; <== note the exclamation point in parenthesis. That makes this a template.
                   type=friend
                   context=internal
                   host=dynamic
                   disallow=all
                   allow=ulaw
                   dtmfmode=rfc2833
                   secret=AllYourSetsAreBelongToUs
                   [1000](sets) ; <== note the template name in parenthesis. All of that templates
                                ; settings will be inhereted.
                   maibox=1000
                   [1001](sets)
                   maibox=1001

                   [1002](sets)
                   maibox=1002
               This is one of the best kept secrets of conf file creation. In our experience, very few
               people use this, but for no other reason than that they don’t know about it. Well, that’s
               about to change. Our goal is to see everyone using these from now on; and yes, we will
               be checking.

               Debugging

               Several methods of debugging are available in Asterisk. Once you’ve connected to the
               console, you can enable different levels of verbosity and debugging output, as well as
               protocol packet tracing. We’ll take a look at the various options in this section.

               Connecting to the Console

               To connect to the Asterisk console, you can either start the server in the console directly
               (in which case you will not be able to exit out of the console without killing the Asterisk
               process), or start Asterisk as a daemon and then connect to a remote console.
               To start the Asterisk process directly in the console, use the console flag:




               116 | Chapter 4: Initial Configuration of Asterisk
   139   140   141   142   143   144   145   146   147   148   149