A common issue that crops up on the forum from time to time is leaving voicemails on an answering machine when an outbound IVR call is not picked up by a human. Many times, developers would write IVR test code to act on a callee type of “answeringmachine” and wonder why a voicemail was not left on their cell phone.
So, we typically suggest to developers to use the following IVR code:
<?php
header(”Content-type: text/xml”);
echo(”<?xml version=\”1.0\”?>\n”);
$calleetype = $_POST['callee_type'];
?>
<vxml version=”2.0″>
<form id=”mainmenu”>
<var name=”callee_type” expr=”‘<?= $calleetype ?>’”/>
<record cond=”callee_type==’answeringmachine’” finalsilence=”2000ms”/>
<block>
<prompt>
Hello! This is a reminder to take your medicine today.
</prompt>
</block>
</form>
</vxml>
From this IVR code, if the callee is an answering machine, the VoiceXML application initially goes to the <record> tag to account for the answering message that gets played at the beginning of a voicemail. Once that message gets played, the VoiceXML application then plays the prompt, “Hello! This is a reminder to take your medicine today”, which is the message that gets left on the voicemail.
However, one thing that IVR developers need to keep in mind is that callee type detection for outbound is 94% accurate. This means that every once in a while, the outbound system will mistake an answering machine for a human and vice versa. The consequence of this behavior is that a voicemail message may get cut off at the beginning or a message may not be left at all.
Thus, for applications that require a voicemail message be left on an answering machine 100% of the time, we suggest that the IVR developer repeat the message numerous times. For example:
<?php
header(”Content-type: text/xml”);
echo(”<?xml version=\”1.0\”?>\n”);
?>
<vxml version=”2.0″>
<property name=”inputmodes” value=”dtmf”/>
<form id=”message”>
<field name=”leavemsg”>
<grammar type=”application/x-jsgf” mode=”dtmf”>(0|1|2|3|4|5|6|7|8|9|”#”|”*”)</grammar>
<prompt>
Hello! This is an application from your hospital. Please press 1 to continue. Please remember to call the phone number listed in your e-mail to reserve your appointment. Hello! This is an application from your hospital. Please press 1 to continue. Please remember to call the phone number listed in your e-mail to reserve your appointment. Hello! This is an application from your hospital. Please press 1 to continue. Please remember to call the phone number listed in your e-mail to reserve your appointment. Hello! This is an application from your hospital. Please press 1 to continue. Please remember to call the phone number listed in your e-mail to reserve your appointment. Hello! This is an application from your hospital. Please press 1 to continue. Please remember to call the phone number listed in your e-mail to reserve your appointment.
</prompt>
<filled>
<prompt>
Here is a different message that should be played to a human.
</prompt>
<goto next=”#confirmtransfer”/>
</filled>
</field>
</form>
<form id=”confirmtransfer”>
<field name=”leavemsg”>
<grammar type=”application/x-jsgf” mode=”dtmf”>1</grammar>
<prompt>
Would you like to be tranferred? Press 1 for yes.
</prompt>
<filled>
<prompt>
Okay, please hold while we transfer you.
</prompt>
<goto next=”#maketransfer”/>
</filled>
</field>
</form>
<form id=”maketransfer”>
<transfer dest=”tel:+1XXXXXXXXXX”/>
</form>
</vxml>
From this IVR example, the outbound IVR call will leave a voicemail that keeps on repeating the prompt, “Hello! This is an application from your hospital. Please press 1 to continue. Please remember to call the phone number listed in your e-mail to reserve your appointment.” if no one picks up and enters 1 on their phone keypad.
If the IVR outbound call is picked up by a human and the human presses 1 on their phone keypad, then a different message will be played and the human will be prompted to enter 1 on their phone keypad if they want to be transferred.
Leave a Reply