RelayActions

RecordAction

View as MarkdownOpen in Claude

Returned from call.record(). Tracks an active recording operation. Terminal states: finished, no_input.

Inherits all properties and methods from the base Action interface (control_id, is_done, completed, result, wait()).

Properties

No additional properties beyond the base Action interface.

Methods

Example

from signalwire.relay import RelayClient
client = RelayClient(
project="your-project-id",
token="your-api-token",
contexts=["default"],
)
@client.on_call
async def handle_call(call):
await call.answer()
action = await call.record(audio={"direction": "both", "format": "wav"})
# Pause during sensitive information
await action.pause()
# ... sensitive exchange ...
await action.resume()
# Wait for the recording to complete
event = await action.wait()
print(f"Recording URL: {event.params.get('record', {}).get('url')}")
client.run()