I use Asterisk ( asterisk.org) to automatically 9 a.m., I’ll probably be out all day, and my outgoing update my own personal voicemail message greeting should reflect this. To monitor the motion every day. Asterisk is open source Private Branch detector, I use the excellent home-automation Exchange (PBX) software that can turn a Linux package Misterhouse ( misterhouse.net). box into a corporation-worthy phone system, I wrote some code for Misterhouse that gener-complete with directory, voicemail, conferencing, ates an “office presence” file if I’m in the office text-to-speech, and VoIP features. You can program between 8 and 9 a.m. The AGI script then checks the Asterisk system with Asterisk Gateway Interface for the presence of this file when deciding which (AGI) scripts, which are written in Perl. greeting ending to play. You can get the Mis-
I decided to set up my system to automatically terhouse code at makezine.com/07/diyhome_ update my voicemail greeting in my own voice, voicemail. rather than using the cold, robotic-sounding text- You can also find the Perl AGI script that puts to-speech (TTS) engine built into the software. together the day’s message at the above URL. With a little AGI coding and other hacking, I had Save it to a file named vmautomate.pl and place Asterisk assembling and playing an appropriate, it in the /var/lib/asterisk/agi-bin directory. Then personal-sounding greeting every day. add the following lines to your extensions.conf
I used the sound recorder that comes with file, where 8001 is your phone extension and 100 is Windows to record several message chunks: one your voice mailbox number:
for each day of the week (wday1.wav for Monday, exten => 8001, 1,Dial(SIP/8001, 20,rt) wday2.wav for Tuesday, etc.), one for each month of exten => 8001, 2, AGI( vmautomate.pl) the year (month1.wav for January, month2.wav for exten => 8001, 3,Voicemail, 100
February, etc.), and one for each day of the month Finally, reload Asterisk. Now, when you call your ( 1.wav for the first, 2.wav for the second, 31.wav for extension, your phone will ring for 20 seconds the 31st). I also recorded a greeting start and two and then the AGI script will run. Depending on the different endings: one for when I’m in the office time of day and the presence of the “office pres-and another for when I’m away. I named these files ence” file, you should hear the appropriate greet- start.wav, endnormal.wav, and endooo.wav. ing. You should replace your “regular” voicemail
By default, Asterisk doesn’t have a codec greeting with the default greeting so that it flows to play .wav files. So, rather than install a new properly once it reaches the Voicemail directive. codec, you can use the sox sound converter (sox. It’s easy to imagine other cool functionalities sourceforge.net) to convert all of your sound files with AGI scripts. For example, you could take this into the .gsm format that Asterisk can play. After process a step further and have an AGI script that you convert all your sound files, create a directory reads the calendar that you’ve published with called vm-sounds in /var/lib/asterisk/sounds and iCal to see whether you’re scheduled to be out of copy the files into it. the office that day.
To further automate my system, I set up a motion detector under the desk in my office. I know that if Dave Mabe is the author of O’Reilly’s BlackBerry Hacks there is no motion in my office between 8 a.m. and and lives in Chapel Hill, N.C.
References:
Archives