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

1from signalwire.relay import RelayClient
2
3client = RelayClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7 contexts=["default"],
8)
9
10@client.on_call
11async def handle_call(call):
12 await call.answer()
13 action = await call.record(audio={"direction": "both", "format": "wav"})
14
15 # Pause during sensitive information
16 await action.pause()
17 # ... sensitive exchange ...
18 await action.resume()
19
20 # Wait for the recording to complete
21 event = await action.wait()
22 print(f"Recording URL: {event.params.get('record', {}).get('url')}")
23
24client.run()