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

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/jpEUuHUk-hvu4tQT/images/a5ced5be-ongoing_call_overview_cometchat_screens-0bd826025bb7cce39c86684f73d2ece6.png?fit=max&auto=format&n=jpEUuHUk-hvu4tQT&q=85&s=feb37feed0ef775297e01af1b144141c" alt="Image" width="4498" height="3120" data-path="images/a5ced5be-ongoing_call_overview_cometchat_screens-0bd826025bb7cce39c86684f73d2ece6.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/fxK75AS6FzDL1Oqo/images/b96982ed-ongoing_call_overview_cometchat_screens-1e207b02385aa4cf76d109bec623aa56.png?fit=max&auto=format&n=fxK75AS6FzDL1Oqo&q=85&s=aea086a589852cb2c07edfc4d48d127b" alt="Image" width="4498" height="3120" data-path="images/b96982ed-ongoing_call_overview_cometchat_screens-1e207b02385aa4cf76d109bec623aa56.png" />
  </Tab>
</Tabs>

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="App.tsx">
    ```tsx theme={null}
    import { CometChat, CometChatCalls } from "@cometchat/chat-sdk-react-native";
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [loggedInUser, setLoggedInUser] = useState<CometChat.User>();
      useEffect(() => {
        //code
        CometChatUIKit.login({ uid: "uid" })
          .then(async (user: CometChat.User) => {
            setLoggedInUser(user);
          })
          .catch((error: any) => {
            //handle error
          });
      });

      const callSettingsBuilder = new CometChatCalls.CallSettingsBuilder();

      return (
        <>
          {loggedInUser && (
            <CometChatOngoingCall
              sessionID={"session_id"}
              callSettingsBuilder={callSettingsBuilder}
            />
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

### Actions

[Actions](/ui-kit/react-native/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 Banned Members component.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat, CometChatCalls } from "@cometchat/chat-sdk-react-native";
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [loggedInUser, setLoggedInUser] = useState<CometChat.User>();
      useEffect(() => {
        //code
        CometChatUIKit.login({ uid: "uid" })
          .then(async (user: CometChat.User) => {
            setLoggedInUser(user);
          })
          .catch((error: any) => {
            //handle error
          });
      });

      const callSettingsBuilder = new CometChatCalls.CallSettingsBuilder()
        .setIsAudioOnlyCall(true)
        .showRecordingButton(true);

      const onErrorHandler = (error: CometChat.CometChatException) => {
        //code
      };

      return (
        <>
          {loggedInUser && (
            <CometChatOngoingCall
              sessionID={"session_id"}
              callSettingsBuilder={callSettingsBuilder}
              onError={onErrorHandler}
            />
          )}
        </>
      );
    }
    ```
  </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).

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="App.tsx">
    ```tsx theme={null}
    import { CometChat, CometChatCalls } from "@cometchat/chat-sdk-react-native";
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [loggedInUser, setLoggedInUser] = useState<CometChat.User>();
      useEffect(() => {
        //code
        CometChatUIKit.login({ uid: "uid" })
          .then(async (user: CometChat.User) => {
            setLoggedInUser(user);
          })
          .catch((error: any) => {
            //handle error
          });
      });

      const callSettingsBuilder = new CometChatCalls.CallSettingsBuilder()
        .setIsAudioOnlyCall(true)
        .showRecordingButton(true);

      return (
        <>
          {loggedInUser && (
            <CometChatOngoingCall
              sessionID={"session_id"}
              callSettingsBuilder={callSettingsBuilder}
            />
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

### Events

[Events](/ui-kit/react-native/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 OngoingCall does not produce any events but its component does.

***

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

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

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/TO10Bmu50bb5qPTI/images/2cd9f052-ongoing_call_style_cometchat_screens-20291665be2bcd23102ac77084db22f9.png?fit=max&auto=format&n=TO10Bmu50bb5qPTI&q=85&s=d22048417b3b8e9f169e6ca0c6c6137d" alt="Image" width="4498" height="3120" data-path="images/2cd9f052-ongoing_call_style_cometchat_screens-20291665be2bcd23102ac77084db22f9.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/ubfBSdV1t6rmjxeA/images/87015c4d-ongoing_call_style_cometchat_screens-aa44cd756f393167cd68d3e58b53316f.png?fit=max&auto=format&n=ubfBSdV1t6rmjxeA&q=85&s=1b9a26e10bfa1ab86f0e044270aa8695" alt="Image" width="4498" height="3120" data-path="images/87015c4d-ongoing_call_style_cometchat_screens-aa44cd756f393167cd68d3e58b53316f.png" />
  </Tab>
</Tabs>

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

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat, CometChatCalls } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatOngoingCall,
      OngoingCallStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [loggedInUser, setLoggedInUser] = useState<CometChat.User>();
      useEffect(() => {
        //code
        CometChatUIKit.login({ uid: "uid" })
          .then(async (user: CometChat.User) => {
            setLoggedInUser(user);
          })
          .catch((error: any) => {
            //handle error
          });
      });

      const callSettingsBuilder = new CometChatCalls.CallSettingsBuilder()
        .setIsAudioOnlyCall(true)
        .showRecordingButton(true);

      const ongoingCallStyle: OngoingCallStyleInterface = {
        minWidth: 300,
        minHeight: 400,
        maxWidth: 400,
        maxHeight: 500,
      };

      return (
        <>
          {loggedInUser && (
            <CometChatOngoingCall
              sessionID={"session_id"}
              callSettingsBuilder={callSettingsBuilder}
              ongoingCallStyle={ongoingCallStyle}
            />
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

The following properties are exposed by CallscreenStyle:

| Property      | Description                | Code                  |
| ------------- | -------------------------- | --------------------- |
| **maxHeight** | Used to set maximum height | `maxHeight?: number,` |
| **maxWidth**  | Used to set maximum width  | `maxWidth?: number;`  |
| **minHeight** | Used to set minimum height | `minHeight?: number;` |
| **minWidth**  | Used to set minimum width  | `minWidth?: number;`  |

***

### 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="App.tsx">
    ```tsx theme={null}
    import { CometChat, CometChatCalls } from "@cometchat/chat-sdk-react-native";
    import { CometChatOngoingCall } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [loggedInUser, setLoggedInUser] = useState<CometChat.User>();
      useEffect(() => {
        //code
        CometChatUIKit.login({ uid: "uid" })
          .then(async (user: CometChat.User) => {
            setLoggedInUser(user);
          })
          .catch((error: any) => {
            //handle error
          });
      });

      const callSettingsBuilder = new CometChatCalls.CallSettingsBuilder()
        .setIsAudioOnlyCall(true)
        .showRecordingButton(true);

      return (
        <>
          {loggedInUser && (
            <CometChatOngoingCall
              sessionID={"session_id"}
              callSettingsBuilder={callSettingsBuilder}
            />
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

Below is a list of customizations along with corresponding code snippets

| Property      | Description                         | Code                 |
| ------------- | ----------------------------------- | -------------------- |
| **sessionID** | Used to set session Id for the call | `sessionID?: string` |

***

### 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 `OnGoingCall` component does not offer any advanced functionalities beyond this level of customization.

***
