Storing Voicemail on an IMAP server
From Etel
Contents |
Storing Voicemail on an IMAP server
Status: Work In Progress
Problem
You want to store voicemail on an IMAP server to access it from your IMAP-capable email client and by phone.
Solution
Installation
IMAP support is enabled through compiling of the main asterisk tarball. There are a number of prerequisites for Asterisk in that you have to partially install the source code for UW-IMAP, along with full installs of OpenSSL, libopenssl, libopenssl-devel, and libpam0-devel.
Get the code for the service by grabbing the UW-IMAP Toolkit from ftp://ftp.cac.washington.edu/mail/ By grabbing imap.tar.Z, you should be getting the latest version. The current version is imap-2007g.
Create a work folder, put the IMAP tarball in it, and then untar the tarball. cd into the resulting directory. Read the "Makefile" file and determine which version you want to build. The command you use will be based on the underlying Unix/Linix distro (exmple "make lmd"). You don't have to run "make install". Asterisk-addons will only need to know where the UW-IMAP source code resides.
Assuming that you already have the pre-reqs for Asterisk installed (do that now if you already haven't), cd into your working folder for Asterisk and run
./configure --with-imap=/usr/local/src/imap-2007g
where "--with-imap" is set to the path to wherer the imap toolkit directory (that created by the tarball) is located. This tells menuselect where to find the code. Next, run
make menuselect
If you have all of the pre-requisites, the sub-menu for voicemail should look like:
**************************************************
Asterisk Module and Build Option Selection
**************************************************
Press 'h' for help.
XXX 1. ODBC_STORAGE
[ ] 2. IMAP_STORAGE
Again, note that these options are mutually exclusive. Use the arrow keys to highlight #2 and hit the space key to select it. Use the left arrow to get back to the main menu and choose your other selections. Hit "x" to save your changes and exit the menu.
Next, run "make" and "make install" as you normally would.
Asterisk Configuration
Update your voicemail.conf file:
imapserver=localhost imapfolder=Voicemail imapflags=notls authuser=asterisk authpassword=password
IMAP Configuration
Add a master user for Asterisk to your IMAP server that has access to all user's mailboxes. With Dovecot you just add a new passdb section to dovecot.conf:
auth default {
...
passdb passwd-file {
args = /etc/dovecot/dovecot.masterusers
master = yes
}
...
}
with dovecot.masterusers containing the asterisk user:
asterisk:{PLAIN}password
Finally map the IMAP users to your voice mail accounts in voicemail.conf:
1234 => 4321,John Doe,,,imapuser=john
And don't forget to create the Voicemail IMAP folders before receiving the first message.
Discussion
Since version 1.4 Asterisk supports IMAP as a store for voicemail. The IMAP integration allows voicemail to be managed either through your email client or by phone through Asterisk's voicemail application.
Sending email notifications for new voice messages has been supported since the very beginning but with the IMAP integration you are now operating on the same data store. That means if you read a message in your email client it is also marked read when you use the phone to query messages. It's amazing to see the MWI (message waiting indicator) on your phone switch off as soon as you select the message in your mailbox. Of course messages can also be deleted and forwarded using both systems.
See Also:
Metadata
- By: Stefan Reuter and Tim Kramer
- Solves problem "How to setup Asterisk Voicemail to work with an IMAP server(ie. MS Exchange, Dovecot)" from Solutions Needed
- Outline reference (optional); a link to a chapter in the outline or, even better, to a specific topic
