on
Register a listener for events on this call. The handler is called each time an event of the specified type is received. Handlers can be regular functions or async functions.
Parameters
eventType
The event type string to listen for (e.g., "calling.call.state",
"calling.call.play"). See the Events section
on the Call page for class-level events, or individual method pages for
method-specific events.
handler
Function to invoke when the event fires. Receives a
RelayEvent instance.
Returns
void