text
stringlengths
0
152
Chapter 16: Introduction to Interactive Voice Response
near-miraculous feats of processing; something your IVR might not be able to fully
harness.
Text-to-Speech
Text-to-speech (also known as speech synthesis) requires that a system be able to arti‐
ficially construct speech from stored data. While it would be nice if we could simply
assign a sound to a letter and have the computer produce each sound as it reads the
letters, written language is often not phonetic, and seldom reflects the nuances of
speech (English is arguably one of the worst languages in this regard).
There are now excellent APIs available from Google (and others), that will do a very
good job of reading back what has been written. As of this writing, it’s still very obvi‐
ous that it’s a computer speaking, but it is nevertheless possible to generate system
prompts on the fly from text, rather than having to record all prompts in advance.
The usefulness of this is difficult to evaluate, since humans are still not interested in
talking to your machines; they phoned because they want to talk to you.
Speech Recognition
Since we’ve managed to convince our computers to talk to us, we naturally want to be
able to talk to them as well.3
Speech recognition was previously complex and expensive, but Google has recently
released an API that allows the enormous power of their speech recognition capabili‐
ties to be available to external applications.
Conclusion
Asterisk is an excellent IVR platform. This entire book, in many ways, is teaching you
skills that can be applied to IVR development. While the mainstream media only
really pays attention to Asterisk as a “free PBX,” the reality is that Asterisk is at its
most potent when used as an IVR. Within any respectable-sized organization, it is
very likely that the Linux system administrators are using Asterisk to solve telecom
problems that previously were either unsolvable or impossibly expensive to solve.
This is a stealthy revolution, but no less significant for its relative obscurity.
If you are in the IVR business, you need to get to know Asterisk.
3 Actually, most of us talk to our computers, but this is seldom polite.
Conclusion
|
297
CHAPTER 17
Asterisk Manager Interface and Call Files
John Malkovich: I have seen a world that NO man should see!
Craig Schwartz: Really? Because for most people it’s a rather enjoyable experience.
—Being John Malkovich
The Asterisk Manager Interface (AMI) is a system monitoring and management
interface provided by Asterisk. It allows live monitoring of events that occur in the
system, as well as enabling requests for Asterisk to perform some action. The avail‐
able actions are wide-ranging and include things such as returning status information
or originating new calls. Many interesting applications have been developed on top of
Asterisk that use the AMI as their primary interface to Asterisk.
This chapter also includes documentation on the use of call files. Asterisk’s call files
are an easy way to originate a few calls. Once call origination volume increases or
your needs become otherwise more complex, you can move on to using the AMI. In
fact, we find call files to be useful enough that we’re going to talk about them first.
Call Files
It is common to use AMI for originating calls, but in many situations it’s easier to use
call files. A call file is a simple text file that describes the call that you would like
Asterisk to originate. When a call file is placed into the /var/spool/asterisk/outgoing
directory, Asterisk will immediately detect that a file has been placed there and pro‐
cess the call.
Asterisk comes with a sample call file, which you will find at ~/src/asterisk-15.<TAB>/
sample.call (or wherever the root directory of your Asterisk source is located).
299
Your First Call File
For your first call file, let’s create a call between two of your telephones. Make sure
you have at least two of your phones registered and working. For this example we’ll
be using SOFTPHONE_A and SOFTPHONE_B.
Create the following file in your home directory:
$ vim ~/call-file
Channel: PJSIP/SOFTPHONE_A
Extension: 103
Context: sets
Make a copy of this file (so that you don’t have to re-create it every time you want to
run it):
$ cp ~/call-file docall
Change the ownership of the docall file to asterisk:
$ chown asterisk:asterisk docall