hangup

View as MarkdownOpen in Claude
1hangup(): Promise<void>

Ends the call and releases all WebRTC resources.

Sends a Verto bye to the server, transitions status$ to disconnecting then disconnected, and destroys the call instance. After the promise resolves, the call object is no longer usable — drop your reference and let it be garbage-collected.

The promise resolves once the local teardown has completed. Server-side cleanup (recording finalization, billing) continues asynchronously and is not awaited.

Returns

Promise<void> — resolves when the local teardown has completed.

Examples

Hang up on user click

1endCallButton.addEventListener('click', async () => {
2 await call.hangup();
3 showCallEndedUI();
4});

Hang up from a status subscription

1call.status$.subscribe(async (status) => {
2 if (status === 'connected' && callTooLong()) {
3 await call.hangup();
4 }
5});

See

  • reject to decline an inbound call before it’s answered.
  • status$ to observe the call’s lifecycle.