Asterisk Voicemail Redesign
Created by: mochouinard,Last modification on Tue 28 of Mar, 2006 [14:29 UTC] by linkx
Asterisk Voicemail Redesign
This page is dedicated to what the future voicemail app needs to based on. The voicemail app has being made using certain guidelines that aren't proper for future needs.
To start, here is a brain storm of items to think about when rebuilding the future voicemail app
- Key Map configurable
- text config AND database ready
- having context for configuring user mailbox
- have a 'manager' interface to integrate with external Clients.
- only save in * raw file format
- be safe when writing voicemail, record in a temporary folder and after move it to the user mailbox
- create a 'VoiceMail Net' or something else, a Asterisk Network, a bunch of * box talking to each other about stuff they share, like a central voicemail server
I beleive not EVERYTHING should be within * app. For example, the process of emailing a voicemail should be dedicated to a external deamon that monitor 1 or multiple manager interface, so that deamon can be optimized or changed as the user need, without affecting the pbx in a whole. The voicemail App should not have to be changed. everything should be configurable, and if a section can be changed too much, just take it out of there.
here are sample options to be added
- be able to go forward x second or backward x second
- have pager # or phone number notifications
- be able to set on the phone, a paget's #, or number to get notification of voicemail
- be able to set a temporary out of the office message
- if posible, be able to set prompt in different language
Maybe just get a list of feature from an Octel system, and put them in *
With a manager interface, we could make Application that run on the user desk to manage their voicemail. Playback could be done in different way, maybe just open a port on the server, and tell the client to connect to it to get the audio stream, or stream it via a IAX stream with the win or linux iax library ???
NOTE: don't integrate IMAP system WITHIN voicemail, make an app that monitors the manager interface, and apply items to the IMAP directory structure.
NOTE2: Why not on Linux create a FUSE to gain the MAILdir functionality.
AGREED. However, instead of all that monitoring and Manager interface mangling, what about just changing the voicemail system to store mailboxes in maildir format?
- voicemail expiration is trivialized: maildir doesn't use numbered files
- maildir storage format is fail-safe
- IMAP access via any IMAP server which supports maildir (like Courier IMAP for example)
- many maildir tools out there for managing the mailboxes
- maildir can support quotas on a per-mailbox basis (maildir++)
- folder support (maildir++)
Basic refactoring
I (chops) have started working on refactoring the voicemail app to make some of these things easier, and to further my work on the IMAP/Voicemail integration bounty. I'm going to start putting some basic patches in Mantis soon. In general, what I think should happen to app_voicemail.c in the near future is:- Abstract storage into a struct of function pointers instead of the #ifdef blocks that are there currently.
- Abstract messages into a struct ast_vm_message, with a small set of functions to operate on them, instead of the current un-abstracted approach.
- Change messages to be stored on disk by their unique IDs instead of stored by number and constantly re-sorted.
So far I have three patches in Mantis (more for discussion than in the expectation they'll be immediately applied, though I'd be happy if they were):
- Cosmetic cleanup of 'mailbox' vs. 'ext' vs. 'folder' in app_voicemail.c: here
- Abstract storage of voicemails into a struct interface instead of a block of #defines: here
- Initial stab at abstracting voicemail messages into a struct and accessor functions: here
The third is by far the most interesting; the other two are just sort of general cleanliness things. The abstraction of messages is what I really think is important and difficult. I'd be very interested in anyone's feedback on my ideas and patches.

Comments
333
<P>
Secondly, Voicemail needs better integration with AGI/FastAGI so that GUI's can manipulate the messages (list, select folders, move, delete, play through phone etc etc). Some means of generating UserEvents in real time as the mail folders are manipulated would also be useful.
<P>
And in the already done dept: stop Comedian Mail actually deleting messages. See: http://bugs.digium.com/view.php?id=10740
333Re: IMAP
The message contains the information about the message, including time, caller id, and the like, and the voicemail itself is an attachment.
Just thought that I'd offer an "its been done before", but I would like to see this in Asterisk as it would make it a better sell for companies like mine who are impressed with flash.
-Mark
333Voicemail API
ive written an php script which lets you interface quite conveniently with the asterisk voicemail spool using apache, php and xml (results). You can download it at http://sip-syndication.com => Downloads => vmxml. The scripts support authentication using voicemail.conf and asterisk realtime. Its still beta and currently i am dealing some race condition problems which i hope to have solved by the end of the months. Basic documentation is available here: http://sip-syndication.com/images/stories/docs/vmxml-api-doc.txt
-- nethead
333Playback Speed Change
333Languages
333
Maildir is the way to go for default storage. Storing voicemails in a DB makes much less sense than Maildir.
333
no need to store the mails in maildir etc. use sql, then they can be easily shared among an asterisk cluster without any locking or concurrency issues.
333International and context specific email
If the user chose spanish, don't send him an email in english.
Also I'm using a PBX for multiple companies. The companies that use our system require certain things in the email that is sent out and obviously, they don't require the same thing (:frown:)
So different email message sent out depending in what context you're in would be great.
333IMAP
1) VM server is an IMAP server. Most email clients these days handle multiple IMAP boxes. - just add the VM IMAP dir to your client and you get full control.
Pro's
Could have New/Saved Folders - maybe not allow creation, navigation would be hard
Could view all voicemail and easily remove/save them - everyone knows the interface
Con's
Forwarding is a weird concept here... it shoudl really forward to another voicemail box if it could... could have multiple addresses for employee, but that gets ugly
2) VM uses imap server... I think this is pretty slick... the question is can it work.
Ideas:
Read aloud subjects of emails, allow ability to read messages... sweet, unless you get a ton of email and just want voicemail
-or-
Add a field to the voicemail X-Asterisk-Voicemail... then filter on that so the voicemail can find its messages... only a problem is folders here I think
Pros
full intergrated, you remove a message and its gone from both, you can forward just like an email and it'll just end up in the other persons voicemail
can be made to work with nearly any imap server
this would just be slick
Cons:
Hard to figure out exactly how to deal with folders/other messages
333Re: VPIM