System information

[incoming], because we have decided that all incoming calls should start in this
context
§
:
[incoming]
exten => s,1,Answer()
same => n,Playback(tt-weasels)
same => n,Hangup()
Obviously, you would not normally want to answer a call and then hang up. Typically,
an incoming call will either be answered by an automated attendant, or ring directly to
a phone (or group of phones).
VoIP
In the world of telecom, VoIP is still a relatively new concept. For the century or so
prior to VoIP, the only way to connect your site to the PSTN was through the use of
circuits provided for that purpose by your local telephone company. VoIP now allows
for connections between endpoints without the PSTN having to be involved at all (al-
though in most VoIP scenarios, there will still be a PSTN component at some point,
especially if there is a traditional E.164 phone number involved).
PSTN Termination
Until VoIP totally replaces the PSTN, there will be a need to connect calls from VoIP
networks to the public telephone network. This process is referred to as termination.
What it means is that at some point a gateway connected to the PSTN needs to accept
calls from the VoIP network and connect them to the PSTN network. From the per-
spective of the PSTN, the call will appear to have originated at the termination point.
Asterisk can be used as a PSTN termination point. In fact, given that Asterisk handles
protocol conversion with ease, this can be an excellent use for an Asterisk system.
In order to provide termination, an Asterisk box will need to be able to handle all of
the protocols you wish to connect to the PSTN. In general, this means that your Asterisk
box will need a PRI circuit to handle the PSTN connection, and SIP channels to handle
the calls coming from the VoIP network. The underlying principle is the same regardless
of whether you’re running a small system providing PSTN trunks to an office full of
VoIP telephones, or a complex network of gateway machines deployed in strategic
locations, offering termination to thousands of subscribers.
§ There is nothing special about any context name. We could have named this context
[stuff_that_comes_in], and as long as that was the context assigned in the channel definition in sip.conf,
iax.conf, chan_dahdi.conf, et al., the channel would enter the dialplan in that context. Having said that, it is
strongly recommended that you give your contexts names that help you to understand their purpose. Some
good context names might include [incoming], [local_calls], [long_distance], [sip_telephones],
[user_services], [experimental], [remote_locations], and so forth. Always remember that a context
determines how a channel enters the dialplan, so name accordingly.
144 | Chapter 7:Outside Connectivity