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

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 without auto-timers, play prompt, then start timers
const result = await client.calling.collect("call-id-xxx", {
digits: { max: 4, terminators: "#" },
});
const controlId = result.control_id;
// Play a prompt first
await client.calling.play("call-id-xxx", {
play: [{ type: "tts", text: "Please enter your 4-digit PIN." }]
});
// Now start the input timers
await client.calling.collectStartInputTimers("call-id-xxx", {
control_id: controlId,
});