Skip to main content
Implement incoming and outgoing call notifications by integrating the Calls SDK with the CometChat Chat SDK for call signaling.
The Calls SDK handles the actual call session. For call signaling (ringing, accept, reject), use the CometChat Chat SDK’s calling features.

Overview

Call flow with ringing:
  1. Initiator sends a call request via Chat SDK
  2. Receiver gets notified of incoming call
  3. Receiver accepts or rejects the call
  4. Both parties join the call session using Calls SDK

Prerequisites

Install both SDKs:

Initialize Both SDKs

Initiate a Call

Start an outgoing call:
By default, an unanswered call automatically cancels after 45 seconds. You can customize this duration by passing an optional timeout parameter (in seconds) as the second argument to initiateCall().
ParameterTypeDescription
callCallThe call object created with receiver ID, call type, and receiver type.
timeoutnumberOptional. The ringing duration in seconds before an unanswered call is automatically cancelled. Default: 45.

Listen for Incoming Calls

Register a call listener to receive incoming calls:

Accept an Incoming Call

Reject an Incoming Call

Cancel an Outgoing Call

Start the Call Session

Once the call is accepted, join the session using the Calls SDK:

End the Call

Incoming Call UI Example

Outgoing Call UI Example

Cleanup

Remove the call listener when no longer needed: