> ## 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.

# failed

> The failed event fires when a Click To Call call fails to connect or is rejected.

Emitted when a call fails to connect or is rejected. The [`audioEnded`](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/audio-ended) event is emitted before this event. In the `endInfo` object, `description` is the SIP status code as a string, for example, `486`, when the remote party rejects the call.

## Category

Call

## Callback Parameters

| Parameter | Type | Description |
| - | - | - |
| `session` | [`CallSession`](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/types#callsession) | The failed call session. |
| `endInfo` | [`CallEndInfo`](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/types#callendinfo) | Information about why the call failed. |

## Example

```typescript theme={null}
client.on('failed', (session, endInfo) => {
  console.error('Call failed. Cause:', endInfo.cause);
  console.error('Originator:', endInfo.originator);
  console.error('Description:', endInfo.description);
});
```

## More Information

* [ended](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/ended.md)
* [error](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/error.md)
* [CallEndInfo](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/types.md#callendinfo)


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