CallState
Payload for call state events that are triggered by the change in state of an active RELAY-controlled call.
Obtain instances of this state Callback request by including a call_state_url parameter when starting a call with one of the following methods:
Parameters
The value will be "calling.call.state".
ID for the event channel on which these room session’s events are reported.
Time of the event.
ID for the SignalWire Space associated with the call.
ID for the project associated with the call.
Event-specific parameters. This object contains the following fields.
ID for the node this call is on.
ID for the call.
Client data this call is tagged with.
Protocol-specific connection information including the device type, from_number, and to_number.
Information on the call that created this call including the parent device_type, node_id, and call_id.
Information on the peer call this call is actively connected with including the peer node_id and call_id.
The current state that triggered this event. Possible values are "created", "ringing", "answered", "ending", and "ended".
The start time of the call in milliseconds since epoch.
The time the call was answered in milliseconds since epoch.
The time the call ended in milliseconds since epoch.
The method associated with this call state change. Possible values are "dial", "connect", and "receive".
Example
To receive call state webhook notifications, specify a callStateUrl when building your device configuration with Voice.DeviceBuilder.Phone:
Your webhook endpoint will receive POST requests with the CallState payload. Example Express.js handler:
For real-time call state changes within your SDK application without webhooks, use the onStateChanged event on the Call object instead.