collectStartInputTimers

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

1import { RestClient } from "@signalwire/sdk";
2
3const client = new 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
10const result = await client.calling.collect("call-id-xxx", {
11 digits: { max: 4, terminators: "#" },
12});
13const controlId = result.control_id;
14
15// Play a prompt first
16await client.calling.play("call-id-xxx", {
17 play: [{ type: "tts", text: "Please enter your 4-digit PIN." }]
18});
19
20// Now start the input timers
21await client.calling.collectStartInputTimers("call-id-xxx", {
22 control_id: controlId,
23});