text
stringlengths
0
152
can automatically reprompt the user. The default is one attempt.
timeout
The number of seconds the caller has to enter his input. The default value in Asterisk is 10 seconds,
although it can be altered for a single prompt using this option, or for the entire session by assigning a
value using the dialplan function TIMEOUT(response).
Once the input is received, it must be validated. If you do not validate the input, you
are more likely to find your callers complaining of an unstable application. It is not
enough to handle the inputs you are expecting; you also need to handle inputs you do
not expect. For example, callers may get frustrated and dial 0 when in your IVR; if
you’ve done a good job, you will handle this gracefully and connect them to some‐
body who can help them, or provide a useful alternative. A well-designed IVR (just
like any program) will try to anticipate every possible input and provide mechanisms
to gracefully handle that input.
Once the input is validated, you can submit it to an external resource for processing.
This could be done via a database query, a submission to a URI, an AGI program, or
many other things. This external application should produce a result, which you will
want to relay back to the caller. This could be a detailed result, such as “Your account
balance is…” or a simple confirmation, such as “Your account has been updated.” We
can’t think of any real-world case where some sort of result returned to the caller is
not required.
Sometimes the IVR may have multiple steps, and therefore a result might include a
request for more information from the caller in order to move to the next step of the
IVR application.
It is possible to design very complex IVR systems, with dozens or even hundreds of
possible paths. We’ve said it before and we’ll say it again: people don’t like talking to
your phone system, regardless of how clever it is. Keep your IVR simple for your call‐
ers, and they are much more likely to get some benefit from it.
Components of an IVR
|
291
A Perfectly Tasty IVR
An excellent example of an IVR that people love to use is one that many pizza deliv‐
ery outfits use: when you call to place your order, an IVR looks up your caller ID and
says “If you would like the exact same order as last time, press 1.”
That’s all it does, and it’s perfect.
Obviously, these companies could design massively complex IVRs that would allow
you to select each and every detail of your pie (“for seven-grain crust, press 7”), but
how many inebriated, starving customers could successfully navigate something like
that at 3 A.M.?
The best IVRs are the ones that require the least input from the caller. Mash that 1
button and your ’za is on its way! Woo hoo!
IVR Design Considerations
When designing your own IVR, there are some important things to keep in mind.
We’ve put together this list of things to do and things not to do in your IVR.
Do
• Keep it simple.
• Have an option to dial 0 to reach a live person.
• Handle errors gracefully.
Don’t
• Think that an IVR can completely replace people.
• Use your IVR to show people how clever you are.
• Try to replicate your website with an IVR.
• Bother building an IVR if you can’t take numeric or spoken input. Nobody wants
to have to spell their name on the dialpad of a phone.1
• Force your callers to listen to advertising. Remember that they can hang up at
any moment they wish.
1 Especially if it’s something like Van Meggelen.
292
|
Chapter 16: Introduction to Interactive Voice Response
Asterisk Modules for Building IVRs
The “frontend” of the IVR (the parts that interact with the callers) can be handled in
the dialplan. It is possible to build an IVR system using the dialplan alone (perhaps
with the astdb to store and retrieve data); however, you will typically need to commu‐
nicate with something external to Asterisk (the “backend” of the IVR).
CURL()
The CURL() dialplan function in Asterisk allows you to span entire web applications
with a single line of dialplan code. We’ll use it in our sample IVR later in this chapter.