Skip to main content

$dialer.getAbonentTimezone

This method returns the time zone for the current client.

caution
It is not intended to be used from scripts for inbound calls and only works properly for call campaigns.

Syntax

The method is called without arguments and returns a string containing the client time zone, in the format ±hh:mm:

$dialer.getAbonentTimezone(); // => Example: "+06:00"

Usage details

The method behavior depends on the call campaign settings and the way the phone number was added to the campaign:

  • The Use customer local time toggle is enabled for the call campaign:

    • If the phone number was added to the campaign via a list of clients containing the GMT_ZONE column, the method returns the time zone as specified in the list of numbers.
    • If the phone number was added to the campaign via Calls API and the request contains the gmtZone property, the method returns the time zone as sent in the request.
    • Otherwise the method returns the time zone detected automatically using the client phone number.
  • If the Use customer local time toggle is disabled, the method returns the Tovie Platform server time.

How to use

Used together with $dialer.redial, this method allows scheduling a new series of call attempts, taking into account the client time zone.

The following example illustrates a state for handling a callback request. The callback time is extracted using the @duckling.time system entity.

state: CallBack
q!: * call [me] [back] * @duckling.time *
script:
var datetime = $parseTree["_duckling.time"].value;
var timezone = $dialer.getAbonentTimezone();

$dialer.redial({
startDateTime: new Date(datetime + timezone),
// ...
});
a: Okay, I’ll call you back later!
tip
An alternative solution could be based on using $reactions methods for setting and retrieving the time zone. This implementation, however, would require asking the client to specify the time zone themselves.