Tatra Security Systems, Inc.
Phone: (201) 891-1555 Email:
Serving the Northern New Jersey area

JudyMWI

JudyMWI is a means of having phones registered at front-end Asterisk servers, with these front-end servers capable of receiving up to date Message Wait Indicator status from backend Asterisk servers which store and process the actual voicemails. No storage is needed on the front-end servers as Judy stores all wait indicator status in a compacted form in memory.

How it works

The app_voicemail module on the front-end servers maintains a set of Judy structures that automatically grow a bit to accomodate these MWI indicators. The backend servers occasionally send update message counts via a dedicated IAX trunk to the front-end servers, so that a call can be made into app_voicemail with updated message counts for the INBOX. When an INBOX is emptied on a backend server, a message count of zero is sent over so the front-end servers can notify their registered phones to turn off the new mail indicator.

Note: This patch can likey be simplitied to work with Asterisk database commands, thus eliminating the dependency on the Judy library. app_voicemail would still be patched on the front-end servers, only it would reference the AstDB instead of Judy functions.

Development

A git repository is available for testing the core functionality of JudyMWI, and also as a starting point if you plan to do work to integrate this with newer versions of Asterisk. For regular use you just need the patch shown in the later sections below.

git clone http://tatralarm.com/code/JudyMWI.git

Some patch-notes are included if you want to recreate one, piecemeal.

Getting started

You should be familiar with IAX Trunking and also configuring externnotify in voicemail.conf.

Configuring front-end servers

These are the Asterisk server(s) that your phones are registered to. Voicemail messages are not stored here, otherwise the Message Wait Indicator status would already be present for the phones to utilize and this patch wouldn't be needed.

Apply this patch to Asterisk 1.4.22.1 which extends the app_voicemail module to introduce a VMJudyMWI command.

cd /usr/src/asterisk/asterisk-1.4.22
bzip2 -dc < ../asterisk-1.4.22-VMJudyMWI.patch.bz2 | patch -p2
If you plan to do further development, you can generate patches with diff --new-file --context=2 -r dist/asterisk-1.4.22.1 patched/asterisk-1.4.22.1 using the sources in the corresponind subdirectories. make distclean was run in each of the subdirectories as well, and all of the *~ and other temporary files were deleted too, such as #* and .#* (remnants of an editor)

Add this to extensions.conf on each of your Asterisk servers that have phones registered to them. You do not need a writable spool area on these servers because the Message Wait Indicator status is kept in memory with the VMJudyMWI call, and not as .txt files on disk.

[setmwi]

exten => _XXXX,1,Answer
exten => _XXXX,n,VMJudyMWI(INSERT,${CALLERID(name)},${EXTEN},${CALLERID(num)})
exten => _XXXX,n,Hangup

Please see the MWI over IAX link at voip-info.org for configuring the rest of the setup, with the notify_mwi.sh script on the voicemail server(s).

Alarms By Tatra
700 Jane Dr.
Franklin Lakes, NJ 07417