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. Pass a control_id to name the detector so you can stop it later with detect_stop(). The response never carries control_id back — omit it and you have no way to control this detector afterward.

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

Examples

Answering Machine Detection

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
# Answering machine detection -- name it so it can be stopped later
client.calling.detect(
call_id="call-id-xxx",
control_id="detect-1",
detect={
"type": "machine",
"params": {
"initial_timeout": 4.5,
"end_silence_timeout": 1.0,
}
},
timeout=30.0,
)

Fax Detection

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
result = client.calling.detect(
call_id="call-id-xxx",
detect={"type": "fax", "params": {"tone": "CED"}}
)

Digit Detection

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
result = client.calling.detect(
call_id="call-id-xxx",
detect={"type": "digit", "params": {"digits": "0123456789#*"}}
)