Asterisk Project : Delay Dialing Devices Example

Lets say when someone calls extension 201, we want to ring both the desk phone and their cellphone at the same time, but we want to wait about 6 seconds to start dialing the cellphone. This is useful in a situation when someone might be sitting at their desk, but don't want both devices ringing at the same time, but also doesn't want to wait for the full ring cycle to execute on their desk phone before rolling over to their cellphone.

The dialplan for this would look something like the following:

[devices]
exten => 201,1,Verbose(2,Call desk phone and cellphone but with delay) 
exten => 201,n,Dial(Local/deskphone-201@extensions&Local/cellphone-201@extensions,30) 
exten => 201,n,Voicemail(201@default,${IF($[${DIALSTATUS} = BUSY]?b:u)}) 
exten => 201,n,Hangup() 

[extensions]
; Dial the desk phone 
exten => deskphone-201,1,Verbose(2,Dialing desk phone of extension 201) 
exten => deskphone-201,n,Dial(SIP/0004f2040001) ; SIP device with MAC address 
                                                ; of 0004f2040001 
; Dial the cellphone 
exten => cellphone-201,1,Verbose(2,Dialing cellphone of extension 201) 
exten => cellphone-201,n,Verbose(2,-- Waiting 6 seconds before dialing) 
exten => cellphone-201,n,Wait(6) 
exten => cellphone-201,n,Dial(DAHDI/g0/14165551212)

When someone dials extension 201 in the [devices] context, it will execute the Dial() application, and call two Local channels at the same time:

Local/deskphone-201@extensions
Local/cellphone-201@extensions

It will then ring both of those extensions for 30 seconds before rolling over to the Voicemail() application and playing the appropriate voicemail recording depending on whether the ${DIALSTATUS} variable returned BUSY or not.

When reaching the deskphone-201 extension, we execute the Dial() application which calls the SIP device configured as '0004f204001' (the MAC address of the device). When reaching the cellphone-201 extension, we dial the cellphone via the DAHDI channel using group zero (g0) and dialing phone number 1-416-555-1212.