RELAYCall

hold

View as MarkdownOpen in Claude

Put the call on hold. The remote party hears hold music or silence while the call is held.

Use unhold() to release the call from hold.

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

Parameters

None.

Returns

dict — Server response confirming the hold operation.

Example

1import asyncio
2from signalwire.relay import RelayClient
3
4client = RelayClient(
5 project="your-project-id",
6 token="your-api-token",
7 host="your-space.signalwire.com",
8 contexts=["default"],
9)
10
11@client.on_call
12async def handle_call(call):
13 await call.answer()
14 await call.play([{"type": "tts", "text": "Please hold while I look that up."}])
15
16 result = await call.hold()
17 print(f"Hold started: {result}")
18
19 # Do some processing...
20 await asyncio.sleep(5)
21
22 # Take the call off hold
23 await call.unhold()
24
25client.run()