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 (controlId, isDone, completed, result, wait()).

Properties

No additional properties beyond the base Action interface.

Methods

Example

1import { RelayClient } from '@signalwire/sdk';
2
3const client = new RelayClient({
4 project: process.env.SIGNALWIRE_PROJECT_ID!,
5 token: process.env.SIGNALWIRE_API_TOKEN!,
6 contexts: ['default']
7});
8
9client.onCall(async (call) => {
10 await call.answer();
11 const action = await call.record({ direction: 'both', format: 'wav' });
12
13 // Pause during sensitive information
14 await action.pause();
15 // ... sensitive exchange ...
16 await action.resume();
17
18 // Wait for the recording to complete
19 const event = await action.wait();
20 const recordInfo = (event.params.record ?? {}) as Record<string, unknown>;
21 console.log(`Recording URL: ${recordInfo.url}`);
22});
23
24await client.run();