CallEvent
Constants
Triggered when the remote participant enables video during an audio call.
This event allows the application to either accept or reject the request to upgrade the call to video.
If no event listener is registered for the event, the SDK automatically accepts the video upgrade.
If a listener is registered, the application should explicitly call either
accept
or
reject
. If neither method is invoked within 8 seconds,
the upgrade request is automatically rejected.
Listener is called with CallUpgrade and payload:
Parameters
accept:
() => void
Accepts the call upgrade request and enables video receiving for the call.
To also send local video, use Call.addStream after accepting.
reject:
() => void
Rejects the call upgrade request.
The call continues as audio only.
callId:
string
Call id
upgradeStatus:
Watchable property that reflects the current state of the call upgrade request.
Initially set to CallUpgradeStatus.Pending.
Triggered after a call has been successfully connected.
Listener is called with CallConnected and payload:
Parameters
callId:
string
Call id
headers:
Record<string, string>
OptionalOptional headers passed with the event
videoSendingStatus:
Local video sending status at the moment when the call is connected.
This property is initialized with one of the following VideoSendingStatus values:
- VideoSendingStatus.Sending: A local video stream is being sent.
- VideoSendingStatus.NotSending: No local video is being sent.
To monitor status changes after the call is established, observe Call.videoSendingStatus.
Triggered when the call ends.
After this event, Call.state is CallState.Disconnected and the current call's features are no longer available.
For outgoing calls, the event is triggered after Call.hangup, or when the remote participant ends the call.
For incoming calls, the event is triggered after Call.hangup, when the caller cancels the call, or when the call is answered on another device.
After Call.reject, this event is triggered on the callee side. The caller receives CallEvent.Failed instead.
If a network issue occurs after the call has connected and reconnect does not succeed, this event is triggered as well.
If the call fails to connect, CallEvent.Failed is triggered instead.
Listener is called with CallDisconnected and payload:
Parameters
callId:
string
Call id
headers:
Record<string, string>
OptionalOptional headers passed with the event
reason:
Reason the call has ended
Triggered when the call fails to connect.
After this event, Call.state is CallState.Failed and the current call's features are no longer available.
The event is triggered when the Voximplant Cloud does not establish the connection.
After Call.reject, this event is triggered on the caller side. The callee receives CallEvent.Disconnected instead.
If a network issue occurs while the call is connecting and reconnect does not succeed, this event is triggered as well.
After the call has connected, later termination is reported via CallEvent.Disconnected.
Listener is called with CallFailed and payload:
Parameters
callId:
string
Call id
code:
number
Status code of the call failure
headers:
Record<string, string>
OptionalOptional headers passed with the event
reason:
string
Status message of the call failure
Triggered when an INFO message is received within a call.
Listener is called with CallInfoReceived and payload:
Parameters
body:
string
Body of an INFO message
callId:
string
Call id
headers:
Record<string, string>
OptionalOptional headers passed with the event
mimeType:
${string}/${string}
MIME type of an INFO message
Triggered when a message is received within a call.
Listener is called with CallMessageReceived and payload:
Parameters
callId:
string
Call id
message:
string
Content of the message
Triggered when another call participant has added an audio or video stream to a call.
Listener is called with CallRemoteMediaAdded and payload:
Parameters
callId:
string
Call id
stream:
Remote media stream
type:
Remote media stream type
Triggered when another call participant has removed an audio or video stream from a call.
Listener is called with CallRemoteMediaRemoved and payload:
Parameters
callId:
string
Call id
stream:
Remote media stream
type:
Remote media stream type
Triggered when the Call.ring method is called on the scenario side.
Listener is called with CallStartRinging and payload:
Parameters
callId:
string
Call id
Triggered when call statistics are available for a call.
Listener is called with CallStatsReport and payload:
Parameters
connection:
Media connectivity statistics.
localAudio:
Statistics for all active outgoing audio streams in a call at the moment of the statistics collection.
localVideo:
Statistics for all active outgoing video streams in a call at the moment of the statistics collection.
remote:
{ audio: RemoteAudioStreamStatsReport, video: RemoteVideoStreamStatsReport }
Statistics for all incoming audio and video streams of a call at the moment of the statistics collection.
timestamp:
number
Time at which the call statistics are collected, relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds.
Triggered when the Call.answer or Call.startEarlyMedia method is called on the scenario side.
Listener is called with CallStopRinging and payload:
Parameters
callId:
string
Call id