Andrew's Asterisk Stuff - Last Update: 28-Apr-2009



VM Wrap to next message mod:

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 (about the same version as 1.4.23).

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). Speech quality was poor, it failed to produce audio sometimes, it locked up all the time, but it is free...

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

Cepstral is easy to install, supports Linux and Solairs, works well, sounds good most of the time, 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 single port FIFO setup.

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

There are a few other applications for Cepstral/Swift including app_swift by Will Orton and app_swift by Darren Sessions

Aplication

app_swift

I wrote the appliction named app_swift that uses the swift.conf file and supports several dialplan apps.
I have a new version I'll post shortly (May) that supports 1.4 and 1.6 in the same program with new CLI support. Also, 16kHz support for 1.6 SwiftCache 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 application Playback, Background, Read, or any other app that supports a 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,SwiftBackground(Allison likes bigfoot.)
exten => 442,n,SwiftCache(Allison likes bigfoot.)
exten => 442,n,Playback(${SWIFTCACHE_FILE})
In 440 speech audio is sent directly to the channel (does not stop for DTMF).
In 441 speech audio is sent directly to the channel and allows the caller to dial a new extension.
In 442 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 Beep 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:

I am now using app_fax.c backported from 1.6 with SPANDSP 0.0.6pre10
Here is a patch that others are using that did not work for me, but it's a good start.
I am using a different updated version based on the above patch.
The T.38 code is ifdef'd out so it should compile with a standard version of asterisk 1.4. Any existing T.38 code has not been tested by me in 1.4...

Also See: Digium bug ID #14769 (related to fixes for 1.6 already included here for 1.4)
For a T.38 fix with sending faxes see bug ID #14849

Here is my current (6-Apr-2009) app_fax.c (just copy it to the apps directory)
Install the new version of SPANDSP 0.0.6pre10 and apply the fax.patch and rebuild the system as below.

You can't use the old app_rxfax/app_txfax code with the new SPANDSP.
If you are upgrading/replacing the older app_rxfax/app_txfax just remove them from your app directory and add app_fax in their place, then rebuild. You do not have to re-run the fax.patch.

Older RxFax/TxFax:

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.4pre18
Configure SPANDSP: ./configure
Install SPANDSP: make install
Copy app_rxfax.c and app_txfax.c to the asterisk apps directory.
modified: apps/app_rxfax.c
modified: apps/app_txfax.c (never worked correctly for me)
updated patch: fax.patch (for branch 1.4, about the same as 1.4.23)
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
run ./configure for asterisk
enable the applications from menuselect: make menuselect
Build Asterisk: make

Dialplan example:


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

[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,Set(EMAILTO=${ARG1})
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 "${EMAILTO}" --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" "${EMAILTO}")
exten => h,n(done),system(/bin/rm -f /tmp/fax-${FILEID}.tif)
exten => h,n,Hangup()
Note there is a problem with hangups in macros with some Asterisk 1.4 versions. Please make sure you are NOT running 1.4.23. See Digium bug ID #14122

Remote called Party ID:

Also See: Digium bug ID #8824

My current patch I use for Branch 1.4 (about the same version as 1.4.23) remote_id_branch.patch.gz (updated Jan 2009)
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


G.722 Mods:

Upgrade to Asterisk 1.6 and get official support.


G.722 codec patch for Branch 1.4 back ported from 1.6
g722-20090218.patch.gz assumes branch 1.4 (about version 1.4.23)
Copy patch file to your main asterisk source directory
run patch in Asterisk directory: patch -p0 <g722.patch
Enable the G.722 codec from menuselect: make menuselect
Build Asterisk: make
Add allow=g722 to sip.conf in the general section or for peers

Notes:

Old Notes (no longer apply):


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