/etc/asterisk/extensions.conf
:office-phones
is the context. This context contains two extensions.1001
and 1002
are the extensions. Notice how this setup decouples the numbers from the phones themselves. While these numbers are currently hardcoded to dial Alice’s and Bob’s phones, they could just as easily be used for more complex routing (e.g., automatically roll over to an overnight line during certain hours).1
after the extension is the priority. Remember, a priority is just a step in extension handling. The first priority is always 1
. In this example, each extension only has a single priority.Dial
is the application. The Dial application is used to ring a remote device. Dialing occurs via SIP or other signaling protocols (if you need a refresher on VoIP protocols, head over to our [first article]). [Note: Don’t forget to add the link.]office-phones
context, Asterisk tries matching that call to an extension. When extension 1001 is dialed, the first step (priority) tells Asterisk to dial the PJSIP endpoint for Alice’s phone. When extension 1002 is dialed, the same thing happens for Bob’s phone.office-phones
. This setting tells Asterisk that any calls coming from the alice-softphone
or bob-softphone
endpoints should enter the dialplan in the office-phones
context. When Bob dials a number (say, 9000) from his softphone, Asterisk looks in the office-phones
context for the matching extension 9000. In the sample dialplan above, this call will fail because there is no matching extension.international
context, while everyone else would be placed in the local-only
context.reload
the dialplan to enact the changes you made in the config file:asterisk -rvvv
:ringing
: