aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-03 21:18:27 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-03 21:18:27 +0000
commitf0aa373808ed959a85ef4a4ec62e92e45c578675 (patch)
tree520372d4f6c2d6b36c53eb276f151684e18f660a /app.c
parent38d817b90e611437bf28742ef0f234429bf2882a (diff)
Add ability to check voicemail from multiple folders (bug #2561)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3905 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rwxr-xr-xapp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/app.c b/app.c
index 4428de3c8..0b277b5ce 100755
--- a/app.c
+++ b/app.c
@@ -150,7 +150,7 @@ int ast_app_getvoice(struct ast_channel *c, char *dest, char *dstfmt, char *prom
return 0;
}
-int ast_app_has_voicemail(const char *mailbox)
+int ast_app_has_voicemail(const char *mailbox, const char *folder)
{
DIR *dir;
struct dirent *de;
@@ -159,6 +159,8 @@ int ast_app_has_voicemail(const char *mailbox)
char *mb, *cur;
char *context;
int ret;
+ if (!folder)
+ folder = "INBOX";
/* If no mailbox, return immediately */
if (ast_strlen_zero(mailbox))
return 0;
@@ -168,7 +170,7 @@ int ast_app_has_voicemail(const char *mailbox)
ret = 0;
while((cur = strsep(&mb, ","))) {
if (!ast_strlen_zero(cur)) {
- if (ast_app_has_voicemail(cur))
+ if (ast_app_has_voicemail(cur, folder))
return 1;
}
}
@@ -181,7 +183,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, tmp);
+ snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/%s", (char *)ast_config_AST_SPOOL_DIR, context, tmp, folder);
dir = opendir(fn);
if (!dir)
return 0;