unhold

View as MarkdownOpen in Claude

Release the call from hold, resuming normal audio between the parties.

This method emits calling.call.hold events. See Call Events for payload details.

Parameters

None.

Returns

Promise<Record<string, unknown>> — Server response confirming the unhold operation.

Example

1import { RelayClient } from '@signalwire/sdk';
2
3const client = new RelayClient({
4 project: process.env.SIGNALWIRE_PROJECT_ID!,
5 token: process.env.SIGNALWIRE_TOKEN!,
6 contexts: ['default']
7});
8
9client.onCall(async (call) => {
10 await call.answer();
11 await call.play([{ type: 'tts', text: 'Please hold while I look that up.' }]);
12
13 // Put the call on hold
14 await call.hold();
15
16 // Do some processing...
17 await new Promise((resolve) => setTimeout(resolve, 5000));
18
19 const result = await call.unhold();
20 console.log(`Call resumed from hold: ${JSON.stringify(result)}`);
21 await call.play([{ type: 'tts', text: 'Thanks for holding. I have your answer.' }]);
22});
23
24await client.run();