API Docs for:
Show:

Channel Class

Module: astproxy

Abstraction of an asterisk channel.

It can throw exceptions.

Constructor

Channel

(
  • channel
)
Object

Parameters:

  • channel Object

    The channel object

    • channel String

      The channel identifier

    • callerNum String

      The caller number

    • callerName String

      The caller name

    • bridgedNum String

      The connected number

    • bridgedName String

      The connected name

    • bridgedChannel String

      The connected asterisk channel

    • status String

      The status description of the asterisk channel

Returns:

Object:

The channel object.

Methods

getBridgedChannel

() String

Return the connected channel identifier.

Returns:

String:

The connected channel identifier.

getBridgedName

() String

Return the connected name.

Returns:

String:

The connected name

getBridgedNum

() String

Return the connected number.

Returns:

String:

The connected number.

getCallerName

() String

Return the caller name.

Returns:

String:

The caller name.

getCallerNum

() String

Return the caller number.

Returns:

String:

The caller number

getChannel

() String

Return the channel identifier.

Returns:

String:

The channel identifier.

getChannelStatus

() String

Return the channel status description.

Returns:

String:

The channel status description.

getStartTime

() Number

Return the channel time creation from Jan 1, 1970.

Returns:

Number:

The channel creation time from Jan 1, 1970.

getUniqueId

() String

Return the unique identifier.

Returns:

String:

The unique identifier.

isDown

() Boolean

Check if the channel status id "down".

Returns:

Boolean:

Returns true if the channel status is "down".

isExtension

(
  • exten
)
Boolean

Returns true if this channel is of the specified extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the channel is of the specified extension identifier

isInConference

() Boolean

True if the channel involves a meetme conference.

Returns:

Boolean:

Returns true if the channel involves a meetme conference.

isSource

() Boolean

Check if the channel is the source.

Returns:

Boolean:

Return true if the channel is the source, false otherwise.

isStatusUp

() Boolean

Returns true if the channel status is "up".

Returns:

Boolean:

True if the channel status is "up".

toJSON

(
  • [privacyStr]
)
Object

Returns the JSON representation of the object.

{
    type:           "destination",      // the channel type: it can be "destination" or "source"
    channel:        "PJSIP/214-0000034f"  // the channel identifier
    callerNum:      "214"
    startTime:      1365600403000       // the starting call timestamp
    callerName:     "sip214ale"
    bridgedNum:     "221"               // the number of the connected caller/called
    bridgedName:    "sip221ale"         // the name of the connected caller/called
    inConference:   true,               // true if the channel involves a meetme conference
    channelStatus:  "up"                // the channel status
    bridgedChannel: "PJSIP/221-0000034e", // the connected channel identifier
}

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 readable string of the extension.

Returns:

String:

The readable description of the extension

Properties

bridgedChannel

String private

The connected channel.

bridgedName

String private

The connected name.

bridgedNum

String private

The connected number.

callerName

String private

The caller name.

callerNum

String private

The caller number.

CHAN_TYPE

Object

The possible values for channel type.

Default: Has the same values as private TYPE property.

channel

String private

The channel identifier.

CHANNEL_STATUS_ENUM

Object final

The Channel status enumeration. It's the same of private STATUS_ENUM.

Default: Equal to the private property STATUS_ENUM

channelStatus

String private

The status description of the asterisk channel.

inConference

Boolean private

True if the channel involves a meetme conference.

startTime

Number private

The creation time in milliseconds from Jan 1, 1970.

STATUS_ENUM

Object private final

The Channel status enumeration.

Default: { DOWN: "down", RING: "ring", RINGING: "ringing" }

type

String private

The type of the channel can be source or destination.

TYPE

Object private

The possible values for channel type.

Default: { DEST: "dest", SOURCE: "source" }

uniqueid

String private

The unique identifier.