RELAY events are delivered as typed class instances that wrap the raw JSON-RPC
event payloads from the SignalWire WebSocket connection. When you register a handler
with Call.on() or
Message.on(), the handler
automatically receives a typed event object with named properties for each field.
All typed event classes inherit from RelayEvent, which provides
access to the raw params dictionary alongside the typed properties. You can also
use the parseEvent() helper to manually parse raw event payloads.
Base event class. All other event classes inherit from this. Every handler receives
at minimum a RelayEvent instance, which provides access to the raw event data.
The event type string (e.g., "calling.call.state", "messaging.receive").
See Constants for the full list.
The raw parameters dictionary from the event payload. Contains all event-specific fields, including those not surfaced as typed attributes on subclasses.
The call identifier associated with this event, if applicable.
Server timestamp of the event.
Static method. Parse a raw event object into a RelayEvent instance.
Raw event payload dictionary.
The event type string (e.g., "calling.call.state").
Event-specific parameters.
RelayEvent — A new event instance with typed properties.
Standalone helper function. Parses a raw event object and returns the appropriate
typed event subclass based on the event_type field. Falls back to RelayEvent
for unrecognized event types.
Raw event payload dictionary.
The event type string (e.g., "calling.call.state", "calling.call.play").
Determines which typed subclass is returned.
Event-specific parameters. Contents vary by event type.
RelayEvent — The appropriate typed subclass based on the
event_type field, or a base RelayEvent for unrecognized types.
Emitted when the call state changes through its lifecycle: created ->
ringing -> answered -> ending -> ended.
Handlers for this event receive a CallStateEvent with the following properties:
The new call state.
"created" — call object has been initialized"ringing" — call is ringing at the destination"answered" — call has been answered and is active"ending" — hangup is in progress"ended" — call has been fully terminatedReason the call ended. Only present when callState is "ended".
"hangup" — normal disconnect by a party on the call"cancel" — call was cancelled before being answered"busy" — destination signaled busy"noAnswer" — call rang but was not answered within the timeout"decline" — destination actively declined the call"error" — an error occurred during call processing"abandoned" — caller hung up before the call was answered"max_duration" — call reached the maximum allowed duration"not_found" — destination could not be found or routedCall direction.
"inbound" — incoming call"outbound" — outgoing callDevice information for the call endpoint.
Emitted when an inbound call is received on a subscribed context. This event is
dispatched at the client level via client.onCall() rather than
through call.on().
Handlers for this event receive a CallReceiveEvent with the following properties:
Initial call state (typically "ringing").
Always "inbound" for receive events.
Device information for the caller.
RELAY node handling this call.
SignalWire project ID.
The context the call was received on.
Call segment identifier.
Correlation tag for the call.
Emitted when playback state changes on a play operation.
Handlers for this event receive a PlayEvent with the following properties:
The control ID of the play operation. Matches the control_id on the
PlayAction.
Playback state.
"playing" — audio is actively playing"paused" — playback has been paused"finished" — playback completed successfully"error" — an error occurred during playbackEmitted when recording state changes on a record operation.
Handlers for this event receive a RecordEvent with the following properties:
The control ID of the record operation.
Recording state.
"recording" — audio recording is in progress"paused" — recording has been paused"finished" — recording completed successfully"no_input" — recording ended due to no audio input detectedURL of the recording file (available when state is "finished").
Recording duration in seconds.
Recording file size in bytes.
Full record metadata object containing url, duration, size, and other fields.
Emitted when input collection state changes on a
collect() or
playAndCollect()
operation.
Handlers for this event receive a CollectEvent with the following properties:
The control ID of the collect operation.
Collection state.
"finished" — input was collected successfully"error" — an error occurred during collection"no_input" — no input was detected within the timeout"no_match" — collected input did not match any configured patternsThe collected input result. Contains type and the collected value.
"digit" — DTMF digit input was collected"speech" — speech input was collectedWhether this is the final result. May be undefined for non-continuous collect operations.
Emitted when a connect operation changes state.
Handlers for this event receive a ConnectEvent with the following properties:
Connection state.
"connecting" — bridge is being established to the destination"connected" — bridge has been successfully established"disconnected" — bridge has been disconnected"failed" — connection attempt failedInformation about the connected peer call.
Emitted when detection results arrive from a detect operation.
Handlers for this event receive a DetectEvent with the following properties:
The control ID of the detect operation.
Detection result. Structure depends on the detection type.
"machine" — voicemail or answering machine detection"fax" — fax tone detection"digit" — DTMF digit detectionEmitted when a sendFax() or
receiveFax() operation
changes state.
Handlers for this event receive a FaxEvent with the following properties:
The control ID of the fax operation.
Fax result data including pages, status, and document URL.
Emitted when a tap operation changes state.
Handlers for this event receive a TapEvent with the following properties:
The control ID of the tap operation.
Tap state.
"finished" — tap operation completedTap configuration details.
The device receiving the tapped media.
Emitted when a stream operation changes state.
Handlers for this event receive a StreamEvent with the following properties:
The control ID of the stream operation.
Stream state.
"finished" — stream operation completedThe WebSocket URL the stream is connected to.
The stream name.
Emitted when a send_digits operation changes state.
Handlers for this event receive a SendDigitsEvent with the following properties:
The control ID of the send_digits operation.
Send digits state.
Emitted during outbound dial state changes. This event is dispatched at the
client level rather than through call.on().
Handlers for this event receive a DialEvent with the following properties:
Correlation tag for the dial operation.
Dial state.
"answered" — outbound call was answered"failed" — outbound call failed to connectCall information for the dialed leg.
Emitted when a SIP REFER operation changes state.
Handlers for this event receive a ReferEvent with the following properties:
Refer state.
The SIP URI the call was referred to.
SIP response code from the REFER request.
SIP response code from the NOTIFY message.
Emitted when hold state changes via
hold() or
unhold().
Handlers for this event receive a HoldEvent with the following properties:
Hold state.
Emitted when noise reduction state changes.
Handlers for this event receive a DenoiseEvent with the following properties:
Whether noise reduction is currently active.
Emitted when a pay operation changes state.
Handlers for this event receive a PayEvent with the following properties:
The control ID of the pay operation.
Payment state.
"finished" — payment collection completed"error" — payment operation failedEmitted when an echo operation changes state.
Handlers for this event receive an EchoEvent with the following properties:
Echo state.
Emitted when queue state changes via
queueEnter() or
queueLeave().
Handlers for this event receive a QueueEvent with the following properties:
The control ID of the queue operation.
Queue status.
The queue identifier.
The queue name.
Current position in the queue.
Total number of calls in the queue.
Emitted when conference state changes.
Handlers for this event receive a ConferenceEvent with the following properties:
The conference identifier.
The conference name.
Conference status.
Emitted when a transcribe operation changes state.
Handlers for this event receive a TranscribeEvent with the following properties:
The control ID of the transcribe operation.
Transcription state.
"finished" — transcription completed successfullyURL of the transcription result.
Associated recording ID.
Duration of the transcribed audio in seconds.
Size of the transcription data in bytes.
Emitted when an error occurs on the call.
Handlers for this event receive a CallingErrorEvent with the following properties:
Error code.
Human-readable error description.
Emitted when an inbound SMS/MMS message is received on a subscribed context.
This event is dispatched at the client level via client.onMessage().
Handlers for this event receive a MessageReceiveEvent with the following properties:
Unique identifier for the message.
The messaging context the message was received on.
Always "inbound" for receive events.
Sender phone number in E.164 format.
Recipient phone number in E.164 format.
Text content of the message.
Media URLs for MMS messages.
Number of SMS segments.
State of the message (typically "received").
Tags associated with the message.
Emitted when an outbound message’s state changes (e.g., queued -> sent -> delivered).
Handlers for this event receive a MessageStateEvent with the following properties:
Unique identifier for the message.
The messaging context.
Always "outbound" for state events.
Sender phone number in E.164 format.
Recipient phone number in E.164 format.
Text content of the message.
Media URLs for MMS messages.
Number of SMS segments.
Current message state.
"queued" — message accepted by the platform, waiting to be sent"initiated" — message sending has been initiated"sent" — message has been sent to the carrier"delivered" — message has been delivered to the recipient"undelivered" — message could not be delivered"failed" — message sending failedFailure reason if the message failed or was undelivered.
Tags associated with the message.
Reference table mapping event_type strings to their typed event classes.