Page 342 - Asterisk™: The Future of Telephony
P. 342
This will compile everything Asterisk needs to make use of the IMAP client libraries. §
Now we have to recompile Asterisk with the IMAP capabilities. We’ll need to navigate
to the location of our Asterisk source files (such as /usr/src/asterisk), and run the fol-
lowing command:
# /configure --with-imap=/usr/src/imap-2006h
The we need to rerun make menuconfig to incorporate IMAP storage into the compile.
Under Voicemail Build Options select the IMAP_STORAGE parameter, and then press x to
save and exit. This ensures that when we compile Asterisk, it will build the IMAP
module as well. Obviously, the next step then is to recompile and reinstall Asterisk. A
simple way to do this is, in your terminal, to run:
# make && make install
OK, so we’ve got the module compiled and installed. Now it’s time to configure it.
In the /etc/asterisk folder, we’ll need to add a few lines to the voicemail.conf file, in the
[general] section:
imapserver=localhost
imapport=143
expungeonhangup=yes
authuser=vmail
authpassword=vmailsecret
imapfolder=Voicemail
Since Dovecot is available in the CentOS package repository, installing a small IMAP
server to handle your virtual (voicemail) users on your Asterisk box is simple:
# yum install dovecot
Now make sure that IMAP support is enabled in /etc/dovecot.conf by uncommenting
the protocols line so that it appears as follows:
protocols = imap imaps
After you’ve enabled IMAP support, create the user account that will be storing the
mail:
# groupadd vmail
# useradd vmail -g vmail -s /bin/true -c "asterisk voicemail user" -p vmailsecret
-d /var/spool/asterisk/imap-voicemail vmail
# chown -R vmail.vmail /var/spool/asterisk/imap-voicemail
Now restart Dovecot and Asterisk, and you should be good to go.
# service dovecot restart
# service asterisk restart
§ The lrh option tells the compiler that this is a Linux Red Hat system. The IP6=4 option tells the compiler
that we don’t want to compile in support for IPV6. Read the Makefile for other options. For RHEL 5 or
CentOS 5, you should use lr5 instead of lrh.
314 | Chapter 14: Potpourri