detect

View as MarkdownOpen in Claude

Start a detector on an active call. Detectors can identify answering machines, fax tones, or DTMF digits. Returns a control_id for managing the detector.

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.

Examples

Answering Machine Detection

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// Answering machine detection
10const result = await client.calling.detect("call-id-xxx", {
11 detect: {
12 type: "machine",
13 params: {
14 initial_timeout: 4.5,
15 end_silence_timeout: 1.0,
16 }
17 },
18 timeout: 30.0,
19});

Fax Detection

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
9const result = await client.calling.detect("call-id-xxx", {
10 detect: { type: "fax", params: { tone: "CED" } }
11});

Digit Detection

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
9const result = await client.calling.detect("call-id-xxx", {
10 detect: { type: "digit", params: { digits: "0123456789#*" } }
11});