I have an Asterisk box that is going to be used solely for voicemail. Users don’t register with it, instead they register with an OpenSER box. Therefore the Asterisk Voicemail server has no knowledge of where it’s phones are and can’t sending notifications when there are new voicemails.
I got around this by writing a perl script that queries the MySQL database location table on OpenSER and creates new key/value pairs in the /var/lib/asterisk/astdb file, thereby allowing the Asterisk voicemail server to know where the phones are.
Seems to work great considering it took me less than an hour to hack it together.
Problem is however, that once this file is modified, Asterisk doesn’t know it’s been updated. A ‘reload’ doesn’t cause it to re-read the file. Shutting Asterisk down and restarting it does, but that’s not an option. I tried ‘reload app_db.so’ but it said that module doesn’t support reloading. Asterisk must re-read this file, because it’s used for a whole bunch of things. Any ideas?
One other quirky thing I noticed too, that was when Asterisk loads, and the file already has key’/value pairs that I populated it with, it strips the last character of the key and the value… so I got around it by appending a space to the end of the key and the value… then Asterisk strips the space… Weird… wonder why it does that.