Example 3: Dial multiple channels, partially delayed
Idea: Make a special extension where you could provide the delay and the numbers you want to dial, for example:
exten => _900XXXXX,1,Wait(${EXTEN:3:2})
exten => _900XXXXX,2,Dial(SIP/${EXTEN:5})
Then in the incoming context you could use the Local channel construct and dial:
exten => s,1,Dial(SIP/200&SIP/201&LOCAL/90015300&LOCAL/90015301)
In the above example 200 and 201 extension will ring immediately, and 300 and 301 will start ringing after 15 seconds. After to 900 the first two digits are for the delay before start ringing and the last three are the extension that should be called. The trick here is that instead of simply using two Dial statements after each other we make sure we ring each phone only once; that prevents a) potential problems with SIP devices needing some wrap up time before being able to take another call, and b) avoids too many "missed call" entires in the phone's interface.
Look at ForkCDR and/or ResetCDR if you are not happy with the resulting CDRs of this example
http://www.voip-info.org/wiki/view/Aste ... =71&page=2