DialogBase

Class finesse.restservices.DialogBase

Extends finesse.restservices.RestBase Common Parameters

DialogBase is extended into individual JavaScript objects (such as Dialog and MediaDialog) and cannot be used directly. DialogBase defines common utilities that are used by both Dialog and MediaDialog objects.

A dialog is a connection between multiple participants. For example, a regular phone call, a chat, or an email.

Example

Code Snippet
Copyvar _dialogs = _user.getDialogs({
        includeNonVoice: true
    }
    _dialogs.addHandler('load', function() {
        dialog
    })._dialogs.getCollection();
    for (dialog in dialogCollection) {
        if (dialogCollection.hasOwnProperty(dialog)) {
            var _dialog = dialogCollection[dialog];
            _dialog.addHandler(‘change’, function() {
                // TODO: on change of dialog do some thing
            }));
    }
}

Methods

getCallType()

Retrieves the call type.

Note
This method is deprecated. Use getMediaProperties().callType.

Returns

{String} The call type.

updateCallVariables(callvariablesList, options)

Updates the dialog's call variables. This function does not validate the call variables. The client must take care of validating the call variables before using this function.

Parameters

Name

Type

Description

Required

callvariablesList

Object

The call variables are from 1 to 10. For example, callVariable1: value1, callVariable2: value2, and so on.

Yes

options

Object

An object containing the handlers for the request.

For more information on handlers, see Request Handlers.

Yes

Example
Code Snippet
Code Snippet - 1
Copyvar callVariablePayload = {
    "callVariable1": "value1",
    "callVariable2": "value2"
};
dialog.updateCallVariables(callVariablePayLoad, {
    error: function() {
        console.log("Error on updating call variable");
    }
});
Copyvar callVariablePayload = {
    "callVariable1": "value1",
    "callVariable2": "value2",
    "user.eccVariable1": "value3"
};
dialog.updateCallVariables(callVariablePayLoad, {
    error: function() {
        console.log("Error on updating call variable");
    }
});

getMediaProperties()

Retrieves a list of media properties from the dialog object.

Returns

{Object} The call variables and the names are mapped to values. Variables include the following:

  • dialedNumber—The number dialed.

  • callType—The type of call. Call types include:

    • ACD_IN

    • PREROUTE_ACD_IN

    • PREROUTE_DIRECT_AGENT

    • TRANSFER

    • OTHER_IN

    • OUT

    • AGENT_INSIDE

    • CONSULT

    • CONFERENCE

    • SUPERVISOR_MONITOR

    • OUTBOUND

    • OUTBOUND_PREVIEW

  • DNIS—The DNIS provided. For routed calls, this is the route point.

  • wrapUpReason—Description of the call.

  • queueNumber—The Id of the agent Skill Group queue.

  • queueName—Name of the agent Skill Group the that the call is attributed to.

  • callKeyCallId—Unique number of the call routed on a particular day.

  • callKeyPrefix—The day when the call is routed.

  • callKeySequenceNum—The sequence number of the call.

  • Variables by name—The name indicates whether it is a call variable or an ECC variable. Call variable names to start with callVariable#, where # refers to 1–10. ECC variable names (both scalar and array) are prepended with the user. ECC variable arrays include an index that is enclosed within square brackets that are located at the end of the ECC array name.

  • The following call variables provide additional details about an Outbound Option call:

    • BACampaign

    • BAAccountNumber

    • BAResponse

    • BAStatus

      • PREDICTIVE_OUTBOUND—A predictive outbound call.

      • PROGRESSIVE_OUTBOUND—A progressive outbound call.

      • PREVIEW_OUTBOUND_RESERVATION—The agent is reserved for a preview outbound call.

      • PREVIEW_OUTBOUND—The agent is on a preview outbound call.

    • BADialedListID

    • BATimeZone

    • BABuddyName

getMediaType()

Retrieves the media type.

Returns

{String} The media type.

getParticipants()

Retrieves a list of participants from the dialog object.

{Array} The array list of participants. The participant entity properties are as follows:

  • state—The last participant state in a dialog.

  • stateCause—The state cause of the participant.

  • mediaAddress—The media address of the participant.

  • startTime—The start time of the participant.

  • stateChangeTime—The time when the participant state has changed.

  • actions—These are the actions that a participant can perform.

getState()

Retrieves the dialog state.

Returns

{String} The dialog state.

For additional parameters and methods, see RestBase Common Parameters.