Upgrade 3CX to v18 and get it hosted free!

Asterisk cmd RetryDial

Author image

RetryDial

This is simply a variant of the Dial command.

RetryDial(announce|sleep|loops|Technology/resource[&Technology2/resource2…[|timeout[|options[|URL]]]])

Synopsis

Place a call, retrying on failure allowing optional exit extension.

Description

Attempt to place a call. If no channel can be reached, play the file defined by ‘announce’ waiting ‘sleep’ seconds to retry the call.
If the specified number of attempts matches ‘loops’ the call will continue with the next priority.

If ‘loops’ is set to -1, the call will retry endlessly. While waiting, a 1 digit extension may be dialed. If the 1 digit extension exists in the context defined in ${EXITCONTEXT}, the call will exit the RetryDial() application to that extension immmediately.
‘sleep’ defaults to 10 seconds if any value less than 1 is supplied.

All the arguements after the ‘loops’ parameter are passed directly to Dial() (show application Dial)

Example

[vcon]
exten => 1,1,Voicemail(${BOX})

[mycon]
exten => _1XXX,1,SetVar(BOX=${EXTEN})
exten => _1XXX,2,SetVar(EXITCONTEXT=vcon)
exten => _1XXX,2,RetryDial(please-wait|5|3|SIP/${BOX}|60|d)
exten => _1XXX,3,Playback(sorry-pal)
exten => _1XXX,4,Hangup

The file announces “I am currently busy, press 1 to leave me voicemail or stay on the line”
Because you added the ‘d’ flag you can now dial 1 even when the call is in the ring state. If you want to never let them hear the ringing just add the ‘m’ flag too.
It will try to call them for 60 seconds at a time and wait 5 sec between each failure in the event of a busy signal. This will repeat up to 3 times (that is what the 5|3 is for)

Details

See bug/patch 3313

This will not call the caller back, i.e. is not a auto-callback feature as such. This app is for a situation where you would play a file that says “I am currently on the phone, press 1 to leave me a voice mail or stay on the line to wait for me.” or “press 1 to leave me a voicemail or 2 to try my cell” but once you hangup that’s it, it gives up.

If the ‘d’ flag is set it trumps the ‘H’ flag and intercepts any dtmf while you are waiting for the call to be answered and returns that value on the spot. This allows you to dial an exit extension while waiting for the call to be answered. So, if you set this ‘d’ flag in the dialargs portion of the RetryDial() then you will be able to cancel out the call while waiting for the call to be picked up as well as when music-on-hold is playing.

See also


Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.