B.8. AMD()

Answering machine detection. Attempts to detect an answering machine at the remote end of a call.
AMD([initialSilence[,greeting[,afterGreetingSilence[,totalAnalysisTime[,minWordLength[,betweenWordsSilence[,maxNumberOfWords[,silenceThreshold]]]]]]]])
If a call is initiated through a .call file, you can use AMD() to sense an answering machine at the remote end. Defaults are set in amd.conf.
initialSilence
Maximum duration of silence preceding the remote announcement. If this is exceeded, sets ${AMDSTATUS} to MACHINE.
greeting
Maximum duration of an announcement. If this is exceeded, sets ${AMDSTATUS} to MACHINE.
afterGreetingSilence
Maximum duration of silence following the remote announcement. If this is exceeded, sets ${AMDSTATUS} to HUMAN.
totalAnalysisTime
Maximum duration AMD() is allowed to determine whether remote end is HUMAN or MACHINE.
minWordsSilence
Minimum allowed duration of a sound for it to be considered a word.
betweenWordsSilence
Minimum allowed duration of silence between words.
maxNumberOfWords
Maximum number of words in the announcement. If this is exceeded, sets ${AMDSTATUS} to MACHINE.
silenceThreshold
The silence threshold.
This application delivers its output in the channel variables AMDSTATUS and AMDCAUSE.
AMDSTATUS can be assigned the following values:
  • MACHINE
    The remote end is a machine.
  • HUMAN
    The remote end is a human.
  • NOTSURE
    Threshold cases are indicated with NOTSURE.
  • HANGUP
    The remote end has hung up.
AMDCAUSE can be assigned the following values:
  • TOOLONG-<%d total_time>
  • INITIALSILENCE-<%d silenceDuration>-<%d initialSilence>
  • HUMAN-<%d silenceDuration>-<%d afterGreetingSilence>
  • MAXWORDS-<%d wordsCount>-<%d maximumNumberOfWords>
  • LONGGREETING-<%d voiceDuration>-<%d greeting>
; This extension is called through a .call file:
exten => 10,1,AMD()
exten => 10,n,Goto(Status-${AMDSTATUS})
exten => 10,n(Status-HUMAN),Playback(message)
exten => 10,n,Hangup()
exten => 10,n(Status-MACHINE),Hangup()
exten => 10,n(Status-NOTSURE),Hangup()
exten => 10,n(Status-HANGUP),Hangup()

Note

Internal help for this application in Asterisk 1.4:
  -= Info about application 'AMD' =- 

[Synopsis]
Attempts to detect answering machines

[Description]
  AMD([initialSilence][|greeting][|afterGreetingSilence][|totalAnalysisTime]
      [|minimumWordLength][|betweenWordsSilence][|maximumNumberOfWords]
      [|silenceThreshold])
  This application attempts to detect answering machines at the beginning
  of outbound calls.  Simply call this application after the call
  has been answered (outbound only, of course).
  When loaded, AMD reads amd.conf and uses the parameters specified as
  default values. Those default values get overwritten when calling AMD
  with parameters.
- 'initialSilence' is the maximum silence duration before the greeting. If
   exceeded then MACHINE.
- 'greeting' is the maximum length of a greeting. If exceeded then MACHINE.
- 'afterGreetingSilence' is the silence after detecting a greeting.
   If exceeded then HUMAN.
- 'totalAnalysisTime' is the maximum time allowed for the algorithm to decide
   on a HUMAN or MACHINE.
- 'minimumWordLength'is the minimum duration of Voice to considered as a word.
- 'betweenWordsSilence' is the minimum duration of silence after a word to 
   consider the audio that follows as a new word.
- 'maximumNumberOfWords'is the maximum number of words in the greeting. 
   If exceeded then MACHINE.
- 'silenceThreshold' is the silence threshold.
This application sets the following channel variable upon completion:
    AMDSTATUS - This is the status of the answering machine detection.
                Possible values are:
                MACHINE | HUMAN | NOTSURE | HANGUP
    AMDCAUSE - Indicates the cause that led to the conclusion.
               Possible values are:
               TOOLONG-<%d total_time>
               INITIALSILENCE-<%d silenceDuration>-<%d initialSilence>
               HUMAN-<%d silenceDuration>-<%d afterGreetingSilence>
               MAXWORDS-<%d wordsCount>-<%d maximumNumberOfWords>
               LONGGREETING-<%d voiceDuration>-<%d greeting>
diff output to internal help in Asterisk 1.2:
-- not available in Version 1.2 --