hold

View as MarkdownOpen in Claude

Put the call on hold. The caller hears hold music until the hold is released or the timeout expires.

Parameters

timeout
intDefaults to 300

Maximum hold duration in seconds. Clamped to the range 0—900 (15 minutes max).

Returns

FunctionResult — self, for chaining.

Example

1from signalwire import AgentBase
2from signalwire import FunctionResult
3
4agent = AgentBase(name="my-agent", route="/agent")
5agent.set_prompt_text("You are a helpful assistant.")
6
7@agent.tool(name="hold_for_agent", description="Place the caller on hold")
8def hold_for_agent(args, raw_data):
9 return (
10 FunctionResult("Please hold while I find an available agent.")
11 .hold(timeout=60)
12 )
13
14agent.serve()