Skip to main content
Disconnects from the SIP server, ends any active call, and releases all resources. This method calls disconnect(), then releases the internal resources of the client, clears the cached configuration, and removes all event listeners. Call this method when the client is no longer needed, for example, on page unload. If you call it more than once, the later calls do nothing. After you destroy the client, you can’t reuse the instance. If you call connect() on it, the call fails with Client has been destroyed.

Signature

Parameters

None.

Returns

Promise<void>

Throws

An error if the cleanup process fails. The error messages start with Failed to destroy client:.

Example

Cleanup on Page Unload

More Information

Last modified on October 23, 2026