Event Reference - Cognigy Documentation
Connection Events
Call Events
| Event |
Description |
Callback Parameters |
| ringing |
Call is ringing (progress). |
(session: CallSession) |
| answered |
Call was answered by the remote party. |
(session: CallSession) |
| ended |
Call ended normally. |
(session: CallSession, endInfo: CallEndInfo) |
| failed |
Call failed to connect or was rejected. |
(session: CallSession, endInfo: CallEndInfo) |
| muted |
Local microphone was muted. |
(session: CallSession) |
| unmuted |
Local microphone was unmuted. |
(session: CallSession) |
Audio Events
| Event |
Description |
Callback Parameters |
| captureAudio |
Remote audio stream is available for advanced processing. Requires captureAudio: true in the client config. |
(stream: MediaStream) |
| audioEnded |
Remote audio stream ended. |
() |
Info Message Events
| Event |
Description |
Callback Parameters |
| infoSent |
Info message was sent successfully. |
(text: string, data: Record<string, any>) |
| infoReceived |
Info message received from the remote party. |
(data: { originator: string, info: { body: string } }) |
Transcription Events
| Event |
Description |
Callback Parameters |
| transcription |
Transcription data received. |
(transcription: { originator: string; messages: { text: string }[] }) |
Error Events
| Event |
Description |
Callback Parameters |
| error |
An error occurred. |
(error: Error) |
Unsubscribing from Events
To remove an event listener, use client.off() with the same event name and callback reference:
const onAnswered = (session) => {
console.log('Call answered:', session.id);
};
// Subscribe
client.on('answered', onAnswered);
// Unsubscribe
client.off('answered', onAnswered);