Quick Reference for AI Agents & Developers// Session timeout is automatic - no configuration needed
// Default behavior:
// - After 120 seconds alone: dialog appears
// - After 180 seconds alone: call auto-terminates
// Handle session timeout in call listeners
CometChatCalls.addCallEventListeners(
"UNIQUE_LISTENER_ID",
CallEventsListener(
onSessionTimeout: () {
debugPrint("Call ended due to session timeout");
},
),
);
Default Timing: 120s warning dialog → 60s countdown → auto-terminate
Available since v4.1.0
Overview
CometChat Calls SDK provides a mechanism to handle session timeouts for idle participants. By default, if a participant is alone in a call session for 180 seconds (3 minutes), the following sequence is triggered:
-
After 120 seconds of being alone in the session, the participant will see a dialog box
-
This dialog provides options to either:
- Stay in the call
- Leave immediately
-
If no action is taken within the next 60 seconds, the call will automatically end
This feature helps manage inactive call sessions and prevents unnecessary resource usage. The idle timeout period ensures that participants don’t accidentally remain in abandoned call sessions.
Session Timeout Flow
The onSessionTimeout event is triggered when the call automatically terminates due to session timeout, as illustrated in the diagram above.
Next Steps