Description
This is an extension module for the Asterisk Gateway Interface (AGI) that adds commands to allow the transfer of audio files to and from Asterisk via the AGI session (in other words, it allows you to copy sound files to and from the Asterisk server, using AGI commands). This is useful when using FastAGI from a remote host; sounds recorded by Asterisk may be retrieved by remote FastAGI-providing service, for example, or sound files required by the remote service may be dynamically added to the Asterisk server.
This module adds the following AGI commands:
- PUT SOUNDFILE <soundfile> <size> - Copy an audio file to the Asterisk server
- GET SOUNDFILE <soundfile> - Copy an audio file from the Asterisk server
- ISEXISTING SOUNDFILE <soundfile> - Check if a specific sound file exists on the Asterisk server
This is a derivative work based on older GPL code from the AGIAddOns module, which is copyright © 2005, Manuel Guesdon. This version provides compatibility with newer versions of Asterisk, and it injects the extra AGI commands into the default AGI handler (so that no dialplan changes are necessary in order to use them, and/or to allow more graceful degradation of service if the extension commands are not available). The audio file transfer protocol is also slightly modified; it sends (and expects) 76 base64-encoded characters per line when transferring data (vs. the original's 72 characters per line) - this makes it slightly easier to use this with legacy/"buggy" base64 encoders such as Python's default string encoder, which base64-encodes any given data as 76-characters lines (i.e. 76 characters followed by a newline character).
Installation
Installation is a 2-part process:
- installation of Asterisk's development header files, and
- installation of the asterisk-agi-audiotx module.
Some of these packages may already be present on your system. Please also refer to the README file included in the source archive.
1. Install Asterisk development files
This module was developed for Asterisk 1.4 or earlier.
Installing Asterisk development files with yum (Fedora) | [−] |
- In a terminal, enter:
yum install asterisk-devel
This will install the development files needed to build asterisk-agi-audiotx.
Installing Asterisk from source | [−] |
Please refer to the documentation that comes with Asterisk for this procedure. It is recommended, however, to use your distribution's version of Asterisk (if available).
2. Install asterisk-agi-audiotx
Installing asterisk-agi-audiotx RPM (Fedora) | [−] |
- Download the latest asterisk-agi-audiotx RPM
- In a terminal, go to the directory where the file was saved
- Install the asterisk-agi-audiotx module (your filename may be slightly different):
rpm -Uhv asterisk-agi-audiotx-0.1-1.rpm
Installing asterisk-agi-audiotx from source | [−] |
- Download the latest version of asterisk-agi-audiotx
- In a terminal, go to the directory where the file was saved
- Extract asterisk-agi-audiotx (the filename may be different from the example below):
tar -xzvf asterisk-agi-audiotx-0.1.tar.gz
- Install the asterisk-agi-audiotx module:
su -c 'make install'
Build the asterisk-agi-audiotx module for your version of Asterisk:
make
make ASTERISKVERSION=1.2or if using Asterisk 1.0:
make ASTERISKVERSION=1.0
Usage
This module simply adds functionality to the existing AGI system. There is no need to use a different application call in your Asterisk dialplan - the standard AGI, EAGI or DeadAGI interface is used (so in extensions.conf, this would something like agi('your_script_here') ).
Type "show agi" at the Asterisk CLI prompt to see the full list of available AGI commands; 3 new commands are added by this module.
Type "show agi put soundfile", "show agi get soundfile", or "show agi isexisting soundfile" to get information on how to use the new AGI commands.
Links
Other Asterisk applications/extension modules by the maintainer of this module:
- asterisk-espeak - dialplan application providing speech synthesis using the eSpeak text-to-speech engine
- asterisk-flite - dialplan application providing speech synthesis using the Flite text-to-speech engine