Relay.Calling.Event
This object represents Relay events that occur during calling operations.
Properties​
| Property | Type | Description |
|---|---|---|
name | string | The event name |
payload | object | Raw JSON object of the Relay event |
Event Types​
Calling events include:
calling.call.state- Call state changescalling.call.connect- Call connection eventscalling.call.receive- Incoming call eventscalling.play.state- Play operation state changescalling.record.state- Record operation state changescalling.detect.state- Detect operation state changes
Usage​
Events are typically accessed through result objects or event handlers in the calling system.
// Example of accessing event information
const result = await call.play({ url: 'audio.mp3' });
const event = result.getEvent();
console.log('Event name:', event.name);
console.log('Event payload:', event.payload);