detect_answering_machine
detect_answering_machine
Detect a human versus an answering machine. A typed convenience over
detect() that builds the {"type": "machine", "params": {...}}
configuration for you. All parameters are keyword-only, and only the ones you
set are sent.
Parameters
initial_timeout
Seconds to wait for initial voice before deciding.
end_silence_timeout
Seconds of silence that end the greeting.
machine_voice_threshold
Seconds of continuous voice above which the greeting is treated as a machine.
machine_words_threshold
Word count above which the greeting is treated as a machine.
detect_interruptions
When True, detect the caller interrupting during the machine greeting
playback.
detect_message_end
Whether to keep listening for the end of a machine’s message, so you can leave one after the beep.
timeout
Maximum seconds to run the detector before stopping. Keyword-only.
on_completed
Callback invoked when the operation reaches a terminal state. Can be a regular function or async coroutine. Keyword-only.
Returns
DetectAction — An action handle with stop() and wait() methods. It resolves on the first detection result.