IMAP Interface for Voicemail

(16 Mar 2008) Following are my notes for installing the IMAP interface for Asterisk's voicemail service. Apologies for lack of detail. This is currently a work in progress.

The IMAP interface allows you to store voicemail inside of a IMAP server. This allows you (or your users) to access their voicemail, either through the telephone or via their favorite IMAP-enabled mail client.

Building the interface

The IMAP interface is enabled through the main Asterisk tarball. Treat it as a prerequisite for Asterisk in that you have to install a few things to get it to work. Note: the IMAP voicemail storage and the ODBC voicemail storage is mutually exclusive (you can only pick one via "make menuselect").

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 version that I used for this install is imap-2006g. (<b>Update:</b> I've also used imap-2007e in a 64-bit compile.) Your experience may vary.

In any case, 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. I used "make slx". If you have issues with SSL, try adding "SSLTYPE=none" to the make statement (i.e., "make slx SSLTYPE=none").

Note: Unless you're running a Mandriva variant, you will need to pick something else from the Makefile! Also: you will probably need to install OpenSSL, libopenssl, libopenssl-devel, and libpam0-devel first. As always, the versions you deal with may vary.

You won't have to run "make install". Asterisk will only need to know where the code "lives".

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 (Note: this is in the asterisk folder, not the asterisk-addons folder):

 ./configure --with-imap=/usr/local/src/imap-2006g

or wherever your imap toolkit directory (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

The above is from Asterisk 1.4.x but the menu is similar in 1.6.x. Note that these two options are mutually exclusive. Use the arrow keys to highlight #2 and hit the return key to select it. Use the back arrow to get back to the main menu and choose your other selections. Save your changes and exit the menu. Then run "make" and "make install" as you normally would.

Troubleshooting

  • If the compiler, on a 64-bit system, complains about not being able to read symbols and recommends recompiling with -fPIC, find the EXTRACFLAGS line in the IMAP Makefile and make it look like:
 EXTRACFLAGS=-fPIC

Update: (26 Nov 2009) Please note that I'm no longer updating this page. For my purposes, I've found that flat file voicemail is a bit more reliable.

Sources

http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3#doc_chap5