aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-25 05:07:29 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-25 05:07:29 +0000
commit539b5a265c40a035ce5f257dfe09f4fc7d766aa5 (patch)
treeb1954001ac3b3b253c0df9c93c2ca7b710166625
parent45f24377c1e8609f6a7d422fd7a56b6e9d2e1678 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@14867 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 85be0cd41..55a9c8456 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3483,11 +3483,13 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i
vmtmp = extensions;
if (flag==1) {
struct leave_vm_options leave_options;
+ char mailbox[AST_MAX_EXTENSION * 2 + 2];
+ snprintf(mailbox, sizeof(mailbox), "%s@%s", username, context);
/* Send VoiceMail */
memset(&leave_options, 0, sizeof(leave_options));
leave_options.record_gain = record_gain;
- cmd = leave_voicemail(chan, username, &leave_options);
+ cmd = leave_voicemail(chan, mailbox, &leave_options);
} else {
/* Forward VoiceMail */
RETRIEVE(dir, curmsg);
@@ -3890,7 +3892,7 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
return ERROR_LOCK_PATH;
vms->curmsg = -1;
- for (x=0;x < vmu->maxmsg;x++) {
+ for (x = 0; x < vmu->maxmsg; x++) {
if (!vms->deleted[x] && (strcasecmp(vms->curbox, "INBOX") || !vms->heard[x])) {
/* Save this message. It's not in INBOX or hasn't been heard */
make_file(vms->fn, sizeof(vms->fn), vms->curdir, x);
@@ -3924,9 +3926,9 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
done:
if (vms->deleted)
- memset(vms->deleted, 0, sizeof(vms->deleted));
+ memset(vms->deleted, 0, vmu->maxmsg * sizeof(int));
if (vms->heard)
- memset(vms->heard, 0, sizeof(vms->heard));
+ memset(vms->heard, 0, vmu->maxmsg * sizeof(int));
return 0;
}
@@ -6522,13 +6524,15 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
} else {
if (find_user(NULL, vmu->context, num)) {
struct leave_vm_options leave_options;
+ char mailbox[AST_MAX_EXTENSION * 2 + 2];
+ snprintf(mailbox, sizeof(mailbox), "%s@%s", num, vmu->context);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
memset(&leave_options, 0, sizeof(leave_options));
leave_options.record_gain = record_gain;
- res = leave_voicemail(chan, num, &leave_options);
+ res = leave_voicemail(chan, mailbox, &leave_options);
if (!res)
res = 't';
return res;