System information

Argument 1: Destination
The first argument is the destination you’re attempting to call, which (in its simplest
form) is made up of a technology (or transport) across which to make the call, a forward
slash, and the address of the remote endpoint or resource. Common technology types
include DAHDI (for analog and T1/E1/J1 channels), SIP, and IAX2.
For example, let’s assume that we want to call a DAHDI endpoint identified by DAHDI/
1, which is an FXS channel with an analog phone plugged into it. The technology is
DAHDI, and the resource (or channel identifier) is 1. Similarly, a call to a SIP device (as
defined in sip.conf) might have a destination of SIP/0004F2001122, and a call to an IAX
device (defined in iax.conf) might have a destination of IAX2/Softphone.
§
If we wanted
Asterisk to ring the DAHDI/1 channel when extension 105 is reached in the dialplan, we’d
add the following extension:
exten => 105,1,Dial(DAHDI/1)
We can also dial multiple channels at the same time, by concatenating the destinations
with an ampersand (&), like this:
exten => 105,1,Dial(DAHDI/1&SIP/0004F2001122&IAX2/Softphone)
The Dial() application will ring all of the specified destinations simultaneously, and
bridge the inbound call with whichever destination channel answers first (the other
channels will immediately stop ringing). If the Dial() application can’t contact any of
the destinations, Asterisk will set a variable called DIALSTATUS with the reason that it
couldn’t dial the destinations, and continue on with the next priority in the extension.
The Dial() application also allows you to connect to a remote VoIP endpoint not pre-
viously defined in one of the channel configuration files. The full syntax is:
Dial(technology/user[:password]@remote_host[:port][/remote_extension])
As an example, you can dial into a demonstration server at Digium using the IAX2
protocol by using the following extension:
exten => 500,1,Dial(IAX2/guest@misery.digium.com/s)
The full syntax for the Dial() application is slightly different for DAHDI channels:
Dial(DAHDI/[gGrR]channel_or_group[/remote_extension])
For example, here is how you would dial 1-800-555-1212 on DAHDI channel
number 4
#
:
exten => 501,1,Dial(DAHDI/4/18005551212)
§ If this were a production environment, this would not actually be a good name for this device. If you have
more than one softphone on your system (or add another in the future), how will you tell them apart?
We’ll cover variables in the upcoming section “Using Variables” on page 122. In future chapters we’ll discuss
how to have your dialplan make decisions based on the value of DIALSTATUS.
#Bear in mind that this assumes that this channel connects to something that knows how to reach external
numbers.
120 | Chapter 6:Dialplan Basics