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

# disconnect

> Stops audio, ends active sessions, and closes the SIP WebSocket connection.

Disconnects from the SIP server. This method stops audio playback, ends any active call sessions, and closes the SIP WebSocket connection. If the client isn't connected, the method does nothing and resolves. After you disconnect, [`isConnected()`](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/is-connected) returns `false`.

## Signature

```typescript theme={null}
await client.disconnect();
```

## Parameters

None.

## Returns

`Promise<void>`

## Throws

An error if disconnecting fails, for example, if the SDK can't stop the SIP connection. The error messages start with `Failed to disconnect:`.

## Example

```typescript theme={null}
await client.disconnect();
console.log('Disconnected from SIP server');
```

## More Information

* [connect](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/connect.md)
* [destroy](https://docs-classic.cognigy.com/click-to-call/sdk/api-reference/destroy.md)
* [disconnected](https://docs-classic.cognigy.com/click-to-call/sdk/event-reference/disconnected.md) event


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