Actions
Action objects are returned from call control methods like
play(),
record(), and
detect(). They provide a common
interface for tracking and controlling in-progress operations on a
Call.
All action classes extend a shared base that provides is_done, completed,
result, control_id, and the wait() method. Specific action types add
methods relevant to their operation (e.g., pause() and resume() on
PlayAction).
Action (Base Interface)
All action classes share these properties and methods.
Properties
control_id
Unique identifier for this operation, used to correlate commands and events.
is_done
True if the underlying future has resolved (the operation has reached a terminal state).
completed
True once the action has finished and the terminal event has been processed.
result
The terminal RelayEvent for this action,
or None if the action has not yet completed.
Methods
wait
wait(timeout=None) -> RelayEvent
Block until the action completes and return the terminal event.
timeout
Maximum seconds to wait. None waits indefinitely. Raises asyncio.TimeoutError
if exceeded.
Subclasses
Tracks audio playback. Supports pause, resume, volume, and stop.
Tracks recording. Supports pause, resume, and stop.
Tracks play-and-collect. Supports stop, volume, and input timers.
Tracks detection (answering machine, fax, digits). Stop only.
Tracks standalone input collection. Stop and input timers.
Tracks fax send/receive. Stop only.
Tracks media interception. Stop only.
Tracks audio streaming to WebSocket. Stop only.
Tracks payment collection. Stop only.
Tracks transcription. Stop only.
Tracks an AI agent session. Stop only.