> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# CallEvent (enum)

[CallEvents](/api-reference/websdk5/call/callevents/overview)

**Values**

* [CallUpgrade](/api-reference/websdk5/call/callevents/callevent#callupgrade)
* [Connected](/api-reference/websdk5/call/callevents/callevent#connected)
* [Disconnected](/api-reference/websdk5/call/callevents/callevent#disconnected)
* [Failed](/api-reference/websdk5/call/callevents/callevent#failed)
* [InfoReceived](/api-reference/websdk5/call/callevents/callevent#inforeceived)
* [MessageReceived](/api-reference/websdk5/call/callevents/callevent#messagereceived)
* [RemoteMediaAdded](/api-reference/websdk5/call/callevents/callevent#remotemediaadded)
* [RemoteMediaRemoved](/api-reference/websdk5/call/callevents/callevent#remotemediaremoved)
* [StartRinging](/api-reference/websdk5/call/callevents/callevent#startringing)
* [StatsReport](/api-reference/websdk5/call/callevents/callevent#statsreport)
* [StopRinging](/api-reference/websdk5/call/callevents/callevent#stopringing)

## 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](/api-reference/websdk5/call/callevents/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](/api-reference/websdk5/call/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](/api-reference/websdk5/core/watchable/readonlywatchable)\<[CallUpgradeStatus](/api-reference/websdk5/call/callupgradestatus)>

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

Initially set to [CallUpgradeStatus.Pending](/api-reference/websdk5/call/callupgradestatus#pending).

### Connected

`Connected: "Connected"`

Triggered after a call has been successfully connected.

Listener is called with [CallConnected](/api-reference/websdk5/call/callevents/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](/api-reference/websdk5/call/videosendingstatus)

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

This property is initialized with one of the following [VideoSendingStatus](/api-reference/websdk5/call/videosendingstatus) values:

* [VideoSendingStatus.Sending](/api-reference/websdk5/call/videosendingstatus#sending): A local video stream is being sent.
* [VideoSendingStatus.NotSending](/api-reference/websdk5/call/videosendingstatus#notsending): No local video is being sent.

To monitor status changes after the call is established, observe [Call.videoSendingStatus](/api-reference/websdk5/call/call#videosendingstatus).

**Since:** 5.2.0

### Disconnected

`Disconnected: "Disconnected"`

Triggered when the call ends.

After this event, [Call.state](/api-reference/websdk5/call/call#state) is [CallState.Disconnected](/api-reference/websdk5/call/callstate#disconnected) and the current call's features
are no longer available.

For outgoing calls, the event is triggered after [Call.hangup](/api-reference/websdk5/call/call#hangup), or when the remote
participant ends the call.

For incoming calls, the event is triggered after [Call.hangup](/api-reference/websdk5/call/call#hangup), when the caller cancels
the call, or when the call is answered on another device.

After [Call.reject](/api-reference/websdk5/call/call#reject), this event is triggered on the callee side. The caller receives
[CallEvent.Failed](/api-reference/websdk5/call/callevents/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](/api-reference/websdk5/call/callevents/callevent#failed) is triggered instead.

Listener is called with [CallDisconnected](/api-reference/websdk5/call/callevents/calldisconnected) and payload:

**Parameters**

| Parameter | Type                                                                                  | Requirement | Description                            |
| --------- | ------------------------------------------------------------------------------------- | ----------- | -------------------------------------- |
| `callId`  | `string`                                                                              | Required    | Call id                                |
| `headers` | `Record<string, string>`                                                              | Optional    | Optional headers passed with the event |
| `reason`  | [`CallDisconnectReason`](/api-reference/websdk5/call/callevents/calldisconnectreason) | Required    | Reason the call has ended              |

### Failed

`Failed: "Failed"`

Triggered when the call fails to connect.

After this event, [Call.state](/api-reference/websdk5/call/call#state) is [CallState.Failed](/api-reference/websdk5/call/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](/api-reference/websdk5/call/call#reject), this event is triggered on the caller side. The callee receives
[CallEvent.Disconnected](/api-reference/websdk5/call/callevents/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](/api-reference/websdk5/call/callevents/callevent#disconnected).

Listener is called with [CallFailed](/api-reference/websdk5/call/callevents/callfailed) and payload:

**Parameters**

| Parameter | Type                     | Requirement | Description                            |
| --------- | ------------------------ | ----------- | -------------------------------------- |
| `callId`  | `string`                 | Required    | Call id                                |
| `code`    | `number`                 | Required    | Status code of the call failure        |
| `headers` | `Record<string, string>` | Optional    | Optional headers passed with the event |
| `reason`  | `string`                 | Required    | Status message of the call failure     |

### InfoReceived

`InfoReceived: "InfoReceived"`

Triggered when an INFO message is received within a call.

Listener is called with [CallInfoReceived](/api-reference/websdk5/call/callevents/callinforeceived) and payload:

**Parameters**

| Parameter  | Type                     | Requirement | Description                            |
| ---------- | ------------------------ | ----------- | -------------------------------------- |
| `body`     | `string`                 | Required    | Body of an INFO message                |
| `callId`   | `string`                 | Required    | Call id                                |
| `headers`  | `Record<string, string>` | Optional    | Optional headers passed with the event |
| `mimeType` | `${string}/${string}`    | Required    | MIME type of an INFO message           |

### MessageReceived

`MessageReceived: "MessageReceived"`

Triggered when a message is received within a call.

Listener is called with [CallMessageReceived](/api-reference/websdk5/call/callevents/callmessagereceived) and payload:

**Parameters**

| Parameter | Type     | Requirement | Description            |
| --------- | -------- | ----------- | ---------------------- |
| `callId`  | `string` | Required    | Call id                |
| `message` | `string` | Required    | Content 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](/api-reference/websdk5/call/callevents/callremotemediaadded) and payload:

**Parameters**

| Parameter | Type                                                         | Requirement | Description              |
| --------- | ------------------------------------------------------------ | ----------- | ------------------------ |
| `callId`  | `string`                                                     | Required    | Call id                  |
| `stream`  | [`RemoteStream`](/api-reference/websdk5/stream/remotestream) | Required    | Remote media stream      |
| `type`    | [`StreamType`](/api-reference/websdk5/stream/streamtype)     | Required    | Remote 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](/api-reference/websdk5/call/callevents/callremotemediaremoved) and payload:

**Parameters**

| Parameter | Type                                                         | Requirement | Description              |
| --------- | ------------------------------------------------------------ | ----------- | ------------------------ |
| `callId`  | `string`                                                     | Required    | Call id                  |
| `stream`  | [`RemoteStream`](/api-reference/websdk5/stream/remotestream) | Required    | Remote media stream      |
| `type`    | [`StreamType`](/api-reference/websdk5/stream/streamtype)     | Required    | Remote media stream type |

### StartRinging

`StartRinging: "StartRinging"`

Triggered when the [Call.ring](https://voximplant.com/docs/references/voxengine/call#ring) method is called on the scenario side.

Listener is called with [CallStartRinging](/api-reference/websdk5/call/callevents/callstartringing) and payload:

**Parameters**

| Parameter | Type     | Requirement | Description |
| --------- | -------- | ----------- | ----------- |
| `callId`  | `string` | Required    | Call id     |

### StatsReport

`StatsReport: "StatsReport"`

Triggered when call statistics are available for a call.

Listener is called with [CallStatsReport](/api-reference/websdk5/call/callevents/callstatsreport) and payload:

**Parameters**

`connection` · Required

**Type:** [ConnectionStatsReport](/api-reference/websdk5/statistics/connectionstatsreport)

Media connectivity statistics.

`localAudio` · Required

**Type:** [LocalAudioStreamStatsReport](/api-reference/websdk5/statistics/localaudiostreamstatsreport)

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

`localVideo` · Required

**Type:** [LocalVideoStreamStatsReport](/api-reference/websdk5/statistics/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](/api-reference/websdk5/statistics/remoteaudiostreamstatsreport), video: [RemoteVideoStreamStatsReport](/api-reference/websdk5/statistics/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](https://voximplant.com/docs/references/voxengine/call#answer) or
[Call.startEarlyMedia method](https://voximplant.com/docs/references/voxengine/call#startearlymedia) is called on the scenario side.

Listener is called with [CallStopRinging](/api-reference/websdk5/call/callevents/callstopringing) and payload:

**Parameters**

| Parameter | Type     | Requirement | Description |
| --------- | -------- | ----------- | ----------- |
| `callId`  | `string` | Required    | Call id     |