From: Jeremy McNamara Date: Tue, 13 Jan 2004 00:35:45 +0000 (+0000) Subject: Fix show voicemail users for . Bugs #820 X-Git-Tag: 0.7.0~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4231743209d7b63b2c33be35bfd6a1539c32aff0;p=thirdparty%2Fasterisk.git Fix show voicemail users for . Bugs #820 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1994 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index c1902a036f..9b36e195ad 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3051,16 +3051,19 @@ static int handle_show_voicemail_users(int fd, int argc, char *argv[]) struct dirent *vment; int vmcount = 0; char count[12]; - make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX"); - if ((vmdir = opendir(dirname))) { - /* No matter what the format of VM, there will always be a .txt file for each message. */ - while ((vment = readdir(vmdir))) - if (!strncmp(vment->d_name + 7,".txt",4)) - vmcount++; - closedir(vmdir); + + if ((argc == 3) || ((argc == 5) && !strcmp(argv[4],vmu->context))) { + make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX"); + if ((vmdir = opendir(dirname))) { + /* No matter what the format of VM, there will always be a .txt file for each message. */ + while ((vment = readdir(vmdir))) + if (!strncmp(vment->d_name + 7,".txt",4)) + vmcount++; + closedir(vmdir); + } + snprintf(count,11,"%d",vmcount); + ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count); } - snprintf(count,11,"%d",vmcount); - ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count); vmu = vmu->next; } } else {