Asterisk Dialplans

A dialplan sets the running configuration for Asterisk's general responses to telephony events given current interfaces. This dialplan is stored in file /etc/asterisk/extensions.conf (default location).

It's useful to comment extensions.conf carefully since it does a lot. Comment delimiters in this file are preceded by a semi-colon ';' character like so:

  ; this is a comment
    this is some non-comment ; but after semi-colon, it's all comment

According to Asterisk documentation, a dialplan consists of one or more extension contexts that handle various events inside a general dialplan. Each extension context is, in turn, made up of one (or, generally, more) extensions that handle sequencing and control of an extension context.

Each extension context must have a unique name. Extension contexts are noted in extensions.conf file in following syntax:

  [mycontext]

Note that brackets '[]' are mandatory around extension context name.
Between extension context delimiters, there are either comments or extension data that is assigned by (seemingly) two different by equal operators: equal sign '=' and sort of indirection/assignment operator '=>'; I prefer to use '=>' style operator like this:

[somecontext]
  ignorepat => 9