Skip to main content

Amd (experimental)

Definition

AMD stands for Answering Machine Detection. The experimental Amd verb attempts to determine whether the other party is human or machine. The determination of the other party's status will be returned in a callback and possible returned values will be as follows.

tip

Refer to our FlexML AMD Application quick start guide to learn more about how you can protect your destination from spammers with the help of Amd verb.

AMD Callback Attributes

AttributeData TypeDescription
AMDCausestringThe reasoning for the determination of AMDStatus.
AMDStatusstringThe determination made about the other party, whether they are HUMAN or MACHINE. Alternatively, the determination can also be NOTSURE or HANGUP. Please refer to the table below for values that can be returned.
info

For a list of the other parameters and values to expect in action requests, refer to the FlexML Call Flow section.

AMDStatus Values

These values can be returned as AMDStatus.

ValueDescription
HANGUPThe other party hung up before a determination could be made.
HUMANThe other party is determined to be human.
MACHINEThe other party is determined to be machine.
NOTSUREIt was not determined definitively whether the other party is human or machine.

Supported Attributes

These attributes can be used to modify the Amd verb. They are inserted as name-value pairs in the start-tag.

AttributeData TypeDescription
actionstringControl is passed to this URL after the determination is made whether the other party is human or machine.
afterGreetingSilenceintegerThe length of silence in milliseconds after a greeting is detected. If this number of seconds is exceeded, then the other party is determined to be human.
betweenWordSilenceintegerThe minimum duration in milliseconds of silence after a word to consider the following audio a new word.
greetingintegerThe maximum length in milliseconds of a greeting. If this number of seconds is exceeded, the other party is determined to be machine.
initialSilenceintegerThe maximum duration of silence in milliseconds before the greeting will begin. If this second value is exceeded, the other party is determined to be machine.
maximumNumberOfWordsintegerThe maximum number of words in the greeting. If this value is exceeded, the other party is determined to be machine.
maximumWordLengthintegerThe maximum duration of voice in milliseconds to be considered a word.
methodstringThe type of request made to the action URL, either POST or GET.
minimumWordLengthintegerThe minimum duration of voice in milliseconds to be considered a word.
silenceThresholdintegerA number between 0 and 32767 that is used as the maximum level of noise to be considered silence.
totalAnalysisTimeintegerThe maximum duration in milliseconds allowed for the algorithm to decide whether the other party is human or machine.

Nesting Rules

  • You cannot nest other verbs or nouns within the Amd verb.
  • You cannot nest the Amd verb within other FlexML verbs.

Example

In this example, the Amd verb will attempt to detect whether or not the other party is human or machine. If no greeting has been made before 5 seconds, the other party is determined to be machine. If the greeting exceeds 2 seconds, then the other party is determined to be machine. Additionally, the other party is determined to be human if the post-greeting silence exceeds 0.5 seconds.

When a determination has been made, or the totalAnalysisTime of 10 seconds has elapsed, a callback will be sent to the action URL via POST method.

<Response>
<Amd action="http://www.example.com/path/to/handler"
method="POST"
initialSilence="5000"
greeting="2000"
afterGreetingSilence="500"
totalAnalysisTime="10000" />
</Response>

A successful request returns a JSON response that looks like the following:

{
"AccountSid": "",
"AMDCause": "HUMAN-500-500",
"AMDStatus": "HUMAN",
"ApiVersion": "2.0",
"CallerName":"",
"CallSid":"4695bc4a0932bcd2e99492e523db9ee2",
"Direction":"inbound",
"From":"15162065338",
"OriginalFrom":"+15162065338",
"OriginalTo":"15162065337",
"RequestUrl":"https://sampleurl.com/example",
"To":"15162065337"
}