This is an external notification script for Asterisk's Comedian voicemail system. It is licensed under the GNU GPL. Basically, it will enable you to have Asterisk manipulate MWI lights on your legacy PBX station phones, given the proper mode codes. It will also allow you to have * call or page your users when they get receive a voicemail. It could probably use some cleaning up. Please understand that the instructions below make no assumptions about your technical abilities. Don't be offended. Be warned, this code's purpose grew as it was written. It's not pretty. I will be cleaning it up. New versions will be posted at the link above. I plan on moving the user data into a DB, but here's what you have to do to get it to work: - save it as a .pl file - chmod +x it - make sure the path to perl is right (in the first line) which should tell you...on my sytem: ____SNIP____ $ which perl /usr/local/bin/perl ____SNIP____ - create /var/spool/asterisk/mwi/ - create /var/spool/asterisk/mwi/{context} for each context that you have in voicemail.conf - create /var/spool/asterisk/notify/ - create /var/spool/asterisk/notify/{context} for each context that you have in voicemail.conf - create a file in /var/spool/asterisk/notify/{context}/ whose filename matches the extension # that matches the one called. For example: ____SNIP____ $ cat /var/spool/asterisk/notify/default/1242 m95555555 ____SNIP____ Would cause the notification script to dial 9 (to get an outbound trunk on our system), then 555-5555 and then connect the person with Comedian. Another example: ____SNIP____ $ cat /var/spool/asterisk/notify/default/1242 p94444444 ____SNIP____ Would cause the notification script to dial 9 (to get an outbound trunk on our system), then 555-5555 and then feed their extension to the paging system. - modify the 'codes' (what are they called?) on line 104 (on) and 141 (off) to match whatever you use on your system to turn on/off MWI ____SNIP____ $callFile =~ s/CALLTHISNUMBER/\*1$mailbox/; .... $callFile =~ s/CALLTHISNUMBER/\#1$mailbox/; ____SNIP____ - modify lines 26, 35, and 44 to use the proper outbound trunks In our case, Zap/25 (line 26) is the analog port to our legacy PBX. Zap/g1 (lines 35 and 44) is part of the T1 trunk over to the Definity. - modify lines 35 and 44 to dial the proper code, (9 in our case) if any, to get an outbound trunk. - modify /etc/asterisk/extensions.conf to add the notification context: ____SNIP____ [vmnotify] ;exten => s,1,Wait(5) ;exten => s,2,Hangup ____SNIP____ - make sure lines 39 and 48 have an acceptable context for dialing out to call the user's mobile phone or pager - modify /etc/asterisk/voicemail.conf to call the script: ____SNIP____ [general] ; external notification externnotify=/usr/local/sbin/vmnotify.pl ____SNIP____ - reload asterisk ____SNIP____ $ asterisk -r ... asterisk*CLI> reload ____SNIP____