Events

CallEvents.AudioStarted

Event triggered after outgoing call starts receiving media from remote peer.

Properties
  • call: Call

    Call that triggered the event

  • headers: Object

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

  • name: String

    The name of the event - "Call.AudioStarted"

CallEvents.Connected

Event triggered after the incoming/outgoing call is connected. This happens after the Call.answer() was called.

Properties
  • call: Call

    Call that triggered the event

  • customData: String

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

  • name: String

    The name of the event - "Call.Connected"

CallEvents.Disconnected

Event triggered when an established call was terminated. Note that this event doesn't mean the end of the JavaScript session. The session without calls and/or ACD requests will be automatically terminated after some time (see the session limits for details). It's a good idea to explicitly terminate the session with VoxEngine.Terminate after it's no longer needed.

Properties
  • call: Call

    Call that triggered the event

  • cost: number

    Call cost in account currency

  • duration: number

    Total call duration in seconds

  • headers: Object

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

  • name: String

    The name of the event - "Call.Disconnected"

CallEvents.Failed

Event triggered when an outgoing call was terminated before it was connected.

Most frequent status codes:
CodeDescription
486Destination number is busy
487Request terminated
603Call was rejected
404Invalid number
480Destination number is unavailable
402Insufficient funds
Properties
  • call: Call

    Call that triggered the event

  • code: Number

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

  • headers: Object

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

  • name: String

    The name of the event - "Call.Failed"

  • reason: String

    Status message of call failure (i.e. Busy Here)

CallEvents.FirstVideoPacket

Dispatched after the first video packet received

Properties
  • call: Call

    Call that triggered the event

  • url: string

    Record URL

CallEvents.InfoReceived

Event triggered when INFO message is received

Properties
  • body: String

    Content of the message

  • call: Call

    Call that triggered the event

  • headers: Object

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

  • mimeType: String

    MIME type of INFO message

  • name: String

    The name of the event - "Call.InfoReceived"

CallEvents.MessageReceived

Event triggered when Text Message is received

Properties
  • call: Call

    Call that triggered the event

  • headers: Object

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

  • name: String

    The name of the event - "Call.MessageReceived"

  • text: String

    Content of the message

CallEvents.MicStatusChange

Event triggered when microphone status changed. There is the method for enabling status analyzing - handleMicStatus().

Properties
  • active: Boolean

    Activity flag

  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.MicStatusChange"

CallEvents.OffHold

Event triggered when call is taken off hold

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.OffHold"

CallEvents.OnHold

Event triggered when call is put on hold

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.OnHold"

CallEvents.PlaybackFinished

Event triggered when audio/voice playback is finished by itself. Note that the stopPlayback method finishes any media, so the PlaybackFinished event will be not triggered.

Properties
  • call: Call

    Call that triggered the event

  • error: String

    Optional: Error that occured during the playback

  • name: String

    The name of the event - "Call.PlaybackFinished"

CallEvents.ReInviteAccepted

Event triggered when ReInviteReceived message is accepted

Properties
  • body: String

    Content of the message

  • call: Call

    Call that triggered the event

  • headers: Object

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

  • mimeType: String

    MIME type of body data "application/sdp" or "application/json"

  • name: String

    The name of the event - "Call.ReInviteAccepted"

CallEvents.ReInviteReceived

Event triggered when ReInviteReceived message is received

Properties
  • body: String

    Content of the message

  • call: Call

    Call that triggered the event

  • headers: Object

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

  • mimeType: String

    MIME type of body data "application/sdp" or "application/json"

  • name: String

    The name of the event - "Call.ReInviteReceived"

CallEvents.ReInviteRejected

Event triggered when ReInviteReceived message is rejected

Properties
  • call: Call

    Call that triggered the event

  • headers: Object

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

  • name: String

    The name of the event - "Call.ReInviteAccepted"

CallEvents.RecordStarted

Event triggered when call recording is started as a result of Call.record().

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.RecordStarted"

  • url: String

    HTTP URL of record file.

CallEvents.RecordStopped

Event triggered when call recording is stopped. The CallEvents.Disconnected event initiates the stop of the recording.

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.RecordStopped"

  • url: String

    HTTP URL of record file.

CallEvents.Ringing

Event triggered after outgoing call receives progress signal from a remote peer.

Properties
  • call: Call

    Call that triggered the event

  • headers: Object

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

  • name: String

    The name of the event - "Call.Ringing"

CallEvents.Statistics

Event triggered when call statistic changed.

Properties
  • call: Call

    Call that triggered the event

CallEvents.ToneDetected

Event triggered when a tone is detected. There is the method for enabling tone detection - detectProgressTone. Note that: 1) the event is triggered only if the CallEvents.Connected event was triggered 2) the event is only triggered once in a call session.

Properties
  • ProgressTonŠµ: Boolean

    If set to true, the detected tone is a progress tone.

  • VoicemailTone: Boolean

    If set to true, the detected tone is a voicemail tone.

  • call: Call

    Call thet triggered the event

  • name: String

    The name of the event - "Call.ToneDetected"

CallEvents.ToneReceived

Event triggered when DTMF signal is received. Note that by default DTMF signals will not trigger this event, this behavior needs to be set explicitly by using the handleTones() method.

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.ToneReceived"

  • tone: String

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

CallEvents.TransferComplete

Event triggered when call transfer complete

Properties
  • call: Call

    Call that triggered the event

CallEvents.VideoTrackCreated

The event triggered after the video track created. This could happen only if the Call.Record() method was called with definite parameter: Call.record({video: true}).

Properties
  • call: Call

    Call that triggered the event

  • url: string

    Record URL

CallEvents.VoicemailPromptDetected

DEPRECATED || Event triggered when voicemail prompt is detected. Please note that this method is based on specific audio signal pattern which isn't always in place, so there is no 100% guarantee that it will detect voicemail in all situations.

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.VoicemailPromptDetected"

  • pattern: String

    Pattern which corresponds to media stream, see PromptStreamPattern

CallEvents.VoicemailPromptNotDetected

DEPRECATED || Event triggered when voicemail prompt is not detected. Please note that this method is based on specific audio signal pattern which isn't always in place, so there is no 100% guarantee that it will detect voicemail in all situations.

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.VoicemailPromptNotDetected"

  • pattern: String

    Pattern which corresponds to media stream, see PromptStreamPattern

CallEvents.VoicemailToneDetected

Event triggered each time when voicemail tone is detected. The detection is possible if the detectVoicemailTone method was called in the scenario. Note that detection is ended after timeout specified in the method (default value is 20 seconds).

Properties
  • call: Call

    Call that triggered the event

  • frequency: Number

    Tone frequency

  • name: String

    The name of the event - "Call.VoicemailToneDetected"

CallEvents.VoicemailToneNotDetected

Event triggered when voicemail tone is not detected. The event can be triggered only if the detectVoicemailTone method was called in the scenario. Note that event is triggered strictly after timeout specified in the method (default value is 20 seconds). Possible causes of detection's failure: interferences or dividing of the signal; complex signal (more than one frequency); the signal is out of the supported range (500 - 2000 Hz)

Properties
  • call: Call

    Call that triggered the event

  • name: String

    The name of the event - "Call.VoicemailToneNotDetected"