Skip to main content
// Start recording
CometChatCalls.startRecording();

// Stop recording
CometChatCalls.stopRecording();

// Listen for recording events (in CallSettings)
const callListener = new CometChatCalls.OngoingCallListener({
  onRecordingStarted: (event) => console.log("Recording started", event.user),
  onRecordingStopped: (event) => console.log("Recording stopped", event.user),
});
Recordings are available on the CometChat Dashboard → Calls section.
Record voice and video calls for playback, compliance, or archival purposes.

Implementation

After setting up Ringing or Call Session, add recording listeners and methods to your call settings. Basic example:
Always remove listeners when they’re no longer needed (e.g., on component unmount or page navigation). Failing to remove listeners can cause memory leaks and duplicate event handling.
// Add listeners onRecordingStarted and onRecordingStopped to the startCall method
const defaultLayout = true;
const audioOnly = false;

const callListener = new CometChatCalls.OngoingCallListener({
  onRecordingStarted: (event) =>
    console.log("Listener => onRecordingStarted", event.user),
  onRecordingStopped: (event) =>
    console.log("Listener => onRecordingStopped", event.user),
});

const callSettings = new CometChatCalls.CallSettingsBuilder()
  .enableDefaultLayout(defaultLayout)
  .setIsAudioOnlyCall(audioOnly)
  .setCallListener(callListener)
  .build();

const htmlElement = document.getElementById("ELEMENT_ID");
CometChatCalls.startSession(callToken, callSettings, htmlElement);

Settings

Configure recording options using CallSettingsBuilder:
SettingDescription
showRecordingButton(showRecordingButton: boolean)If set to true it displays the Recording button in the button Layout. if set to false it hides the Recording button in the button Layout. Default value = false
startRecordingOnCallStart(startRecordingOnCallStart: boolean)If set to true call recording will start as soon as the call is started. if set to false call recording will not start as soon as the call is started. Default value = false
For custom UI without the default layout, use these methods to control recording:

Start Recording

You can use the startRecording() method to start call recording.
CometChatCalls.startRecording();

Stop Recording

You can use the stopRecording() method to stop call recording.
CometChatCalls.stopRecording();

Downloading Recordings

Call recordings are available on the CometChat Dashboard under the Calls section. Click the three-dot menu and select “View Recordings”.

Next Steps

Default Calling

Implement ringing call flows with accept/reject functionality

Call Logs

Retrieve and display call history for users and groups