This site is no longer updated.Go to new Conversational Cloud docs

$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.

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.

Parameter Type Description Example
startDateTime Date Call start date. The call will be made in the interval between startDateTime and finishDateTime. new Date("2020-03-23T00:00:00")
finishDateTime Date Call end date. After finishDateTime, no calls will be made. new Date("2020-03-23T00:00:00")
allowedDays Array Weekdays when calls are allowed. ["mon", wed", "fri"]
allowedTime Object Time intervals when calls are allowed for each day of the week. "default": [{"localTimeFrom": "10:00", "localTimeTo": "11:30"}]
retryIntervalInMinutes Number The pause between callback attempts, in minutes. 120
maxAttempts Number The total number of call attempts in the new series. 1
dialerPriority Number Phone number priority. 2

Specifying either startDateTime or allowedTime is required. If the other fields are omitted, their values are taken from the call campaign settings.

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();

You can use Duckling entities to extract arbitrary time values. Use slot filling so that the callback time is always requested from the client.