System information
To enable peer caching in Asterisk, use the rtcachefriends option in sip.conf:
rtcachefriends=yes
There are additional realtime options as well, such as rtsavesysname, rtupdate, rtauto
clear, and ignoreregexpire. These are all explained in the sip.conf.sample file located
within your Asterisk source.
Text-to-Speech Utilities
Text-to-speech utilities are used to convert strings of words into audio that can be
played to your callers. Text-to-speech has been around for many years, and has been
continually improving. While we can’t recommend text-to-speech utilities to take the
place of professionally recorded prompts, they do offer some degree of usefulness in
applications where dynamic data needs to be communicated to a caller.
Festival
Festival is one of the oldest running applications for text-to-speech on Linux. While
the quality of Festival is not sufficient for us to recommend it for production use, it is
certainly a useful way of testing a text-to-speech-based application. If a more polished
sound is required for your application, we recommend you look at Cepstral (covered
next).
Installing Festival on CentOS
Installing Festival and its dependencies on CentOS is straightforward. Simply use
yum to install the festival package:
$ sudo yum install festival
Installing Festival on Ubuntu
To install Festival and its dependencies on Ubuntu, simply use apt-get to install the
festival package:
$ sudo apt-get install festival
Using Festival with Asterisk
With Festival installed, we need to module the festival.scm file in order to enable
Asterisk to connect to the Festival server. On both CentOS and Ubuntu, the file is
located in /usr/share/festival/. Open the file and place the following text just above the
last line, (provide 'festival):
(define (tts_textasterisk string mode)
"(tts_textasterisk STRING MODE)
Apply tts to STRING. This function is specifically designed for
use in server mode so a single function call may synthesize the string.
440 | Chapter 18: External Services