Skip to main content
Emitted when the call ends normally, for example, when either party hangs up.

Category

Call

Callback Parameters

ParameterTypeDescription
sessionCallSessionThe ended call session
endInfoCallEndInfoInformation about why the call ended

Example

client.on('ended', (session, endInfo) => {
  console.log('Call ended. Cause:', endInfo.cause);
  console.log('Originator:', endInfo.originator);
  console.log('Description:', endInfo.description);
});

More Information

  • failed — fires when the call fails instead of ending normally
  • answered — fires when the call is answered
  • endCall — the method that ends a call
  • CallEndInfo — end info type definition