Turn it on
AMD is a setting on the application, off by default. Turn it on for the stream or Autopilot agent that takes your calls.- Dashboard
- SDK
- CLI
- Stream: go to Streams, open the stream, go to the Call handling tab, and turn on Detect answering machines.
- Autopilot agent: open the agent, go to the Advanced tab, choose Edit on the Call handling panel, and turn on Detect answering machines.
A longer window gives a surer answer, but your application waits longer for it. Voicemail
greetings are often long and steady, so the default window is enough for most calls.
Read the result
Once per call, a stream gets anamd.result event:
The call stays up while detection runs. Your application has the call from the moment it’s
answered, so it can speak right away, or wait for the result first.
How long it takes
Detection starts listening when the call is answered and the window starts when the other side begins to speak. The result arrives shortly after the window ends. If nobody speaks within 4 seconds, the result isunknown with the reason no_speech. A person
who picks up and stays quiet looks like that too, so treat unknown as “maybe a person”: greet them
and listen.
Pick a strategy
Use
confidence to be careful: for example, hang up on voicemail only when confidence is above
0.8.
Inbound calls and Autopilot agents
AMD runs on every call the application takes, inbound too. It’s most useful on outbound calls. Streams with thetwilio protocol don’t get the event, because Twilio Media Streams has no message
for it. In Python, listen with session.on("amd.result", handler) the same way.
An Autopilot agent doesn’t act on the result: it talks to whoever answers. The result is still saved
in the call’s call record, so you can see afterwards how many calls reached
voicemail.
The amd fields are in
Autopilot configuration, and the
amd.result event is in the Voice SDK reference.
Next steps
Make outbound calls
Place the calls that AMD checks.
DTMF
Get through phone menus with keypad tones.
Build a stream with the Voice SDK
Handle the result in your own code.
Call records
Find the AMD result of past calls.