Skip to navigation

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 an 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

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
// Start collection with a control ID you choose, play a prompt, then start timers
const controlId = "pin-collect-1";
await client.calling.collect("call-id-xxx", {
control_id: controlId,
digits: { max: 4, terminators: "#" },
});
// Play a prompt under its own control ID
await client.calling.play("call-id-xxx", [
{ type: "tts", params: { text: "Please enter your 4-digit PIN." } },
], { control_id: "pin-prompt-1" });
// Now start the input timers
await client.calling.collectStartInputTimers("call-id-xxx", controlId);