System information

CHAPTER 6
Dialplan Basics
Everything should be made as simple as possible,
but not simpler.
—Albert Einstein
The dialplan is the heart of your Asterisk system. It defines how calls flow into and out
of the system. A form of scripting language, the dialplan contains instructions that
Asterisk follows in response to external triggers. In contrast to traditional phone sys-
tems, Asterisk’s dialplan is fully customizable.
This chapter introduces the essential concepts of the dialplan. The information pre-
sented here is critical to your understanding of dialplan code and will form the basis of
any dialplan you write. The examples have been designed to build upon one another,
and we recommend that you do not skip too much of this chapter, since it is so fun-
damentally important to Asterisk. Please also note that this chapter is by no means an
exhaustive survey of all the possible things dialplans can do; our aim is to cover just
the essentials. We’ll cover more advanced dialplan topics in later chapters. You are
encouraged to experiment.
Dialplan Syntax
The Asterisk dialplan is specified in the configuration file named extensions.conf.
The extensions.conf file usually resides in the /etc/asterisk/ directory, but
its location may vary depending on how you installed Asterisk. Other
common locations for this file include /usr/local/etc/asterisk/ and /opt/
etc/asterisk/.
The dialplan is made up of four main concepts: contexts, extensions, priorities, and
applications. After explaining the role each of these elements plays in the dialplan, we’ll
have you build a basic but functioning dialplan.
107