REST ClientCalling

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

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9# Answering machine detection
10result = client.calling.detect(
11 call_id="call-id-xxx",
12 detect={
13 "type": "machine",
14 "params": {
15 "initial_timeout": 4.5,
16 "end_silence_timeout": 1.0,
17 }
18 },
19 timeout=30.0,
20)

Fax Detection

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9result = client.calling.detect(
10 call_id="call-id-xxx",
11 detect={"type": "fax", "params": {"tone": "CED"}}
12)

Digit Detection

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9result = client.calling.detect(
10 call_id="call-id-xxx",
11 detect={"type": "digit", "params": {"digits": "0123456789#*"}}
12)