Upgrade 3CX to v18 and get it hosted free!

Asterisk Config Examples

Author image

The configuration file “extensions.conf” contains the “dial plan” of Asterisk, the master plan of control or execution flow for all of its operations. It controls how incoming and outgoing calls are handled and routed. This is where you configure the behavior of all connections through your PBX.

The content of “extensions.conf” is organized in sections, which can be either for static settings and definitions, or for executable dialplan components in which case they are referred to as contexts. The settings sections are general and globals and the names of contexts are entirely defined by the system administrator. A special type of contexts are macros, label by a userdefined name prefixed with macro-. These are reusable execution patterns, alike procedures in a programming language. Every section in extensions.conf starts with the name of the sections contained within square brackets. This gives the extensions.conf file a similar structure to the traditional .ini file format of the Windows world.

Tip: With the help of vim syntax highlighting you can ease your dialplan work considerably, and – most importantly – make it less error prone to typos.

Asterisk Dialplan Planning – General discussion about organizing a dialplan

New in Asterisk v1.2: By default, there is a new option called “autofallthrough” in extensions.conf that is set to yes. Asterisk 1.0 (and earlier) behavior was to wait for an extension to be dialed after there were no more extensions to execute. “autofallthrough” changes this behavior so that the call will immediately be terminated with BUSY, CONGESTION, or HANGUP based on Asterisk’s best guess. If you are writing an extension for IVR, you must use the WaitExten application if “autofallthrough” is set to yes.

general

At the top of your extensions.conf file, you configure a few general settings in the section headed general. For details, see:
Dialplan General Settings

globals

Next, in the globals section, you may define global variables (or constants) and their initial values. For details, see:
Dialplan Global Variables
Using Variables in Asterisk Dialplans

Contexts and Extensions

After the general and globals categories, the remainder of the extensions.conf file is taken up by the definition of the Dialplan. The Dialplan consists of a collection of contexts. Each context consists of a collection of extensions. For an introduction to these topics, see:
Introducing Contexts and Extensions

Extension Patterns

When you define the extensions within a context, you may not only use literal numbers, not only alphanumeric names, but also you may define extensions that match whole sets of dialed numbers by using extension patterns. For more information about this, see:
Extension Names and Patterns


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.