detectAnsweringMachine

View as Markdown

detectAnsweringMachine

  • detectAnsweringMachine(params?): Promise<CallDetect> - See CallDetect for more details.

Detects the presence of an answering machine.

Parameters

NameTypeDescription
params?Object-
params.endSilenceTimeout?numberNumber of seconds to wait for voice to finish. Defaults to 1.0.
params.initialTimeout?numberNumber of seconds to wait for initial voice before giving up. Defaults to 4.5.
params.machineVoiceThreshold?numberHow many seconds of voice to decide it is a machine. Defaults to 1.25.
params.machineWordsThreshold?numberHow many words to count to decide it is a machine. Defaults to 6.
params.timeout?numberNumber of seconds to run the detector for. Defaults to 30.0.
params.waitForBeep?booleanWhether to wait until the device is ready for voicemail delivery. Defaults to false.
params.detect_interruptions?booleanIf set to true, a NOT_READY event is fired if speech is detected after the READY event. This allows application to restart message delivery to answering machine. Defaults to false.

Returns

Promise<CallDetect> - See CallDetect for more details.

Example

1const detect = await call.detectAnsweringMachine();
2const result = await detect.ended();
3
4console.log("Detect result:", result.type);