Documentation Index
Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
Use this file to discover all available pages before exploring further.
Returns the current active call session, or null if no call is active.
Signature
const session = client.getCurrentSession();
Parameters
None.
Returns
CallSession | null — the active call session, or null if no call is in progress.
Example
const session = client.getCurrentSession();
if (session) {
console.log('Active call:', session.id);
console.log('Muted:', session.muted);
} else {
console.log('No active call');
}
Toggle Mute Based on Current State
const session = client.getCurrentSession();
if (session) {
if (session.muted) {
await client.unmute();
} else {
await client.mute();
}
}