> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Calls

> Class reference for CometChat Calls SDK objects, including call logs, users, groups, participants, recordings, listeners, and media devices.

This page documents the classes used in the CometChat Calls SDK. These objects are returned by call log queries and call session methods.

All properties on proper classes are accessed via getter methods. Listener event objects are plain objects accessed via dot notation.

***

## CallLog

`CallLog` represents a call history entry. It is returned by `CallLogRequestBuilder.fetchNext()` and `CallLogRequestBuilder.fetchPrevious()`.

### Properties

| Property               | Getter                        | Return Type                                          | Description                                                      |
| ---------------------- | ----------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------- |
| sessionId              | `getSessionID()`              | `string`                                             | Unique session ID of the call                                    |
| totalAudioMinutes      | `getTotalAudioMinutes()`      | `number`                                             | Total audio minutes in the call                                  |
| totalVideoMinutes      | `getTotalVideoMinutes()`      | `number`                                             | Total video minutes in the call                                  |
| totalDuration          | `getTotalDuration()`          | `string`                                             | Total duration of the call as a formatted string                 |
| totalDurationInMinutes | `getTotalDurationInMinutes()` | `number`                                             | Total duration in minutes                                        |
| hasRecording           | `getHasRecording()`           | `boolean`                                            | Whether the call has a recording                                 |
| initiatedAt            | `getInitiatedAt()`            | `number`                                             | Timestamp when the call was initiated                            |
| endedAt                | `getEndedAt()`                | `number`                                             | Timestamp when the call ended                                    |
| callCategory           | `getCallCategory()`           | `string`                                             | Category of the call (`"call"` or `"meet"`)                      |
| type                   | `getType()`                   | `string`                                             | Type of the call (`"audio"` or `"video"`)                        |
| status                 | `getStatus()`                 | `string`                                             | Status of the call (`"ongoing"`, `"ended"`, `"cancelled"`, etc.) |
| receiverType           | `getReceiverType()`           | `string`                                             | Receiver type (`"user"` or `"group"`)                            |
| totalParticipants      | `getTotalParticipants()`      | `number`                                             | Total number of participants                                     |
| mid                    | `getMid()`                    | `string`                                             | Message ID associated with the call                              |
| initiator              | `getInitiator()`              | [`CallUser`](#calluser)                              | The user who initiated the call                                  |
| receiver               | `getReceiver()`               | [`CallUser`](#calluser) \| [`CallGroup`](#callgroup) | The user or group that received the call                         |
| participants           | `getParticipants()`           | [`Participant[]`](#participant)                      | Array of call participants                                       |
| recordings             | `getRecordings()`             | [`Recording[]`](#recording)                          | Array of call recordings                                         |

***

## CallUser

`CallUser` represents a user within the Calls SDK context (used in `CallLog` as initiator/receiver).

### Properties

| Property | Getter        | Return Type | Description              |
| -------- | ------------- | ----------- | ------------------------ |
| uid      | `getUid()`    | `string`    | Unique user ID           |
| name     | `getName()`   | `string`    | Display name of the user |
| avatar   | `getAvatar()` | `string`    | URL of the user's avatar |

***

## CallGroup

`CallGroup` represents a group within the Calls SDK context (used in `CallLog` as receiver for group calls).

### Properties

| Property | Getter      | Return Type | Description               |
| -------- | ----------- | ----------- | ------------------------- |
| guid     | `getGuid()` | `string`    | Unique group ID           |
| name     | `getName()` | `string`    | Display name of the group |
| icon     | `getIcon()` | `string`    | URL of the group icon     |

***

## Participant

`Participant` represents a user who participated in a call. It is available via `getParticipants()` on a [`CallLog`](#calllog) object.

### Properties

| Property               | Getter                        | Return Type | Description                                    |
| ---------------------- | ----------------------------- | ----------- | ---------------------------------------------- |
| uid                    | `getUid()`                    | `string`    | Unique user ID                                 |
| name                   | `getName()`                   | `string`    | Display name of the participant                |
| avatar                 | `getAvatar()`                 | `string`    | URL of the participant's avatar                |
| totalAudioMinutes      | `getTotalAudioMinutes()`      | `number`    | Audio minutes for this participant             |
| totalVideoMinutes      | `getTotalVideoMinutes()`      | `number`    | Video minutes for this participant             |
| totalDurationInMinutes | `getTotalDurationInMinutes()` | `number`    | Total duration in minutes for this participant |
| deviceID               | `getDeviceID()`               | `string`    | Device ID of the participant                   |
| hasJoined              | `getHasJoined()`              | `boolean`   | Whether the participant joined the call        |
| joinedAt               | `getJoinedAt()`               | `number`    | Timestamp when the participant joined          |
| leftAt                 | `getLeftAt()`                 | `number`    | Timestamp when the participant left            |
| mid                    | `getMid()`                    | `string`    | Media ID of the participant                    |
| state                  | `getState()`                  | `string`    | State of the participant                       |

***

## Recording

`Recording` represents a call recording. It is available via `getRecordings()` on a [`CallLog`](#calllog) object.

### Properties

| Property     | Getter              | Return Type | Description                          |
| ------------ | ------------------- | ----------- | ------------------------------------ |
| rid          | `getRid()`          | `string`    | Unique recording ID                  |
| recordingUrl | `getRecordingURL()` | `string`    | URL to download the recording        |
| startTime    | `getStartTime()`    | `number`    | Timestamp when the recording started |
| endTime      | `getEndTime()`      | `number`    | Timestamp when the recording ended   |
| duration     | `getDuration()`     | `number`    | Duration of the recording in seconds |

***

## OngoingCallListener

For the full `OngoingCallListener` documentation including all callbacks and parameter shapes, see the [All Real-Time Listeners](/sdk/javascript/all-real-time-listeners#ongoing-call-listener-calls-sdk) page.

***

## CometChatCallsException

`CometChatCallsException` represents an error from the Calls SDK. It is received in the `onError` callback of `OngoingCallListener` and in rejection callbacks of Calls SDK promise-based methods.

### Properties

| Property  | Type                 | Description                              |
| --------- | -------------------- | ---------------------------------------- |
| `code`    | `string` \| `number` | Error code identifying the type of error |
| `name`    | `string`             | Name/category of the error               |
| `message` | `string`             | Human-readable error description         |
| `details` | `string`             | Additional error details                 |

***

## MediaDeviceInfo

`MediaDeviceInfo` represents an audio or video device available on the user's system. It is returned by `getAudioInputDevices()`, `getAudioOutputDevices()`, and `getVideoInputDevices()` methods, and also received in the `onMediaDeviceListUpdated` callback.

These objects follow the browser's [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) interface shape.

### Properties

| Property   | Type     | Description                                                                            |
| ---------- | -------- | -------------------------------------------------------------------------------------- |
| `deviceId` | `string` | Unique device identifier                                                               |
| `kind`     | `string` | Device type (`"videoinput"`, `"audioinput"`, or `"audiooutput"`)                       |
| `label`    | `string` | Human-readable device name                                                             |
| `groupId`  | `string` | Group identifier for related devices (e.g., a headset's mic and speaker share a group) |
