destroy()
Destroys the call object and frees all associated resources. After destroy() completes, isDestroyed() returns true and any further method calls on the instance will throw an error.
If the call is still active when destroy() is called, it will leave the call automatically before releasing resources — so you can call destroy() directly without a prior leave(). Call leave() instead when you want to end the current session but reuse the call object for a future join() or want access to the call object’s state before destroying it.
Return value
Returns aPromise<void> that resolves once all resources have been released.