Call
The Call class represents a live Relay call and provides methods for
controlling every aspect of the call — answering, playing audio, recording,
collecting input, bridging, conferencing, AI agents, and more. Call objects are
created automatically by RelayClient
when an inbound call arrives or when you dial an outbound call.
All call control methods are async and communicate with SignalWire over
WebSocket using the Relay JSON-RPC protocol. Methods that start long-running
operations (play, record, detect, etc.) return Action
objects that let you stop, pause, or wait for the operation to complete.
Properties
call_id
Unique identifier for this call, assigned by SignalWire.
node_id
Identifier of the Relay node handling this call.
project_id
SignalWire project ID that owns this call.
context
The context (routing label) the call is associated with.
tag
Correlation tag for tracking related calls. Empty string if not set.
direction
Call direction. Valid values:
"inbound"— incoming call"outbound"— outgoing call
device
Device information for the call endpoint. Contains type (e.g., "phone") and
params (e.g., {"from_number": "+1...", "to_number": "+1..."}).
state
Current call state. Valid values:
"created"— call has been initiated"ringing"— ringing at the destination"answered"— call is active"ending"— hangup in progress"ended"— call has terminated
segment_id
Call segment identifier for tracking call legs.
Methods
Example
Events
Events are emitted during the lifecycle of a call and its operations. Register
handlers using call.on() to react
to state changes, errors, and operation completions.
See the Events reference for the full list of calling events, their parameters, and typed event classes.