Files
asterisk/contrib
Terry Wilson 177d65f59c Add TLS cert helper script
This script is useful for quickly generating self-signed CA, server, and client
certificates for use with Asterisk. It is still recommended to obtain
certificates from a recognized Certificate Authority and to develop an
understanding how SSL certificates work. Real security is hard work.

OPTIONS:
  -h  Show this message
  -m  Type of cert "client" or "server". Defaults to server.
  -f  Config filename (openssl config file format)
  -c  CA cert filename (creates new CA cert/key as ca.crt/ca.key if not passed)
  -k  CA key filename
  -C  Common name (cert field)
        For a server cert, this should be the same address that clients
        attempt to connect to. Usually this will be the Fully Qualified
        Domain Name, but might be the IP of the server. For a CA or client
        cert, it is merely informational. Make sure your certs have unique
        common names.
  -O  Org name (cert field)
        An informational string (company name)
  -o  Output filename base (defaults to asterisk) 
  -d  Output directory (defaults to the current directory)

Example:

To create a CA and a server (pbx.mycompany.com) cert with output in /tmp:
  ast_tls_cert -C pbx.mycompany.com -O "My Company" -d /tmp

This will create a CA cert and key as well as asterisk.pem and the the two
files that it is made from: asterisk.crt and asterisk.key. Copy asterisk.pem
and ca.crt somewhere (like /etc/asterisk) and set tlscertfile=/etc/asterisk.pem
and tlscafile=/etc/ca.crt. Since this is a self-signed key, many devices will
require you to import the ca.crt file as a trusted cert.

To create a client cert using the CA cert created by the example above:
  ast_tls_cert -m client -c /tmp/ca.crt -k /tmp/ca.key -C "Joe User" -O \
    "My Company" -d /tmp -o joe_user

This will create client.crt/key/pem in /tmp. Use this if your device supports
a client certificate. Make sure that you have the ca.crt file set up as
a tlscafile in the necessary Asterisk configs. Make backups of all .key files
in case you need them later.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 16:49:34 +00:00
..
2010-10-21 18:13:18 +00:00
2010-10-22 16:49:34 +00:00

app_festival is an application that allows one to send text-to-speech commands
to a background festival server, and to obtain the resulting waveform which
gets sent down to the respective channel. app_festival also employs a waveform 
cache, so invariant text-to-speech strings ("Please press 1 for instructions") 
do not need to be dynamically generated all the time. 

You need : 

1) festival, patched to produce 8khz waveforms on output. Patch for Festival
1.4.2 RELEASE are included. The patch adds a new command to festival 
(asterisk_tts). 

It is possible to run Festival without patches in the source-code. Just
add this to your /etc/festival.scm or /usr/share/festival/festival/scm:

    (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.
    This function name may be added to the server safe functions."
    (let ((wholeutt (utt.synth (eval (list 'Utterance 'Text string)))))
    (utt.wave.resample wholeutt 8000)
    (utt.wave.rescale wholeutt 5)
    (utt.send.wave.client wholeutt)))

[See the comment with subject "Using Debian
 festival >= 1.4.3-15 (no recompiling needed!)" on
 http://www.voip-info.org/wiki-Asterisk+festival+installation for the
 original mentioning of it]

2) You may wish to obtain and install the asterisk-perl
module by James Golovich <james@gnuinter.net>, from 
either CPAN, or his site: http://asterisk.gnuinter.net,
as this contains a good example of how variable text
can be tts'd via asterisk, namely the examples/tts-*.agi
files there. It has been noted that the current expression
evaluation capabilities of asterisk are not best suited
for the generation and manipulation of text. AGI scripting
can be ideal for these sorts of needs. For simpler usage,
fixed, pre-recorded messages may be more amenable for your
purposes.

3) Before running asterisk, you have to run festival-server with a command 
like : 

/usr/local/festival/bin/festival --server > /dev/null 2>&1 &