text
stringlengths
0
152
The Spool
The spool is where applications store files on a Linux system that are going to change
frequently, or that will be processed by other processes at a later time. For example,
Linux print jobs and pending emails are normally written to the spool until they are
processed.
20
|
Chapter 2: Asterisk Architecture
In Asterisk, the spool is used to store transient items such as voice messages, call
recordings,6 call files, and so forth.
The Asterisk spool will be found under the /var/spool/asterisk directory.
Logging
Asterisk is capable of generating several different kinds of logfiles. The /var/log/aster‐
isk folder is where call detail records (CDRs), channel events from CEL, debug logs,
queue logs, messages, errors, and other output are written.
This folder will be extremely important for any troubleshooting efforts you under‐
take. We will talk more about how to make use of Asterisk logs in Chapter 21.
The Dialplan
The dialplan is the heart of Asterisk. All channels that arrive in the system will be
passed through the dialplan, which contains the call-flow scripts that determine how
incoming calls are handled.
Dialplan is typically written using Asterisk’s own dialplan syntax, which is stored in a
file named /etc/asterisk/extensions.conf. There are other ways to control call flow, and
we will explore them later, but no matter which method you eventually employ, you
will find that a basic understanding of the traditional dialplan will be immensely
helpful. That is what we will focus on for most of the first two-thirds of this book.
Later, we will explore handling call flow outside of the dialplan, using technologies
such as AMI, AGI, and ARI.
Hardware
Asterisk is capable of communicating with a vast number of different technologies. In
general, these connections are made across a TCP/IP network connection (usually
using SIP). However, connections to more traditional telecom circuits, such as PRI
(T1, E1, etc.), BRI (EuroISDN) SS7 (mostly T1 and E1), and analog (everything from
a few FXO and FXS ports up to large channel banks fed through T1/E1 CAS/RBS
connections), can also be achieved using physical cards installed in a server.
Many companies produce this hardware, such as Digium (the sponsor, owner, and
primary developer of Asterisk), Sangoma (who recently purchased Digium), Dialogic
(also a Sangoma company), OpenVox, Pika, Voicetronix, beroNet, and many others.
All of these companies have been involved with Asterisk for many years.
6 Not call detail records (CDRs), but rather audio recordings of calls generated by the MixMonitor() and related
applications.
The Dialplan
|
21
The most popular hardware for Asterisk is generally designed to work through the
Digium Asterisk Hardware Device Interface (known as DAHDI). This is a complex
architecture, and is out of the scope of this book. Server-based telephony cards will all
have installation requirements unique to the manufacturer, and will require you to
have strong skills in both Linux hardware installation as well as traditional PSTN cir‐
cuit troubleshooting and provisioning.
If you need to interface with traditional PSTN circuits using Asterisk, we recommend
that you keep Asterisk as a SIP-only platform, and interface using a third-party gate‐
way of some sort. Be warned: this is not entry-level stuff, and if you are just starting
out with Asterisk, you are strongly advised to keep your initial solutions to SIP-only.
Asterisk Versioning
The Asterisk release methodology has gone through several styles over time. This has
led to some confusion in the past, but these days the versioning is fairly straightfor‐
ward, and relatively easy to understand. Digium has maintained an excellent refer‐
ence at the Asterisk wiki, and we encourage you to go there for the latest details on
Asterisk versions.
This book was written and tested using version 16, but you will find that the funda‐
mental concepts we explore will be relevant to most Asterisk versions. The concep‐
tual structure of Asterisk has not changed for quite some time, and as of this writing
there are no known plans to change that going forward. Future versions will deliver
more powerful multimedia and conferencing capabilities, to be sure, but they are
likely to be implemented within the existing structure.
Conclusion
Asterisk is composed of many different technologies, most of which are complicated
in their own right. As a result, understanding Asterisk architecture can be over‐
whelming. Still, the reality is that Asterisk is well designed for what it does and, in our
opinion, has achieved a remarkable balance between flexibility and complexity.
22
|
Chapter 2: Asterisk Architecture