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 for Speech Recognition and Text-to-Speech. See Voices & Audio
accepts ${{ }}
timeoutinteger61..10 · accepts ${{ }}
minWordsinteger41..10 · accepts ${{ }}
yesHintsarray of string1..10 items · accepts ${{ }}
noHintsarray of string1..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, ""
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?