amd@v3

Answering Machine Detection.

Versionamd@v3
Runs ininbound-call and your own branches

Parameters

NameTypeRequiredDefaultDescription
ttsobjectText-to-speech prompt: text (1 to 1024 characters), with an optional voice or language (exclusive). Without them, the defaults of the branch or of the scenario apply. text-to-speech prompt: text, and voice or language
audioFileobjectAn audio file of your library, by its SID (REST API v2 identifier). audio file of your library: sid
languageaf-ZA, am-ET, ar-AE… (140 values)Language of the speech recognition (what the callee says). The prompt is also spoken in this language, unless it has its own voice or language. See Voices & Audio
accepts ${{ }}
timeoutinteger6Seconds to listen before giving up. The result is then neither machine nor human.
1..10 · accepts ${{ }}
minWordsinteger4If the callee says at least this number of words, it is considered an answering machine (a human usually just says hello).
1..10 · accepts ${{ }}
yesHintsarray of stringWords that mean an answering machine when the callee says them (case-insensitive), for example voicemail or message.
1..10 items · accepts ${{ }}
noHintsarray of stringWords that mean a human when the callee says them (case-insensitive), for example hello.
1..10 items · accepts ${{ }}

Every parameter that accepts ${{ }} can be computed from an expression.

How it works

AMD is for Answering Machine Detection Same as amd@v2, with the same prompt parameters as play@v3: tts (text-to-speech) or audioFile (audio file of your library). Set at most one of them. Key presses are ignored.

Examples

Short example

- action: amd@v3
  params:
    timeout: 4
    yesHints:
      - message
      - voicemail
  result: $amd

Full example with defaults

- action: amd@v3
  params:
    tts: # or audioFile: { sid: 'fdsanjkf' }, or none
      text: Hello? # (1..1024 characters)
      # voice: en-US-AvaMultilingual # or language: en-US (default: the language below)
    # language: en-US # stt language (default: the scenario defaults)
    timeout: 6 # 1..10
    minWords: 4 # if at least minWords words are said, it is considered a voicemail
    yesHints: # words that would match a voicemail (none by default, 1..10)
      - voicemail
    noHints: # words that would match a human (none by default, 1..10)
      - hello
  result: $amd

Using the result

- if: $amd.detected == 'machine'
  then:
    - action: log@v1
      params:
        message: Machine detected
    - action: hangup@v1

Result

Set result: $myVariable to keep it. Result of amd@v2 and amd@v3 (Answering Machine Detection)

FieldTypeDescription
okbooleantrue when a decision was made (detected is not empty)
timeoutbooleantrue when no decision was made in time
errorstringOnly present on error: hangup when the callee hung up, canceled, or the error message
detectedmachine, human, ""Who answered the call.
recognizedstringThe hint that matched, or the text said when minWords was reached
{
  "ok": true,
  "timeout": false,
  "detected": "machine",
  "recognized": "voicemail"
}

Older versions

Older versions keep working in existing scenarios. Use the version above in new scenarios.

  • amd@v2: Answering Machine Detection
  • amd@v1: Use amd@v2 instead amd@v1 is deprecated, use amd@v3

Did this page help you?