Rate this page:

CallEvents

Constants

AudioIdentificationError

Copy URL

Triggers when voicemail detection occurs an error.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

AudioIdentificationStarted

Copy URL

Triggers when voicemail detection system connects to the VMD/AMD server and starts detecting voicemail.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

AudioIdentificationStopped

Copy URL

Triggers when voicemail detection stops detecting voicemail.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

AudioStarted

Copy URL

Triggers after remote peer answered the call or set the call into the Call.startEarlyMedia state. Note that event is not triggered in P2P mode.

Parameters

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

BlindTransferRequested

Copy URL

Triggered when blind transfers are enabled by Call.handleBlindTransfer.

Parameters

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • transferTo:

    string

    Username

Connected

Copy URL

Triggers after an incoming/outgoing call is connected. For incoming call, it happens after the Call.answer is called. For outgoing call, it happens when a remote peer answers the call.

Parameters

  • call:

    Call

    Call that triggered the event

  • customData:

    string

    Optional

    Optional. Custom data that was passed from the client with call accept command

  • headers:

    {[header: string]: string}

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

Disconnected

Copy URL

Triggered when a call is terminated. Most frequent status codes (returned when a call is terminated before being answered):

CodeDescription
408Call is not answered within 60 seconds
603Call is rejected
486Destination number is busy
487Request terminated

Note that this event does not mean the end of the JavaScript session. The session without calls and/or ACD requests are automatically terminated after some time (see the session limits for details). It is a good idea to explicitly terminate the session with VoxEngine.terminate after it is no longer needed.

Parameters

  • call:

    Call

    Call that triggered the event

  • cost:

    number

    Call cost in account currency

  • direction:

    string

    Call direction type according to billing

  • duration:

    number

    Total call duration in seconds

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • internalCode:

    number

    Status code of the call (i.e., 486)

  • name:

    string

    The name of the event

  • reason:

    string

    Reason of the call failure

Failed

Copy URL

Triggered when an outgoing call is terminated before connection. Most frequent status codes:

CodeDescription
486Destination number is busy
487Request terminated
404Invalid number
480Destination number is unavailable
402Insufficient funds
603Call was rejected
408Call was not answered within 60 seconds

Parameters

  • call:

    Call

    Call that triggered the event

  • code:

    number

    Status code of the call (i.e., 486)

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • reason:

    string

    Status message of call failure

FirstAudioPacketReceived

Copy URL

Triggers after the first audio packet is received.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

FirstVideoPacketReceived

Copy URL

Triggers after the first video packet is received.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

Forwarding

Copy URL

Triggers on an incoming/outgoing call forwarding.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

InfoReceived

Copy URL

Triggered when an INFO message is received.

Parameters

  • body:

    string

    Content of the message

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • mimeType:

    string

    MIME type of INFO message

  • name:

    string

    The name of the event

MessageReceived

Copy URL

Triggered when a text message is received.

Parameters

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • text:

    string

    Content of the message

MicStatusChange

Copy URL

Triggers each time when microphone status changes. There is the method for enabling status analyzing - Call.handleMicStatus.

Parameters

  • active:

    boolean

    Whether the microphone is active

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

OffHold

Copy URL

Triggered when a call is taken off hold.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

OnHold

Copy URL

Triggered when a call is put on hold.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

PlaybackFinished

Copy URL

Triggered when the audio/voice playback is completed. Note that the Call.stopPlayback method finishes any media, so the PlaybackFinished event is not triggered. The playback may be started by the Call.say or Call.startPlayback methods.

Parameters

  • call:

    Call

    Call that triggered the event

  • error:

    string

    Optional

    Optional. Error that occurred during the playback

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

PlaybackReady

Copy URL

Triggers by the Call.startPlayback and Call.say methods when:
1) the audio file download to the Voximplant cache is finished;
2) the audio file is found in the cache (i.e., it is in the cache before).

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

PlaybackStarted

Copy URL

Triggers by the Call.startPlayback and Call.say methods when audio/voice playback is started.

Parameters

  • call:

    Call

    Call that triggered the event

  • duration:

    number

    Playback duration

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

PushSent

Copy URL

Triggered when a push notification is sent.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • result:

    string

ReInviteAccepted

Copy URL

Triggered when the Voximplant cloud receives the ReInviteAccepted message. This message means that a call received video from the other participant.

Parameters

  • body:

    string

    Content of the message

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • mimeType:

    string

    MIME type of INFO message

  • name:

    string

    The name of the event

ReInviteReceived

Copy URL

Triggered when the Voximplant cloud receives the ReInviteReceived message. This message means that a caller:
1) started sending video;
2) started/stopped screensharing;
3) put a call on hold / took a call off hold.

Parameters

  • body:

    string

    Content of the message

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • mimeType:

    string

    MIME type of INFO message

  • name:

    string

    The name of the event

ReInviteRejected

Copy URL

Triggered when the Voximplant cloud receives the ReInviteRejected message. This message means that a call does not receive video from the other participant.

Parameters

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

RecordError

Copy URL

Triggers in case of errors during the recording process.

Parameters

  • call:

    Call

    Call that triggered the event

  • error:

    string

    Triggers in case of errors during the recording process

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

RecordStarted

Copy URL

Triggered when call recording is started as a result of the Call.record method call.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • url:

    string

    Link to the record file.

RecordStopped

Copy URL

Triggered when call recording is stopped. This happens after the CallEvents.Disconnected event is triggered.

Parameters

  • call:

    Call

    Call that triggered the event

  • cost:

    string

    Record cost (in the account's currency: USD, EUR or RUB)

  • duration:

    number

    Record duration (sec)

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • url:

    string

    Link to the record file.

Ringing

Copy URL

Triggers after outgoing call receives progress signal from a remote peer.

Parameters

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

RtpResumed

Copy URL

Triggers after the RTP resumed.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

RtpStopped

Copy URL

Triggers after the RTP stopped.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

StateChanged

Copy URL

Triggered when a call status is changed.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • newState:

    string

  • oldState:

    string

Statistics

Copy URL

Triggered when call statistic changed.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

ToneDetected

Copy URL

Triggered when a call dial tone is detected (either dial tone or busy tone). There is the deprecated method for enabling the tone detection - 'Call.detectProgressTone'. Note that:
1) triggers only if the CallEvents.Connected event is triggered;
2) the event is only triggered once in a call session.

Parameters

  • ProgressTone:

    boolean

    Whether the detected tone is a dial tone.

  • VoicemailTone:

    boolean

    Whether the detected tone is a voicemail tone.

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

ToneReceived

Copy URL

Triggered when a DTMF signal is received. Note that by default DTMF signals do not trigger this event, this behavior needs to be set explicitly via the Call.handleTones method.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • tone:

    string

    Tone received in this event: the possible values are 0-9,*,#

TransferComplete

Copy URL

Triggered when a call transfer is complete.

Parameters

  • call:

    Call

    Call that triggered the event

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • role:

    transferor

    Optional

    Optional. The transfer roles.

TransferFailed

Copy URL

Triggered when a call transfer is failed.

Parameters

  • call:

    Call

    Call that triggered the event

  • code:

    number

    Failed transfer's status (e.g., 486)

  • headers:

    {[header: string]: string}

    Optional

    Optional. SIP headers received with the message (the ones starting with "X-")

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • reason:

    string

    Failed transfer's status message

  • role:

    transferor

    Optional

    Optional. The transfer roles.

VideoTrackCreated

Copy URL

Triggers after the video track is created. This could happen only if the Call.record method with {video: true} parameters is called.

Parameters

  • call:

    Call

    Call that triggered the event

  • id:

    string

    The call's ID

  • name:

    string

    The name of the event

  • url:

    string

    Record URL