Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
// Set custom timeout (in seconds)const callSettings = new CometChatCalls.CallSettingsBuilder() .setIdleTimeoutPeriod(300) // 5 minutes .setCallListener(new CometChatCalls.OngoingCallListener({ onSessionTimeout: () => { console.log("Session timed out"); CometChatCalls.endSession(); } })) .build();
Default idle timeout: 180 seconds (3 minutes) alone in a session
Warning dialog appears 60 seconds before auto-termination
Listen for onSessionTimeout to handle auto-termination
Customize with setIdleTimeoutPeriod(seconds) in CallSettings (v4.1.0+)
Available since v4.1.0The Calls SDK automatically terminates call sessions when a participant is alone for too long, preventing abandoned calls from consuming resources. You can customize the timeout duration and handle the termination event.
Set a custom timeout period using setIdleTimeoutPeriod() in CallSettingsBuilder. The warning dialog will always appear 60 seconds before the configured timeout.
TypeScript
JavaScript
const callSettings: any = new CometChatCalls.CallSettingsBuilder() .setIdleTimeoutPeriod(300) // 5 minutes .enableDefaultLayout(true) .setCallListener(callListener) .build();
Listen for onSessionTimeout in your OngoingCallListener to clean up when the call auto-terminates:
TypeScript
JavaScript
const callListener = new CometChatCalls.OngoingCallListener({ onSessionTimeout: () => { console.log("Session timed out due to inactivity"); CometChatCalls.endSession(); // Close the calling screen }, // ... other listeners});
const callListener = new CometChatCalls.OngoingCallListener({ onSessionTimeout: () => { console.log("Session timed out due to inactivity"); CometChatCalls.endSession(); // Close the calling screen }, // ... other listeners});