diff options
author | Josh Roberson <josh@asteriasgi.com> | 2005-09-09 21:13:42 +0000 |
---|---|---|
committer | Josh Roberson <josh@asteriasgi.com> | 2005-09-09 21:13:42 +0000 |
commit | f406fe76a8f8195ebf66b4b57b76fa7e902957bf (patch) | |
tree | 8a2c613732f32b1cd70ae7eb67708181d07c51c6 /apps | |
parent | 60ffafcc3995a9583994091818beb87461c71096 (diff) |
Set filaneme BEFORE we return from open_mailbox() if we don't have positive message count (Bug #5175)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/app_voicemail.c | 7 |
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; } |