Skip to main content
Ends the current active call.

Signature

await client.endCall();

Parameters

None.

Returns

Promise<void>

Throws

An error if there is no active session to terminate or if the termination fails.

Example

await client.endCall();
console.log('Call ended');

With Error Handling

try {
  await client.endCall();
} catch (error) {
  console.error('Failed to end call:', error.message);
}

More Information

  • startCall — start a call
  • disconnect — disconnect from the SIP server after ending the call
  • ended event — fires when the call ends normally
  • failed event — fires when the call fails