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.
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
Attribute | Data Type | Description |
---|---|---|
AMDCause | string | The reasoning for the determination of AMDStatus . |
AMDStatus | string | The 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. |
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
.
Value | Description |
---|---|
HANGUP | The other party hung up before a determination could be made. |
HUMAN | The other party is determined to be human. |
MACHINE | The other party is determined to be machine. |
NOTSURE | It 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.
Attribute | Data Type | Description |
---|---|---|
action | string | Control is passed to this URL after the determination is made whether the other party is human or machine. |
afterGreetingSilence | integer | The 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. |
betweenWordSilence | integer | The minimum duration in milliseconds of silence after a word to consider the following audio a new word. |
greeting | integer | The maximum length in milliseconds of a greeting. If this number of seconds is exceeded, the other party is determined to be machine. |
initialSilence | integer | The 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. |
maximumNumberOfWords | integer | The maximum number of words in the greeting. If this value is exceeded, the other party is determined to be machine. |
maximumWordLength | integer | The maximum duration of voice in milliseconds to be considered a word. |
method | string | The type of request made to the action URL, either POST or GET . |
minimumWordLength | integer | The minimum duration of voice in milliseconds to be considered a word. |
silenceThreshold | integer | A number between 0 and 32767 that is used as the maximum level of noise to be considered silence. |
totalAnalysisTime | integer | The 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"
}