I am working on a project to create an Asterisk Voicemail solution with FreePBX. I would like to store the voicemail .wav files in a MySQL database (configurable in the voicemail.conf file). The one problem I have in doing this is that FreePBX looks for the .wav files in the /var/spool/asterisk directory. So, when a user goes to http://voicemailserver/recordings and looks at his inbox, it is always empty, even though there are messages in the MySQL database.
My guess is that I would have to write some PHP code in the /var/www/recordings directory. It looks like the voicmail is referenced in include/main.conf.php and modules/voicemail. If I can re-route this from the file system to the database, I think it will all play nice. Does anybody have any experience with this, or any suggestions?
I know this may all sound hair-brained, but it really could be pretty slick. MySQL 5.1 has clustering capability. So you could have two Asterisk servers write to their own MySQL database, but the databases are clustered, so you have automatic redundancy. If one server goes down, the other can take over for it seamlessly.