Fix searching for non-default mailboxes
authorMark Spencer <markster@digium.com>
Sun, 25 May 2003 18:02:11 +0000 (18:02 +0000)
committerMark Spencer <markster@digium.com>
Sun, 25 May 2003 18:02:11 +0000 (18:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1055 65c4cc65-6c06-0410-ace0-fbb531ad65f3

app.c

diff --git a/app.c b/app.c
index 9ecdbca..9436813 100755 (executable)
--- a/app.c
+++ b/app.c
@@ -172,7 +172,7 @@ int ast_app_has_voicemail(const char *mailbox)
                context++;
        } else
                context = "default";
-       snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/INBOX", (char *)ast_config_AST_SPOOL_DIR, context, mailbox);
+       snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/INBOX", (char *)ast_config_AST_SPOOL_DIR, context, tmp);
        dir = opendir(fn);
        if (!dir)
                return 0;
@@ -229,7 +229,7 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
        } else
                context = "default";
        if (newmsgs) {
-               snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/INBOX", (char *)ast_config_AST_SPOOL_DIR, context, mailbox);
+               snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/INBOX", (char *)ast_config_AST_SPOOL_DIR, context, tmp);
                dir = opendir(fn);
                if (dir) {
                        while ((de = readdir(dir))) {
@@ -242,7 +242,7 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
                }
        }
        if (oldmsgs) {
-               snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/Old", (char *)ast_config_AST_SPOOL_DIR, context, mailbox);
+               snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/Old", (char *)ast_config_AST_SPOOL_DIR, context, tmp);
                dir = opendir(fn);
                if (dir) {
                        while ((de = readdir(dir))) {