text
stringlengths
0
152
1 In a key system, each line has a corresponding button on each telephone, and lines are accessed by pressing
the desired line key.
108
|
Chapter 7: Outside Connectivity
The [globals] section contains two variables, named LOCAL and TOLL.2 The purpose
of these variables is to simplify management of your dialplan should you ever need to
change carriers. They allow you to make one change to the dialplan that will affect all
places where the specified channel is referenced:
[globals]
; These channels are the same to asterisk as
; any PJSIP enpoint, so they'll be configured
; similar to telephone sets.
; Each carrier will have their own configuration
; requirements (although they'll all be similar)
LOCAL=PJSIP/my-itsp
TOLL=PJSIP/my-other-itsp
The [external] section contains the actual dialplan code that will recognize the
numbers dialed and pass them to the Dial() application:3
[external]
exten => _NXXNXXXXXX,1,Dial(${LOCAL}/${EXTEN}) ; 10-digit pattern match for NANP
exten => _NXXXXXX,1,Dial(${LOCAL}/${EXTEN}) ; 7-digit pattern match for NANP
exten => _1NXXNXXXXXX,1,Dial(${TOLL}/${EXTEN}) ; Long-distance pattern match
; for NANP
exten => _011.,1,Dial(${TOLL}/${EXTEN}) ; International pattern match for
; calls made from NANP
; This section is functionally the same as the above section.
; It is for people who like to dial '9' before their calls
exten => _9NXXNXXXXXX,1,Dial(${LOCAL}/${EXTEN:1})
exten => _9NXXXXXX,1,Dial(${LOCAL}/${EXTEN:1})
exten => _91NXXNXXXXXX,1,Dial(${TOLL}/${EXTEN:1})
exten => _9011.,1,Dial(${TOLL}/${EXTEN:1})
In any context that would be used by sets or user devices, you would use an include
=> directive to allow access to the external context:
[sets]
include => external
It is critically important that you do not include access to the exter‐
nal lines in any context that might process an incoming call. The
risk here is that a phishing bot could eventually gain access to your
outgoing trunks (you’d be surprised at how common these phish‐
ing bots are).
We cannot stress enough how important it is that you ensure that
no external resource can access your toll lines.
2 You can name these anything you wish.
3 For more information on pattern matches, see Chapter 6.
Fundamental Dialplan for Outside Connectivity
|
109
The PSTN
The public switched telephone network (PSTN) has existed for over a century. It is
the precursor to many of the technologies that shape our world today, from the inter‐
net to MP3 players.
The use of old-school PSTN circuits in Asterisk systems is no longer common. The
technical complexities, costs, and limitations of obsolete technology are only justified
in situations where a reliable internet connection is not available (and even then, tra‐
ditional circuits will often be a problematic choice). Even the carriers themselves have
largely switched to VoIP for their internal backbones.
The PSTN Has Retired
More than any technical factor, perhaps the most significant nail in the PSTNs coffin
is the fact that most of the technical experts in the field of traditional telephony are
near or past retirement age, and the new kids have no interest in this sort of thing.
Point being: you will increasingly find that carriers no longer have the skilled staff
required to deploy traditional PSTN services. All the cool kids are learning VoIP
(which is ultimately just a networking technology), and all the carriers put their best
and brightest on the VoIP/SIP side of the business.
So, while it used to be true that you couldn’t beat a PRI circuit for reliability, that is no
longer the case. In fact, many companies deliver PRI circuits across a SIP connection,
which is a kludge Asterisk has no use for.
Where the PSTN might still hold sway for a few years more is in telephone numbers.
If VoIP had been invented without the PSTN preceding it, it’s unlikely that something
like a phone number would have ever been invented. Still, we’ve got them, and we use
them, and the reason we do so is perhaps not so much due to any usefulness they pro‐
vide, but rather due to the fact that they are managed by a complex, multinational
consortium of standards bodies and curators who ensure the integrity of the global
call routing plan.
To put the value of this in perspective, it might be worth considering that if the inter‐