CallEvents
Constants
AudioStarted
Event is triggered 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 that triggered the event
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
BlindTransferRequested
Event is triggered when blind transfers are enabled by Call.handleBlindTransfer.
Parameters
call:
Call that triggered the event
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
transferTo:
string
Username
Connected
Event is triggered after an incoming/outgoing call is connected. For incoming call, it happens after the Call.answer was called. For outgoing call, it happens when a remote peer answers the call.
Parameters
call:
Call that triggered the event
customData:
undefined
OptionalOptional: Custom data that was passed from client with call accept command
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
Disconnected
Event is triggered when a call is terminated.
Most frequent status codes (returned when a call is terminated before being answered):
Code | Description |
---|---|
408 | Call was not answered within 60 seconds |
603 | Call was rejected |
486 | Destination number is busy |
487 | Request 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.
Parameters
call:
Call that triggered the event
code:
number
Status code of the call (i.e., 486)
cost:
number
Call cost in account currency
duration:
number
Total call duration in seconds
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
reason:
string
Status message of call failure
Failed
Event is triggered when an outgoing call is terminated before connection.
Most frequent status codes:
Code | Description |
---|---|
486 | Destination number is busy |
487 | Request terminated |
404 | Invalid number |
480 | Destination number is unavailable |
402 | Insufficient funds |
603 | Call was rejected |
408 | Call was not answered within 60 seconds |
Parameters
call:
Call that triggered the event
code:
number
Status code of the call (i.e., 486)
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
reason:
string
Status message of call failure
FirstVideoPacket
Event is triggered when the first video packet was received
Parameters
call:
Call that triggered the event
name:
string
The name of the event
url:
string
Record URL
InfoReceived
Event is triggered when INFO message is received
Parameters
body:
string
Content of the message
call:
Call that triggered the event
headers:
{[header: string]: string}
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
MessageReceived
Event is triggered when a text message is received
Parameters
call:
Call that triggered the event
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
text:
string
Content of the message
MicStatusChange
Event is triggered each time when microphone status changes. There is the method for enabling status analyzing - Call.handleMicStatus.
Parameters
active:
boolean
Activity flag
call:
Call that triggered the event
name:
string
The name of the event
OffHold
Event is triggered when call is taken off hold
Parameters
call:
Call that triggered the event
name:
string
The name of the event
OnHold
Event is triggered when call is put on hold
Parameters
call:
Call that triggered the event
name:
string
The name of the event
PlaybackFinished
Event is triggered when the audio/voice playback is completed. Note that the Call.stopPlayback method finishes any media, so the PlaybackFinished event will be not triggered. The playback may be started by the Call.say or Call.startPlayback methods.
Parameters
call:
Call that triggered the event
error:
undefined
OptionalOptional: Error that occured during the playback
name:
string
The name of the event
PlaybackReady
Event is triggered by the Call.startPlayback and Call.say methods when
1) the audio file download to the Voximpant cache is finished;
2) the audio file is found in the cache (i.e., it was in the cache before).
Parameters
call:
Call that triggered the event
name:
string
The name of the event
PlaybackStarted
Event is triggered by the Call.startPlayback and Call.say methods when audio/voice playback is started.
Parameters
call:
Call that triggered the event
duration:
number
Playback duration
name:
string
The name of the event
PushSent
Parameters
call:
Call that triggered the event
name:
string
The name of the event
result:
string
ReInviteAccepted
Event is 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 that triggered the event
headers:
{[header: string]: string}
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
ReInviteReceived
Event is triggered when the Voximplant cloud receives the ReInviteReceived message. This message means that a caller:
1) started to send 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 that triggered the event
headers:
{[header: string]: string}
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
ReInviteRejected
Event is triggered when the Voximplant cloud receives the ReInviteRejected message. This message means that a call didn't receive video from the other participant.
Parameters
call:
Call that triggered the event
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
RecordError
Event is triggered in case of problems during the recording process
Parameters
call:
Call that triggered the event
error:
string
Is triggered in case of problems during the recording process
name:
string
The name of the event
RecordStarted
Event is triggered when call recording is started as a result of the Call.record method call.
Parameters
call:
Call that triggered the event
name:
string
The name of the event
url:
string
HTTP URL of a record file.
RecordStopped
Event is triggered when call recording is stopped. This happens after the CallEvents.Disconnected event was triggered.
Parameters
call:
Call that triggered the event
cost:
string
Record cost (in the account's currency: USD, EUR or RUR)
duration:
number
Record duration (sec)
name:
string
The name of the event
url:
string
HTTP URL of record file.
Ringing
Event is triggered after outgoing call receives progress signal from a remote peer.
Parameters
call:
Call that triggered the event
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
StateChanged
Parameters
call:
Call that triggered the event
name:
string
The name of the event
newState:
string
oldState:
string
Statistics
Event is triggered when call statistic changed.
Parameters
call:
Call that triggered the event
name:
string
The name of the event
ToneDetected
Event is triggered when a call progress tone is detected (either dial tone or busy tone).
There is the method for enabling tone detection - [Call.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.
Parameters
ProgressTone:
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 that triggered the event
name:
string
The name of the event
ToneReceived
Event is triggered when a 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 Call.handleTones method.
Parameters
call:
Call that triggered the event
name:
string
The name of the event
tone:
string
Tone received in this event: 0-9,*,# are possible values
TransferComplete
Event is triggered when a call transfer is complete
Parameters
call:
Call that triggered the event
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
role:
transferor
OptionalAll the transfer roles.
TransferFailed
Event is triggered when a call transfer is failed.
Parameters
call:
Call that triggered the event
code:
number
Status code of the call (i.e., 486)
headers:
{[header: string]: string}
Optional SIP headers received with the message (the ones starting with "X-")
name:
string
The name of the event
reason:
string
Status message of call failure
role:
transferor
OptionalAll the transfer roles.
VideoTrackCreated
The event is triggered after the video track created. This could happen only if the Call.record method with {video: true} params was called.
Parameters
call:
Call that triggered the event
name:
string
The name of the event
url:
string
Record URL
VoicemailToneDetected
Event is triggered each time when voicemail tone is detected. The detection is possible if the Call.detectVoicemailTone method was called in the scenario. Note that detection is ended after timeout specified in the method (default value is 20 seconds).
Parameters
call:
Call that triggered the event
frequency:
number
Tone frequency
name:
string
The name of the event
VoicemailToneNotDetected
Event is triggered when voicemail tone is not detected. The event can be triggered only if the Call.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)
Parameters
call:
Call that triggered the event
name:
string
The name of the event