> ## Documentation Index
> Fetch the complete documentation index at: https://docs-classic.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Event Reference

> Complete reference for all Click To Call SDK events.

The Cognigy Click To Call SDK uses an event-driven architecture. You can subscribe to events using [`client.on()`](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/on) and unsubscribe using [`client.off()`](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/off). All events are fully typed when using TypeScript.

## Connection Events

| Event | Description | Callback Parameters |
| - | - | - |
| [connecting](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/connecting.md) | SIP connection is starting. | `()` |
| [connected](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/connected.md) | SIP connection established. | `()` |
| [disconnected](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/disconnected.md) | SIP connection lost. | `()` |
| [registered](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/registered.md) | SIP client registered successfully. Endpoints that don't require registration don't emit this event. | `()` |
| [unregistered](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/unregistered.md) | SIP client unregistered. | `()` |

## Call Events

| Event | Description | Callback Parameters |
| - | - | - |
| [ringing](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/ringing.md) | Call is ringing (progress). | `(session: CallSession)` |
| [answered](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/answered.md) | Call was answered by the remote party. | `(session: CallSession)` |
| [ended](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/ended.md) | Call ended normally. | `(session: CallSession, endInfo: CallEndInfo)` |
| [failed](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/failed.md) | Call failed to connect or was rejected. | `(session: CallSession, endInfo: CallEndInfo)` |
| [muted](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/muted.md) | Local microphone was muted. | `(session: CallSession)` |
| [unmuted](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/unmuted.md) | Local microphone was unmuted. | `(session: CallSession)` |

## Audio Events

| Event | Description | Callback Parameters |
| - | - | - |
| [captureAudio](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/capture-audio.md) | Remote audio stream is available for advanced processing. Requires `captureAudio: true` in the client config. | `(stream: MediaStream)` |
| [audioEnded](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/audio-ended.md) | Audio playback stopped. | `()` |

## Info Message Events

| Event | Description | Callback Parameters |
| - | - | - |
| [infoSent](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/info-sent.md) | Info message was sent. | `(text: string, data: Record<string, any>)` |
| [dtmfSent](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/dtmf-sent.md) | DTMF tones were sent. | `(tones: string)` |
| [infoReceived](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/info-received.md) | Info message received from the remote party. | `(data: { originator: string; info: any })` |

## Transcription Events

| Event | Description | Callback Parameters |
| - | - | - |
| [transcription](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/transcription.md) | Transcription data received. | `(data: any)` |

## Error Events

| Event | Description | Callback Parameters |
| - | - | - |
| [error](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/error.md) | An error occurred. | `(error: Error)` |

## Unsubscribing from Events

To remove an event listener, use [`client.off()`](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/off) with the same event name and callback reference:

```typescript theme={null}
const onAnswered = (session) => {
  console.log('Call answered:', session.id);
};

// Subscribe
client.on('answered', onAnswered);

// Unsubscribe
client.off('answered', onAnswered);
```

> [!WARNING]
>
> When using `off()`, you must pass the same function reference that was used with `on()`. Anonymous functions can't be removed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.