Skip to navigation

CallEvent (enum)

Web SDK v5 API reference
View as Markdown

CallEvents

Values

CallUpgrade

CallUpgrade: "CallUpgrade"

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:

Since: 5.2.0

Parameters

accept · Required

Type: () => void

Accepts the call upgrade request and enables video receiving for the call.

To also send local video, use Call.addStream after accepting.

Returns: void

reject · Required

Type: () => void

Rejects the call upgrade request.

The call continues as audio only.

Returns: void

callId · Required

Type: string

Call id

upgradeStatus · Required

Type: ReadonlyWatchable<CallUpgradeStatus>

Watchable property that reflects the current state of the call upgrade request.

Initially set to CallUpgradeStatus.Pending.

Connected

Connected: "Connected"

Triggered after a call has been successfully connected.

Listener is called with CallConnected and payload:

Parameters

callId · Required

Type: string

Call id

headers · Optional

Type: Record<string, string>

Optional headers passed with the event

videoSendingStatus · Required

Type: VideoSendingStatus

Local video sending status at the moment when the call is connected.

This property is initialized with one of the following VideoSendingStatus values:

To monitor status changes after the call is established, observe Call.videoSendingStatus.

Since: 5.2.0

Disconnected

Disconnected: "Disconnected"

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

ParameterTypeRequirementDescription
callIdstringRequiredCall id
headersRecord<string, string>OptionalOptional headers passed with the event
reasonCallDisconnectReasonRequiredReason the call has ended

Failed

Failed: "Failed"

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

ParameterTypeRequirementDescription
callIdstringRequiredCall id
codenumberRequiredStatus code of the call failure
headersRecord<string, string>OptionalOptional headers passed with the event
reasonstringRequiredStatus message of the call failure

InfoReceived

InfoReceived: "InfoReceived"

Triggered when an INFO message is received within a call.

Listener is called with CallInfoReceived and payload:

Parameters

ParameterTypeRequirementDescription
bodystringRequiredBody of an INFO message
callIdstringRequiredCall id
headersRecord<string, string>OptionalOptional headers passed with the event
mimeType${string}/${string}RequiredMIME type of an INFO message

MessageReceived

MessageReceived: "MessageReceived"

Triggered when a message is received within a call.

Listener is called with CallMessageReceived and payload:

Parameters

ParameterTypeRequirementDescription
callIdstringRequiredCall id
messagestringRequiredContent of the message

RemoteMediaAdded

RemoteMediaAdded: "RemoteMediaAdded"

Triggered when another call participant has added an audio or video stream to a call.

Listener is called with CallRemoteMediaAdded and payload:

Parameters

ParameterTypeRequirementDescription
callIdstringRequiredCall id
streamRemoteStreamRequiredRemote media stream
typeStreamTypeRequiredRemote media stream type

RemoteMediaRemoved

RemoteMediaRemoved: "RemoteMediaRemoved"

Triggered when another call participant has removed an audio or video stream from a call.

Listener is called with CallRemoteMediaRemoved and payload:

Parameters

ParameterTypeRequirementDescription
callIdstringRequiredCall id
streamRemoteStreamRequiredRemote media stream
typeStreamTypeRequiredRemote media stream type

StartRinging

StartRinging: "StartRinging"

Triggered when the Call.ring method is called on the scenario side.

Listener is called with CallStartRinging and payload:

Parameters

ParameterTypeRequirementDescription
callIdstringRequiredCall id

StatsReport

StatsReport: "StatsReport"

Triggered when call statistics are available for a call.

Listener is called with CallStatsReport and payload:

Parameters

connection · Required

Type: ConnectionStatsReport

Media connectivity statistics.

localAudio · Required

Type: LocalAudioStreamStatsReport

Statistics for all active outgoing audio streams in a call at the moment of the statistics collection.

localVideo · Required

Type: LocalVideoStreamStatsReport

Statistics for all active outgoing video streams in a call at the moment of the statistics collection.

mos · Required

Type: MOSReport

Mean opinion score metrics for the call audio.

Since: 5.4.0

remote · Required

Type: { audio: RemoteAudioStreamStatsReport, video: RemoteVideoStreamStatsReport }

Statistics for all incoming audio and video streams of a call at the moment of the statistics collection.

timestamp · Required

Type: number

Time at which the call statistics are collected, relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds.

StopRinging

StopRinging: "StopRinging"

Triggered when the Call.answer or Call.startEarlyMedia method is called on the scenario side.

Listener is called with CallStopRinging and payload:

Parameters

ParameterTypeRequirementDescription
callIdstringRequiredCall id