System information
When installing telephony hardware, be sure you update the /etc/dahdi/
modules file to enable the appropriate modules for your hardware and
then reload DAHDI with the init script (/etc/init.d/dahdi). You can use
the dahdi_genconf modules command to generate the modules file for
your system as well.
In order to configure an FXO card to work with Asterisk, two files are required.
The first is not an Asterisk configuration file, and is thus located in the /etc/dahdi folder
on your system.
‡
This file, system.conf allows you to define some basic parameters, as
well as specify the channels that will be available to your system. Our example assumes
a four-port FXO card, but many different combinations are possible, depending on
your hardware.
loadzone = us ; tonezone defines sounds the interface must produce
; (dialtone, busy signal, ringback, etc.)
defaultzone = us ; define a default tonezone
fxsks = 1-4 ; which channels on the card will have these parameters
Once your card and channels are known to the operating system, you must configure
them for Asterisk by means of the file /etc/asterisk/chan_dahdi.conf:
[channels]
;
; To apply other options to these channels, put them before "channel".
;
signalling = fxs_ks ; in Asterisk, FXO channels use FXS signaling
; (and yes, FXS channels use FXO signaling)
channel => 1-4 ; apply all the previously defined settings to this channel
In this example, we have told Asterisk that the first four DAHDI channels in the system
are FXO ports.
If you are connecting to the PSTN using analog channels, we need to
explain extension s. When calls enter a context without a specific destination extension
(for example, a ringing FXO line from the PSTN), they are passed to the s extension.
(The s stands for “start,” as this is where a call will start if no extension information
was passed with the call). This extension can also be useful for accepting calls that have
been redirected from other parts of the dialplan. For example, if we had a list of DID
numbers that were all going to the same place, we might want to point each DID to the
s extension, rather than having to code duplicate dialplan logic for each DID.
Since this is exactly what we need for our dialplan, let’s begin to fill in the pieces. We
will be performing three actions on the call (answer it, play a sound file, and hang it
up), so our s extension will need three priorities. We’ll place the three priorities below
The s extension.
‡ In theory, these cards could be used for any software that supports DAHDI; therefore, the basic card
configuration is not a part of Asterisk.
PSTN Circuits | 143