aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-11 21:04:10 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-11 21:04:10 +0000
commit13fe86a11096334be77f25a9098f50d1531ab8de (patch)
tree64cfaa660695a7b1d07c0d40957f10b383910002 /apps/app_voicemail.c
parent1f8798fbf716f3610149b0119f200a0cfb163729 (diff)
issue #5663
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7078 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-xapps/app_voicemail.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index b30d69df8..b4b77c71d 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3869,7 +3869,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
{
- int x;
+ int x, nummsg;
int res = 0;
if (vms->lastmsg <= -1)
@@ -3902,12 +3902,14 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
}
}
}
- for (x = vms->curmsg + 1; x <= vmu->maxmsg; x++) {
- make_file(vms->fn, sizeof(vms->fn), vms->curdir, x);
- if (!EXISTS(vms->curdir, x, vms->fn, NULL))
- break;
- DELETE(vms->curdir, x, vms->fn);
- }
+
+ /* Delete ALL remaining messages */
+ nummsg = x;
+ for (x = vms->curmsg + 1; x <= nummsg; x++) {
+ make_file(vms->fn, sizeof(vms->fn), vms->curdir, x);
+ if (EXISTS(vms->curdir, x, vms->fn, NULL))
+ DELETE(vms->curdir, x, vms->fn);
+ }
ast_unlock_path(vms->curdir);
done: