fixed imap bug and updated syntax.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Matt O'Gorman 19 years ago
parent 159d9d2a3b
commit e502e644df

@ -2355,7 +2355,7 @@ static int has_voicemail(const char *mailbox, const char *folder)
#else #else
#ifdef IMAP_STORAGE #ifdef IMAP_STORAGE
static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs) static int count_messages_imap(const char *mailbox, int *newmsgs, int *oldmsgs)
{ {
SEARCHPGM *pgm; SEARCHPGM *pgm;
SEARCHHEADER *hdr; SEARCHHEADER *hdr;
@ -2383,7 +2383,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
ret = 0; ret = 0;
while((cur = strsep(&mb, ", "))) { while((cur = strsep(&mb, ", "))) {
if (!ast_strlen_zero(cur)) { if (!ast_strlen_zero(cur)) {
if (messagecount(cur, newmsgs ? &tmpnew : NULL, oldmsgs ? &tmpold : NULL)) if (count_messages_imap(cur, newmsgs ? &tmpnew : NULL, oldmsgs ? &tmpold : NULL))
return -1; return -1;
else { else {
if (newmsgs) if (newmsgs)
@ -2507,13 +2507,6 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
} }
return 0; return 0;
} }
#else
static int messagecount(const char *context, const char *mailbox, const char *folder)
{
return __has_voicemail(context, mailbox, folder, 0);
}
#endif #endif
#endif #endif
@ -2553,6 +2546,13 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i
} }
#ifndef ODBC_STORAGE #ifndef ODBC_STORAGE
static int messagecount(const char *context, const char *mailbox, const char *folder)
{
return __has_voicemail(context, mailbox, folder, 0);
}
static int __has_voicemail(const char *context, const char *mailbox, const char *folder, int shortcircuit) static int __has_voicemail(const char *context, const char *mailbox, const char *folder, int shortcircuit)
{ {
DIR *dir; DIR *dir;
@ -2879,7 +2879,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
oldmsgs = vms->oldmessages; oldmsgs = vms->oldmessages;
} else { } else {
ast_log(LOG_DEBUG, "About to call messagecount.\n"); ast_log(LOG_DEBUG, "About to call messagecount.\n");
res = messagecount(ext, &newmsgs, &oldmsgs); res = count_messages_imap(ext, &newmsgs, &oldmsgs);
if(res < 0) { if(res < 0) {
ast_log(LOG_NOTICE,"Can not leave voicemail, unable to count messages\n"); ast_log(LOG_NOTICE,"Can not leave voicemail, unable to count messages\n");
return -1; return -1;
@ -8513,7 +8513,7 @@ static void check_msgArray(struct vm_state *vms)
for (x = 0; x<256; x++) { for (x = 0; x<256; x++) {
if (vms->msgArray[x]!=0) { if (vms->msgArray[x]!=0) {
ast_log (LOG_DEBUG, "Item %d set to %ld\n",x,vms->msgArray[x]); ast_log (LOG_DEBUG, "Item %d set to %ld\n",x,vms->msgArray[x]);
}; }
} }
ast_log (LOG_DEBUG, "Check complete.\n"); ast_log (LOG_DEBUG, "Check complete.\n");
} }

@ -53,14 +53,12 @@ Compile c-client and verify that a c-client.a file has been generated.
------------------ ------------------
Compiling Asterisk Compiling Asterisk
------------------ ------------------
Uncomment the following lines in apps/Makefile:
USE_IMAP_VM_INTERFACE=1 Configure with ./configure --with-imap=/usr/src/imap
UWCLIENT_HOME=/usr/src/imap/c-client <- path to c-client.a (above) or where ever you built the University of Washington IMAP C-Client.
CFLAGS+=-DUSE_IMAP_STORAGE Then make menuselect go to voicemail options and check the imap box
then make, make install and asterisk will have imap storage support for
Type "make" in the asterisk directory. Do not attempt to make from the voicemail.
asterisk/apps directory.
--------------------- ---------------------
Modify voicemail.conf Modify voicemail.conf

Loading…
Cancel
Save