System information

Argument 2: Timeout
The second argument to the Dial() application is a timeout, specified in seconds. If a
timeout is given, Dial() will attempt to call the specified destination(s) for that number
of seconds before giving up and moving on to the next priority in the extension. If no
timeout is specified, Dial() will continue to dial the called channel(s) until someone
answers or the caller hangs up. Let’s add a timeout of 10 seconds to our extension:
exten => 201,1,Dial(DAHDI/1,10)
If the call is answered before the timeout, the channels are bridged and the dialplan is
done. If the destination simply does not answer, is busy, or is otherwise unavailable,
Asterisk will set a variable called DIALSTATUS and then continue on with the next priority
in the extension.
Let’s put what we’ve learned so far into another example:
exten => 201,1,Dial(DAHDI/1,10)
same => n,Playback(vm-nobodyavail)
same => n,Hangup()
As you can see, this example will play the vm-nobodyavail.gsm sound file if the call goes
unanswered.
Argument 3: Option
The third argument to Dial() is an option string. It may contain one or more characters
that modify the behavior of the Dial() application. While the list of possible options
is too long to cover here, one of the most popular is the m option. If you place the letter
m as the third argument, the calling party will hear hold music instead of ringing while
the destination channel is being called (assuming, of course, that music on hold has
been configured correctly). To add the m option to our last example, we simply change
the first line:
exten => 201,1,Dial(DAHDI/1,10,m)
same => n,Playback(vm-nobodyavail)
same => n,Hangup()
Argument 4: URI
The fourth and final argument to the Dial() application is a URI. If the destination
channel supports receiving a URI at the time of the call, the specified URI will be sent
(for example, if you have an IP telephone that supports receiving a URI, it will appear
on the phone’s display; likewise, if you’re using a softphone, the URI might pop up on
your computer screen). This argument is very rarely used.
Few (if any) phones support URI information being passed to them. If
you’re looking for something like a screen pop, you might want to check
out Chapter 18, and more specifically the section on Jabber in “Using
XMPP (Jabber) with Asterisk” on page 418.
Building an Interactive Dialplan | 121