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

Examples

Answering Machine Detection

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
// Answering machine detection
const result = await client.calling.detect("call-id-xxx", {
detect: {
type: "machine",
params: {
initial_timeout: 4.5,
end_silence_timeout: 1.0,
}
},
timeout: 30.0,
});

Fax Detection

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
const result = await client.calling.detect("call-id-xxx", {
detect: { type: "fax", params: { tone: "CED" } }
});

Digit Detection

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
const result = await client.calling.detect("call-id-xxx", {
detect: { type: "digit", params: { digits: "0123456789#*" } }
});