Andrew's Asterisk Stuff


VM next message mods:

Also See: Digium bug ID #12254
vm-goingtofirst.wav Going to the first message.
vm-goingtolast.wav Going to the last message.
vm14.patch.gz

I have an old PBX VM system that allowed me to wrap around during voicemail message selection. At the first message I am able to select "previous" and have it jump back to the last message (so I could keep playing them in reverse order). Similar for the last message, it allows me to select "next" and it will jump to the first message. This does not force a change to the order of playback it just allows you to go in a circle to get the message you want quickly.

This new feature is enabled by default but can be disabled in the voicemail.conf file. The system knows if there are no messages, or just one, and does not play the prompts for prev/next since it's pointless.

This patch is for Branch 1.4.

Included english audio files are not correctly licensed for distribution with asterisk and should be re-recorded to match the other asterisk prompts anyway.

vm-goingtofirst.wav "Going to the first message."
vm-goingtolast.wav "Going to the last message."

Copy WAV files to /var/lib/asterisk/sounds (and transcode as needed).
Copy patch to main asterisk source directory and run patch -p0 <vm.patch and rebuild.


TTS Mods:

I gave up on Festival for Text To Speech (TTS). It did not sound good, it failed to produce audio, it locked up all the time, but it was free...

I now use Cepstral as a cost effective (but not free) solution.

Cepstral is easy to use, supports Linux and Solairs, works well, sounds very good, and has a choice of voices including Allison (who records the packaged prompts for Asterisk). They offer full demo downloads so you can test a working setup before you pay for it.

At their current prices, it's $30 for the each voice and a single queued FIFO license (no matter how may voices you have paid for). For additional "ports" (concurrent use) it's $50/each in addition to the voices. You have to pay for at least 2 total concurrent uses ($100) to get beyond the FIFO setup.

There are at least three ways to use Cepstral with Asterisk:

Aplications

app_swiftcache

I wrote the appliction named app_swiftcache that shares app_swift's config file and automaticly builds speech audio sound files. It does an MD5 hash on the text (including the default voice name) and checks to see if it has already been recorded to a cached audio file, if not it records the audio to a new file. The file name of the wave sound file is returned (in local channel variable SWIFTCACHE_FILE) so it can be used by the Playback or Background application (like any other standard sound file). If a name is not retuned then there was a problem recording the file.

Config options include:

Examples

Addition to swift.conf:
[cache]
directory=/var/lib/asterisk/swiftcache
generalinfofile=speech.txt
individualinfofile=yes
forcerebuild=no
autorebuild=0

Addition to extensions.conf:
exten => 440,n,Swift(Allison likes bigfoot.)

exten => 441,n,SwiftCache(Allison likes bigfoot.)
exten => 441,n,Playback(${SWIFTCACHE_FILE})
In 440 speech audio is sent directly to the channel.
In 441 the speech audio is saved in the file stored in SWIFTCACHE_FILE which allows you to call any Asterisk application that uses a sound file.
You could also setup a nightly script to transcode cached wave files into other formats so asterisk would need to do even less work on playback.


Transfer Mod:

Also See: Digium bug ID #9239

After an attended SIP transfer is completed play a beep.
This is a standard feature of 1.6

Patch file for 1.4 (branch): transfer_beep_14.patch.gz
Copy patch file to your main asterisk source directory
run patch in Asterisk directory: patch -p0 <transfer_beep_14.patch
rebuild and install

I just add this to the [global] section of the extensions config file: ATTENDED_TRANSFER_COMPLETE_SOUND=beep


FAX Mods:

Also See: Digium bug ID #10815
Also See: Digium bug ID #11614
Also See: Digium bug ID #11796

Install additional packages needed (debian examples: apt-get install autoconf)
Download SPANDSP 0.0.4 (currently version 0.0.4pre18)
Configure SPANDSP: ./configure
Install SPANDSP: make install
Install apps in asterisk apps directory.
modified: apps/app_rxfax.c
modified: apps/app_txfax.c
updated patch: fax.patch (for branch 1.4 04-Dec-2007)
Copy patch file to your main asterisk source directory
run patch in Asterisk directory: patch -p0 <fax.patch
remake the asterisk configure files: bootstrap.sh
enable the applications from menuselect: make menuselect
Build Asterisk: make

Dialplan example:


[default]
exten => 8605551212,1,Macro(rxfax-email,someone@somewhere.nett)

[macro-rxfax-email]
exten => s,1,Answer()
exten => s,n,Set(TIMESTAMP=${STRFTIME(,EST5EDT,%Y%m%d-%H%M%S)})
exten => s,n,Set(FILEID=${TIMESTAMP}_${UNIQUEID})
exten => s,n,Set(FAXPAGES=0)
exten => s,n,RxFAX(/tmp/fax-${FILEID}.tif)
exten => s,n,Hangup()

exten => h,1,NoOp("Finish with RxFax")
exten => h,n,GotoIf(${FAXPAGES}>0?process:done)
exten => h,n(process),system(/usr/bin/tiff2pdf -z -n -f /tmp/fax-${FILEID}.tif | /usr/bin/mime-construct --header "From: FAX " --to "${ARG1}" --subject "FAX from ${REMOTESTATIONID} - ${FAXPAGES} Pages" --string "FAX PDF Attached" --type application/pdf --attachment "fax.pdf" --file - --output | /usr/lib/sendmail -F"FAX" -f"fax@somwhere.nett" "${ARG1}")
exten => h,n(done),system(/bin/rm /tmp/fax-${FILEID}.tif)
exten => h,n,Hangup()

Remote called Party ID:

Also See: Digium bug ID #8824

My current patch I use for Branch 1.4 remote_id_branch.patch (updated 11-Nov-2007)
Copy patch file to your main asterisk source directory
run patch in Asterisk directory: patch -p0 <remote_id_branch.patch
enable the dialplan function from menuselect: make menuselect
Build Asterisk: make



older stuff

G.722 Mods:

SVN rev 114550 of 1.4 is needed for G.722 support.
Upgrade to Asterisk 1.6 and get official support.


G.722 codec patch for Branch 1.4 back ported...
g722-20071001.patch
g722-20071005.patch (minor update to include frame.c change)
g722-20080110.patch.gz updated with trunk code from 10-Jan-2008, assumes branch 1.4 updates from the same date
Copy patch file to your main asterisk source directory
run patch in Asterisk directory: patch -p0 <g722-20080110.patch
Enable the G.722 codec from menuselect: make menuselect
Build Asterisk: make

Notes:


Codec Negotiation:

Also See: Digium bug ID #4825
I have nothing to do with this patch, but I think it should be part of Asterisk... Asterisk Codec Negotiation Patch