Constants
The signalwire.relay.constants module defines string and numeric constants used
throughout the RELAY namespace for call states, end reasons, connect states, event
types, message states, media operation states, and protocol settings.
Protocol
PROTOCOL_VERSION
RELAY protocol version. Value: {"major": 2, "minor": 0, "revision": 0}.
AGENT_STRING
User agent string sent during connection. Value: "signalwire-agents-python/1.0".
DEFAULT_RELAY_HOST
Default WebSocket host for RELAY connections. Value: "relay.signalwire.com".
JSON-RPC Methods
Internal method identifiers used by the RELAY WebSocket protocol.
Call States
Constants representing the lifecycle states of a RELAY call. A call progresses
through these states in order: created -> ringing -> answered -> ending -> ended.
CALL_STATES
Tuple of all call states in lifecycle order:
("created", "ringing", "answered", "ending", "ended").
End Reasons
Constants for the reason a call ended. Available in
CallStateEvent.end_reason when the call
reaches the ended state.
Connect States
Constants representing the state of a call bridge (connect) operation. Used in
ConnectEvent.connect_state.
Event Types
String constants for all RELAY event types. Use these when registering event
handlers with Call.on() or when
matching against RelayEvent.event_type.
Calling Events
Messaging Events
Authorization Event
Message States
Constants representing the lifecycle states of an SMS/MMS message. Outbound
messages progress through: queued -> initiated -> sent -> delivered
(or undelivered / failed). Inbound messages arrive with state received.
MESSAGE_TERMINAL_STATES
Tuple of terminal states that resolve a Message.wait() call:
("delivered", "undelivered", "failed").
Play States
Constants for audio playback operation states. Used in
PlayEvent.state.
Record States
Constants for recording operation states. Used in
RecordEvent.state.
Detect Types
Constants for detection operation types. Used in the type field of the
detect parameter passed to call.detect().
Room States
Constants for audio/video room join/leave states.
Reconnect Settings
Configuration constants for the WebSocket reconnection strategy.