Configuring IMAP voicemail for FreePBX
A couple of notes first:
- IMAP support is only present in Asterisk 1.4, not 1.2.
- I can only attest to use of the Cyrus IMAP daemon. The other commonly used IMAP daemon, dovecot, may or may not require changes to the instructions here. If you find out that is the case, let me know, and I will update this HOWTO.
- That said, on to the meat:
- Download and build the UW imap client. Do NOT install it; asterisk will bind the compiled client into itself. Look at the file doc/ imapstorage.txt in the asterisk 1.4 source tree for specific instructions.
- Configure asterisk for IMAP voicemail support. This is also explained in the same imapstorage.txt file.
- Install asterisk by 'make install'.
Go to /etc/asterisk, and edit the file vm_email.inc. The voicemail text message in /etc/asterisk/vm_email.inc will not work
if sent to an IMAP server. The text is required to end each line with
\r\n, not \n. Dovecot may not care (dunno), but Cyrus (which
clarkconnect runs) bitches about 'bare newlines'. I fixed it (for now)
by manually adding the \r characters where needed. Unfortunately, this may be overwritten by updates, so make a copy to restore (this is ugly and needs to be fixed somehow.)
- Edit voicemail.conf and add the 4 lines following (beware that this also can/may be overwritten):
- Now, start up asterisk, and browse to your config. For the extensions, put 'imapuser=YOURIMAPUSERNAME' in the VM Options field. For Cyrus, it seems you need one username&password for all extensions. If not, let me know how to change this.
- For any extra extensions, change the mailbox field in Device Options to have default@NNN, where NNN is the primary extension. This is so MWI will work. NOTE: you will still be prompted for your mailbox, even if you call "My Voicemail" speed-dial, since asterisk can't tell who you really are.
- In your email client, create a mailbox called "Voicemail".
This *should* all work (at least it did/does for me.) Issues/glitches, let me know, and I'll update this.