API Docs for:
Show:

TrunkConversation Class

Module: astproxy

Abstraction of a phone conversation through a trunk. This is equal to conversation.js except for the different calculation of the counterPartNum and direction properties.

It can throw exceptions.

Constructor

TrunkConversation

() Object

Returns:

Object:

The trunk conversation object.

Methods

getDestinationChannel

() Channel

Return the destination channel.

Returns:

Channel:

The destination channel object.

getDuration

() Number

Return the duration of the conversation.

Returns:

Number:

The conversation duration expressed in seconds.

getId

() String

Return the conversation identification.

Returns:

String:

The conversation identification.

getInternalName

() String

Returns the name of the extension involved in the conversation.

Returns:

String:

The name of the extension involved in the conversation.

getInternalNum

() String

Returns the number of the extension involved in the conversation.

Returns:

String:

The number of the extension involved in the conversation.

getSourceChannel

() Channel

Return the source channel.

Returns:

Channel:

The source channel object.

isRecording

() Booelan

Returns true if the conversation is recording or is in mute recording.

Returns:

Booelan:

true if the conversation is recording or is in mute recording, false otherwise.

setInternalName

(
  • name
)

Sets the name of the extension involved in the conversation.

Parameters:

  • name String

    The name of the extension involved in the conversation.

setRecording

(
  • value
)

Sets the recording status.

It can throw an Exception.

Parameters:

  • value Boolean

    The value for the recording status.

setRecordingMute

()

Sets the recording status to mute.

It can throw an Exception.

toJSON

(
  • [privacyStr]
)
Object

Returns the JSON representation of the object. If the conversation isn't connected, one between the source channel and the destination channel can be null.

{
    id:           "SIP/214-000002f4>SIP/209-000002f5",
    owner:        "214",
    chDest:       Channel.toJSON(), // the source channel of the call
    chSource:     Channel.toJSON(), // the destination channel of the call
    duration:     26,
    recording:    false,                               // it's true if the conversation is recording, false otherwise
    direction:    "in",
    internalNum:  "209",                               // the internal number
    externalNum:  "0721405516",                        // the external number
    internalName: "Extension Name",                    // the internal name
    externalName: "Nethesis",                          // the external name
    throughQueue: false                                // if the call has gone through a queue
}

Parameters:

  • [privacyStr] String optional

    If it's specified, it hides the last digits of the phone number

Returns:

Object:

The JSON representation of the object.

toString

() String

Return the string representation of the conversation.

Returns:

String:

The representation of the conversation.

updateDuration

() private

Update the duration in seconds.

Properties

chDest

Channel private

The destination channel.

chSource

Channel private

The source channel.

direction

String private

The conversation direction.

DIRECTION

Object private

The possible values for conversation direction.

Default: { IN: "in", OUT: "out" }

duration

Number private

The duration of the conversation in seconds.

externalName

String private

The name of the external number.

externalNum

String private

The external number.

id

String private

The conversation identifier.

internalName

String private

The name of the internal extension.

internalNum

String private

The internal extension.

owner

String private

The owner of the channel.

recording

String private

The recordig status. It can be one of the "RECORDING_STATUS" property.

Default: RECORDING_STATUS.FALSE

RECORDING_STATUS

Object private

The possible values for conversation recording.

Default: { "MUTE": "mute", "TRUE": "true", "FALSE": "false" }

startime

Number private

The timestamp of the starting time. This is necessary to update the duration value.

throughQueue

Boolean private

True if the conversation has gone through a queue.