detect_machine
detect_machine
detect_machine
A detection method that combines AMD (Answering Machine Detection) and fax detection.
Detect whether the user on the other end of the call is a machine (fax, voicemail, etc.) or a human.
The detection event(s) will be sent to the specified status_url as a POST request, and the current detection state
or final result will also be saved in the detect_result variable.
An object that accepts the following properties.
If true, stops detection on beep / end of voicemail greeting.
Comma-separated string of detectors to enable. Valid Values: amd, fax
How long to wait for voice activity to finish (in seconds).
How long to wait for initial voice activity before giving up (in seconds).
How long to wait for voice activity to finish before firing the READY event (in seconds).
The number of seconds of ongoing voice activity required to classify as MACHINE.
The minimum number of words that must be detected in a single utterance before classifying the call as MACHINE.
The HTTP(S) URL to deliver detector events to. Learn more about status callbacks.
The maximum time to run the detector (in seconds).
The tone to detect. Only the remote side tone will be received. (CED or CNG) Used for fax detection.
If false, the detector will run asynchronously and status_url must be set. If true, the detector will wait for detection to complete before moving to the next SWML instruction.
The following variables are available after the detect_machine method is executed and detection is complete.
You can reference these variables in your SWML script utilizing the ${variable} syntax.
The lowercase SWML variable value for the current detection state or final result.
Callback lifecycle events such as READY, NOT_READY, and finished are never assigned to this variable.
Whether a beep was detected. true if detected.
The number of milliseconds the detection took.
A POST request will be sent to status_url with a JSON payload like the following:
The type of event, always calling.call.detect for this method.
The channel for the event, includes the SWML session ID.
Unix timestamp (float) when the event was generated.
The project ID associated with the call.
The Space ID associated with the call.
An object containing detection-specific parameters.
The control ID for this detect operation.
Detection result details (see subfields below).
The type of detection. Valid values: machine or fax.
The detector event value in the status callback payload.
Detection outcome values are HUMAN, MACHINE, and UNKNOWN.
Lifecycle marker values are READY, NOT_READY, and finished.
READY, NOT_READY, and finished only appear in callback payloads and are not valid ${detect_result} values.
The lowercase finished value is intentional.
Present and set to true when a beep was detected. Absent when no beep has been detected.
The call ID.
The node handling the call.
The segment ID for this part of the call.