detectAnsweringMachine
detectAnsweringMachine
- detectAnsweringMachine(
params?):Promise<CallDetect>
Detects the presence of an answering machine.
Parameters
params
Object containing the parameters for answering machine detection.
timeout
Number of seconds to run the detector for.
waitForBeep
Whether to wait until the device is ready for voicemail delivery.
initialTimeout
Number of seconds to wait for initial voice before giving up.
endSilenceTimeout
Number of seconds to wait for voice to finish.
machineReadyTimeout
Number of seconds to wait for voice to finish before firing the READY event. Default is the value of endSilenceTimeout.
machineVoiceThreshold
How many seconds of voice to decide it is a machine.
machineWordsThreshold
How many words to count to decide it is a machine.
detectInterruptions
If set to true, a NOT_READY event is fired if speech is detected after the READY event. This allows the application to restart message delivery to the answering machine.
Returns
Promise<CallDetect>
A promise that resolves to a CallDetect object that you can use to
view the current state and results of the detect session.
Example
In this example, we dial a phone number and wait for the answering machine detection to finish. Once the detection is finished, we log the result and then play a TTS message. At the end of the TTS message, we hangup the call.