Skip to main content

$dialer.redial

During a phone call, it may be necessary to schedule a new call — for instance, if the client is busy and asks to call them back later.

tip
Use the $dialer.redial method to schedule a new series of call attempts and override the calling policy for this number from your script.

Syntax

The method accepts an object with the following properties.

ParameterTypeDescriptionExample
startDateTimeDateCall start date. The call will be made in the interval between startDateTime and finishDateTime.new Date("2020-03-23T00:00:00")
finishDateTimeDateCall end date. After finishDateTime, no calls will be made.new Date("2020-03-23T00:00:00")
allowedDaysArrayWeekdays when calls are allowed.["mon", wed", "fri"]
allowedTimeObjectTime intervals when calls are allowed for each day of the week."default": [{"localTimeFrom": "10:00", "localTimeTo": "11:30"}]
retryIntervalInMinutesNumberThe pause between callback attempts, in minutes.120
maxAttemptsNumberThe total number of call attempts in the new series.
The maximum value is 5. If you specify a greater value, there will be 5 call attempts.
1
dialerPriorityNumberPhone number priority.2
caution
Specifying either startDateTime or allowedTime is required. If the other fields are omitted, their values are taken from the call campaign settings.
tip
See the Calls API POST /addPhones method specification for the description of allowedDays and allowedTime value formats.

Restrictions

  1. Only one series of call attempts can be scheduled during a single conversation. Subsequent calls to the $dialer.redial methods during the conversation will be ignored.

  2. The total number of additional call attempts on each phone number in a call campaign is limited by the Max attempts count value set during campaign creation.

How to use

The following script illustrates how to process a request to call back in an hour:

state: CallbackInAnHour
q!: * call [me] [back] * (an/one) hour *
a: Okay! I’ll call you back in an hour.
script:
var now = new Date();
$dialer.redial({
startDateTime: new Date(now.getTime() + 60 * 60000), // Another call in an hour
finishDateTime: new Date(now.getTime() + 75 * 60000), // Throughout 15 minutes
maxAttempts: 2, // 2 call attempts in total
retryIntervalInMinutes: 5 // 5-minute pause between attempts
});
$dialer.hangUp();
tip
You can use Duckling entities to extract arbitrary time values. Use slot filling so that the callback time is always requested from the client.