aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authortwisted <twisted@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-09 21:13:42 +0000
committertwisted <twisted@f38db490-d61c-443f-a65b-d21fe96a405b>2005-09-09 21:13:42 +0000
commit58a5f701a49135eb4847a35e57bef9e2b88b4479 (patch)
tree8a2c613732f32b1cd70ae7eb67708181d07c51c6 /apps/app_voicemail.c
parentb0c5a1fc33941d893d2508c4f61c4b7321443d74 (diff)
Set filaneme BEFORE we return from open_mailbox() if we don't have positive message count (Bug #5175)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6559 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-xapps/app_voicemail.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ebed7dd49..70b32b5b0 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3780,6 +3780,12 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
int count_msg, last_msg;
ast_copy_string(vms->curbox, mbox(box), sizeof(vms->curbox));
+
+ /* Rename the member vmbox HERE so that we don't try to return before
+ * we know what's going on.
+ */
+ snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
+
make_dir(vms->curdir, sizeof(vms->curdir), vmu->context, vms->username, vms->curbox);
count_msg = count_messages(vmu, vms->curdir);
if (count_msg < 0)
@@ -3805,7 +3811,6 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
return res;
}
- snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
return 0;
}