Use case 2—Detecting an answering machine
Voice Platform (specifically, the Voice Browser service) assumes the far end of a call is a live person and uses several factors to support or contradict this assumption. At a high level, these include speech, duration of speech, length of silence, beep, possible ringback, ringback, and other recognized telephony tones.
If the Voice Browser service determines that a live person answers, it processes the call as usual.
Outbound call
If the Voice Browser service determines that an answering machine answers on an outbound call, it throws a nuance.interrupt.device.answering-machine.nss event. The application catches this event and decides what to do, for example, leave an automated voicemail message or cancel the call.
This example leaves a message. The Voice Browser service plays the message in the <prompt> after the beep or after the browser.tonedetection.amd.maxgreeting period expires, whichever comes first.
<form>
<field name="askspecial" type="digits">
<prompt>Hi there! This is a call from PizzaTalk.
We have a special offer this week.
Would you be interested in our two for one special?</prompt>
<grammar src="../grammars/pizza.grxml#YesNo"/>
<filled>
<assign name="interested" expr="askspecial"/>
<goto next="PizzaSpecial.vxml"/>
</filled>
</field>
<catch event="nuance.interrupt.device.answering-machine">
<prompt>This call is from PizzaTalk. Sorry we missed you!
We’re having a sale on pizza this week. If you’re interested,
call us at one five five five, five five five, one one one one.
</prompt>
</catch>
</form>
Call transfer
If the Voice Browser service determines that an answering machine answers on a call transfer, it fills the transfer form-item variable with the appropriate value. For example:
<form id="TransferAMD">
<transfer name="transfer1" dest="DESTINATION" type="bridge"
devicedetection="answering-machine">
</transfer>
</form>
Because Voice Platform ends the transfer and does not throw an event when it detects an answering machine, it’s not possible to leave an automated voicemail message as you can in an outbound call.
It is possible to leave a message on a transfer when answering-machine detection is not enabled. In this case, if an answering machine answers, the call connects as normal. The caller can then speak and leave a message.