REST ClientCalling

collect_start_input_timers

View as MarkdownOpen in Claude

Manually start the input timers for a collection that was started without automatic timer activation. This is useful when you want to play a prompt before starting the timer countdown.

Request

idstringRequiredformat: "uuid"
The unique identifying ID of a existing call.
paramsobjectRequired
An object of parameters that will be utilized by the active command.

Response

Call LegobjectRequired
Returned when the call is a standard PSTN, SIP, or WebRTC call.
OR
Fabric Subscriber Device LegobjectRequired

Returned when the call is a Fabric subscriber device leg. The status field is always null for this type.

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9# Start collection without auto-timers, play prompt, then start timers
10result = client.calling.collect(
11 call_id="call-id-xxx",
12 digits={"max": 4, "terminators": "#"},
13)
14control_id = result.get("control_id")
15
16# Play a prompt first
17client.calling.play(
18 call_id="call-id-xxx",
19 play=[{"type": "tts", "text": "Please enter your 4-digit PIN."}]
20)
21
22# Now start the input timers
23client.calling.collect_start_input_timers(
24 call_id="call-id-xxx",
25 control_id=control_id,
26)