Skip to main content

$dialer.getDialHistory

This method allows retrieving the history of completed and available call attempts for the current phone number.

Syntax

The method is called without arguments and returns an object having four numeric properties.

$dialer.getDialHistory(); // => {
// "completedAttempts" : 0,
// "availableAttempts" : 3,
// "completedAttemptsToPhone" : 3,
// "availableAttemptsToPhone" : 6
// }

Current call attempt series history

tip
When a customer fails to answer a phone call during a call campaign, the bot can make several call attempts on their phone number. Several call attempts in a row form a series.
If the bot reaches the customer and schedules a new call using the $dialer.redial method, the series is reset, and new call attempts are made during a new series.

The completedAttempts and availableAttempts properties reflect the history of the current call attempt series:

  • completedAttempts is the number of call attempts already made during the current series.
    • The value of this property is incremented by 1 with every call attempt made. However, if a new series is scheduled from the script, the counter is reset to 0.
  • availableAttempts is the number of call attempts available during the current series.
    • If the phone number was included in the list of numbers for the call campaign, this property corresponds to the value of Max attempts count set during campaign creation.
    • If the phone number was added to the campaign via the Calls API and a value for maxAttempts was passed explicitly in the request, availableAttempts is equal to maxAttempts.
    • If a new series of call attempts was scheduled from the script and maxAttempts was passed explicitly to $dialer.redial, availableAttempts is also equal to maxAttempts.

History of all call attempts

Properties with the ToPhone suffix reflect the history of all call attempts for the phone number:

  • completedAttemptsToPhone is the total number of all call attempts made for the phone number.
    • The value of this property is incremented by 1 with every call attempt made. It never gets reset.
  • availableAttemptsToPhone is the maximum number of call attempts allowed for the phone number.
    • This property corresponds to the value of Max attempts count set during campaign creation.

Example

A new call campaign is made from JAICP with the following values set for Dial attempts counters: Initial attempts count: 4, Max attempts count: 8.

The list of numbers for this campaign contains one phone number, e.g. 16500000000. The history of call attempts for this number appears as follows:

  1. Series 1, attempt 1: no reply.
  2. Series 1, attempt 2: no reply.
  3. Series 1, attempt 3: the customer answered the call. The return value of $dialer.getDialHistory:
{
"completedAttempts": 2, // 2 attempts made in the current series
"availableAttempts": 4, // 4 attempts are available for the current series (via campaign settings)
"completedAttemptsToPhone": 2, // 2 attempts made in total
"availableAttemptsToPhone": 8 // 8 attempts at most can be made across all series
}
  1. The customer asked to call back later. $dialer.redial was called with maxAttempts: 3.
  2. Series 2, attempt 1: no reply.
  3. Series 2, attempt 2: the customer answered the call. The return value of $dialer.getDialHistory:
{
"completedAttempts": 1, // 1 attempt made in the current series
"availableAttempts": 3, // 3 attempts are available for the current series (via maxAttempts)
"completedAttemptsToPhone": 4, // 4 attempts made in total (1 in the first series + 2 in the second)
"availableAttemptsToPhone": 8 // 8 attempts at most can be made across all series
}
tip
This method can be used for implementing advanced call scheduling based on how many calls have been already made and how many are left.