> ## 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.

# Ongoing Call

> Ongoing Call — CometChat documentation.

## Overview

The `Ongoing Call` is a [Component](/ui-kit/react/v4/components-overview#components) that provides users with a dedicated interface for managing real-time voice or video conversations. It includes features like a video display area for video calls, call controls for mic and camera management, participant information, call status indicators, and options for call recording and screen-sharing.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/Gp90C5sdVtuRR4t7/images/84caaaea-ongoing_calls_overview_web_screens-4c251411ef2f04d9dfd62ec05b3ce031.png?fit=max&auto=format&n=Gp90C5sdVtuRR4t7&q=85&s=bfa101f9b7c8a0af638bcd83bd39f1bf" width="3600" height="2400" data-path="images/84caaaea-ongoing_calls_overview_web_screens-4c251411ef2f04d9dfd62ec05b3ce031.png" />
</Frame>

The `Ongoing Call` is comprised of the following components:

| Components                   | Description                                                                                                                                              |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cometchat-callscreen-wrapper | this component manages the interface for CometChat's call functionality, facilitating structured display and management of ongoing voice or video calls. |

## Usage

### Integration

<Tabs>
  <Tab title="OngoingCallDemo.tsx">
    ```typescript theme={null}
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      return <CometChatOngoingCall />;
    };

    export default OngoingCallDemo;
    ```
  </Tab>

  <Tab title="App.tsx">
    ```typescript theme={null}
    import { OngoingCallDemo } from "./OngoingCallDemo";

    export default function App() {
      return (
        <div className="App">
          <div>
            <OngoingCallDemo />
          </div>
        </div>
      );
    }
    ```
  </Tab>
</Tabs>

### Actions

[Actions](/ui-kit/react/v4/components-overview#actions) dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.

#### 1. onError

This action doesn't change the behavior of the component but rather listens for any errors that occur in the Ongoing component.

<Tabs>
  <Tab title="TypeScript">
    OngoingCallDemo.tsx

    ```typescript theme={null}
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      const handleOnError = () => {
        console.log("your custom on error action");
      };

      return <CometChatOngoingCall onError={handleOnError} />;
    };

    export default OngoingCallDemo;
    ```
  </Tab>

  <Tab title="JavaScript">
    OngoingCallDemo.jsx

    ```javascript theme={null}
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      const handleOnError = () => {
        console.log("your custom on error action");
      };

      return <CometChatOngoingCall onError={handleOnError} />;
    };

    export default OngoingCallDemo;
    ```
  </Tab>
</Tabs>

***

### Filters

**Filters** allow you to customize the data displayed in a list within a `Component`. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using `RequestBuilders` of Chat SDK.

You can adjust the `callSettingsBuilder` in the `OnGoing Call` Component to customize the OnGoing Call. Numerous options are available to alter the builder to meet your specific needs. For additional details on `CallSettingsBuilder`, please visit [CallSettingsBuilder](/sdk/javascript/direct-call).

**Example** In the example below, we are applying a filter to the outgoing call to display only audio calls and include a recording button.

<Tabs>
  <Tab title="TypeScript">
    OngoingCallDemo.tsx

    ```typescript theme={null}
    import { CometChatCalls } from "@cometchat/calls-sdk-javascript";
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      return (
        <CometChatOngoingCall
          callSettingsBuilder={new CometChatCalls.CallSettingsBuilder()
            .setIsAudioOnlyCall(true)
            .showRecordingButton(true)
            .build()}
        />
      );
    };

    export default OngoingCallDemo;
    ```
  </Tab>

  <Tab title="JavaScript">
    OngoingCallDemo.jsx

    ```javascript theme={null}
    import { CometChatCalls } from "@cometchat/calls-sdk-javascript";
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      return (
        <CometChatOngoingCall
          callSettingsBuilder={new CometChatCalls.CallSettingsBuilder()
            .setIsAudioOnlyCall(true)
            .showRecordingButton(true)
            .build()}
        />
      );
    };

    export default OngoingCallDemo;
    ```
  </Tab>
</Tabs>

***

### Events

[Events](/ui-kit/react/v4/components-overview#events) are emitted by a `Component`. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.

The list of events emitted by the OnGoing Call Component is as follows.

| Event           | Description                                                        |
| --------------- | ------------------------------------------------------------------ |
| **ccCallEnded** | This event is triggered when the initiated call successfully ends. |

<Tabs>
  <Tab title="Add Listener">
    ```javascript theme={null}
    const ccCallEnded = CometChatCallEvents.ccCallEnded.subscribe(
      (call: CometChat.Call) => {
        //Your Code
      }
    );
    ```
  </Tab>
</Tabs>

***

<Tabs>
  <Tab title="Remove Listener">
    ```javascript theme={null}
    ccCallEnded?.unsubscribe();
    ```
  </Tab>
</Tabs>

***

## Customization

To fit your app's design requirements, you can customize the appearance of the Ongoing Call component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.

### Style

Using Style you can customize the look and feel of the component in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the component.

#### 1. Ongoing Call Style

To customize the appearance, you can assign a `CallscreenStyle` object to the `Ongoing Call` component.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/TO10Bmu50bb5qPTI/images/30976224-ongoing_calls_style_web_screens-7cd6d5130545d3fe4e9f7fb287e073f6.png?fit=max&auto=format&n=TO10Bmu50bb5qPTI&q=85&s=06472d5a785c160924bf928d3035f8d0" width="3600" height="2400" data-path="images/30976224-ongoing_calls_style_web_screens-7cd6d5130545d3fe4e9f7fb287e073f6.png" />
</Frame>

**Example**

In this example, we are employing the `ongoingCallStyle`.

<Tabs>
  <Tab title="TypeScript">
    OngoingCallDemo.tsx

    ```typescript theme={null}
    import { CometChatCalls } from "@cometchat/calls-sdk-javascript";
    import {
      CometChatOngoingCall,
      CallscreenStyle,
    } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      const ongoingCallStyle = new CallscreenStyle({
        background: "#9764f5",
        maximizeIconTint: "red",
        minimizeIconTint: "white",
      });
      return <CometChatOngoingCall ongoingCallStyle={ongoingCallStyle} />;
    };

    export default OngoingCallDemo;
    ```
  </Tab>

  <Tab title="JavaScript">
    OngoingCallDemo.jsx

    ```javascript theme={null}
    import { CometChatCalls } from "@cometchat/calls-sdk-javascript";
    import {
      CometChatOngoingCall,
      CallscreenStyle,
    } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      const ongoingCallStyle = new CallscreenStyle({
        background: "#9764f5",
        maximizeIconTint: "red",
        minimizeIconTint: "white",
      });
      return <CometChatOngoingCall ongoingCallStyle={ongoingCallStyle} />;
    };

    export default OngoingCallDemo;
    ```
  </Tab>
</Tabs>

The following properties are exposed by CallscreenStyle:

| Property             | Description                    | Code                         |
| -------------------- | ------------------------------ | ---------------------------- |
| **maxHeight**        | Used to set maximum height     | `maxHeight?: string,`        |
| **maxWidth**         | Used to set maximum width      | `maxWidth?: string;`         |
| **minHeight**        | Used to set minimum height     | `minHeight?: string;`        |
| **minWidth**         | Used to set minimum width      | `minWidth?: string;`         |
| **minimizeIconTint** | Used to set minimize icon tint | `minimizeIconTint?: string;` |
| **maximizeIconTint** | Used to set maximize icon tint | `maximizeIconTint?: string;` |
| **border**           | Used to set border             | `border?: string;`           |
| **borderRadius**     | Used to set border radius      | `borderRadius?: string;`     |
| **background**       | Used to set background color   | `background?: string;`       |

***

### Functionality

These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements.

Here is a code snippet demonstrating how you can customize the functionality of the `Ongoing Call` component.

<Tabs>
  <Tab title="TypeScript">
    OngoingCallDemo.tsx

    ```typescript theme={null}
    import { CometChatCalls } from "@cometchat/calls-sdk-javascript";
    import {
      CometChatOngoingCall,
      CallscreenStyle,
    } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      const ongoingCallStyle = new CallscreenStyle({
        background: "#9764f5",
        maximizeIconTint: "red",
        minimizeIconTint: "white",
      });
      return (
        <CometChatOngoingCall
          maximizeIconURL="Your Custom Maximize Icon URL"
          minimizeIconURL="Your Custom Minimize Icon URL"
          resizeIconHoverText="Your Custom Icon Hover Text"
        />
      );
    };

    export default OngoingCallDemo;
    ```
  </Tab>

  <Tab title="JavaScript">
    OngoingCallDemo.jsx

    ```javascript theme={null}
    import { CometChatCalls } from "@cometchat/calls-sdk-javascript";
    import {
      CometChatOngoingCall,
      CallscreenStyle,
    } from "@cometchat/chat-uikit-react";
    import React from "react";

    const OngoingCallDemo = () => {
      const ongoingCallStyle = new CallscreenStyle({
        background: "#9764f5",
        maximizeIconTint: "red",
        minimizeIconTint: "white",
      });
      return (
        <CometChatOngoingCall
          maximizeIconURL="Your Custom Maximize Icon URL"
          minimizeIconURL="Your Custom Minimize Icon URL"
          resizeIconHoverText="Your Custom Icon Hover Text"
        />
      );
    };

    export default OngoingCallDemo;
    ```
  </Tab>
</Tabs>

Default:

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/Gp90C5sdVtuRR4t7/images/84501261-ongoing_calls_functionality_default_web_screens-eb67c059726a3e165c5b6dae0b30895c.png?fit=max&auto=format&n=Gp90C5sdVtuRR4t7&q=85&s=be5ae76b72b602b4f1b3567b06e834da" width="3600" height="2400" data-path="images/84501261-ongoing_calls_functionality_default_web_screens-eb67c059726a3e165c5b6dae0b30895c.png" />
</Frame>

Custom:

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/XgQ9DxAoWn0btB5m/images/5c8fd573-ongoing_calls_functionality_custom_web_screens-c6093f25c260e9bbd29cd0ae65b24026.png?fit=max&auto=format&n=XgQ9DxAoWn0btB5m&q=85&s=402463595765027c7c99e3a3b8a3836f" width="3600" height="2400" data-path="images/5c8fd573-ongoing_calls_functionality_custom_web_screens-c6093f25c260e9bbd29cd0ae65b24026.png" />
</Frame>

Below is a list of customizations along with corresponding code snippets

| Property                           | Description                                                                                                         | Code                                                       |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **maximizeIconURL**                | Used to set custom maximize icon URL                                                                                | `maximizeIconURL='Your Custom Maximize Icon URL'`          |
| **minimizeIconURL**                | Used to set custom minimize icon URL                                                                                | `maximizeIconURL='Your Custom Minimize Icon URL'`          |
| **resizeIconHoverText** [report]() | Used to set custom resize icon hover text                                                                           | `resizeIconHoverText='Your Custom Resize Icon Hover Text'` |
| **callWorkflow** [report]()        | An enum containing the values `defaultCalling` and `directCalling`. This is used to state the type of call.         | `callWorkflow={CallWorkflow.directCalling}`                |
| **sessionID** [report]()           | The unique random session ID. In case you are using default call then session ID is available in the `Call` object. | `sessionID='session ID'`                                   |

***

### Advanced

For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.

the `OnGoing Call` component does not offer any advanced functionalities beyond this level of customization.

***
