
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
346
|
Chapter 14: Traditional Apps on the Converged Network
Project 14.4. Create Custom Sounds to Interact with Callers
What you need for this project:
• Asterisk
• A sound recording application (optional)
• SoX (http://sox.sourceforge.net)
Interactive voice response is the backbone of voice mail, but there’s so much more
you can do with it. You could replace pen-and-paper time cards and punch clocks.
You could use it to perform billing functions, such as collecting a credit card num-
ber and storing it in a database. But in order to make all these things cohesive to the
caller (the user), your user interface will have to be customized. This means using,
and making, sounds.
Use a prerecorded sound for a simple paging routine
We’ll start with a quick little dial-plan tool that allows us to send quick emails. This
will allow us to use one of Asterisk’s prerecorded sounds. In this example, we’ll build
a basic numeric pager. It will screen an incoming call, record the caller’s phone num-
ber, and email it to an SMTP recipient with instructions to “please call” the number.
exten => *89,1,Read(PhoneNo|allison7/enter-phone-number10|10)
exten => *89,2,System('echo Please call ${PhoneNo}. | mail user@oreilly.com')
exten => *89,3,Playback(thank-you)
exten => *89,4,Hangup( )
Figure 14-1. Asterisk’s vmail.cgi ...