updating to current 1.2

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@8046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-01-13 03:52:45 +00:00
parent 69ac155838
commit f16619507a
10 changed files with 45 additions and 33 deletions

View File

@@ -161,7 +161,7 @@ static char *descrip =
" S(x) - Hang up the call after 'x' seconds *after* the called party has\n"
" answered the call.\n"
" t - Allow the called party to transfer the calling party by sending the\n"
" DTMF sequence defiend in features.conf.\n"
" DTMF sequence defined in features.conf.\n"
" T - Allow the calling party to transfer the called party by sending the\n"
" DTMF sequence defined in features.conf.\n"
" w - Allow the called party to enable recording of the call by sending\n"

View File

@@ -445,7 +445,7 @@ static void apply_option(struct ast_vm_user *vmu, const char *var, const char *v
ast_copy_string(vmu->language, value, sizeof(vmu->language));
} else if (!strcasecmp(var, "tz")) {
ast_copy_string(vmu->zonetag, value, sizeof(vmu->zonetag));
} else if (!strcasecmp(var, "delete")) {
} else if (!strcasecmp(var, "delete") || !strcasecmp(var, "deletevoicemail")) {
ast_set2_flag(vmu, ast_true(value), VM_DELETE);
} else if (!strcasecmp(var, "saycid")){
ast_set2_flag(vmu, ast_true(value), VM_SAYCID);
@@ -2613,8 +2613,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
}
}
if (ast_fileexists(fn, NULL, NULL)) {
notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
STORE(dir, vmu->mailbox, vmu->context, msgnum);
notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
DISPOSE(dir, msgnum);
}
pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
@@ -4764,13 +4764,14 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
while((cmd >= 0) && (cmd != 't')) {
if (cmd)
retries = 0;
RETRIEVE(prefile, -1);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
switch (cmd) {
case '1':
cmd = play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
break;
case '2':
ast_filedelete(prefile, NULL);
DELETE(prefile, -1, prefile);
ast_play_and_wait(chan,"vm-tempremoved");
cmd = 't';
break;
@@ -4794,6 +4795,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
cmd = 't';
}
DISPOSE(prefile, -1);
}
if (cmd == 't')
cmd = 0;
@@ -5645,10 +5647,10 @@ static int vm_box_exists(struct ast_channel *chan, void *data)
static int vmauthenticate(struct ast_channel *chan, void *data)
{
struct localuser *u;
char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION];
char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = "";
struct ast_vm_user vmus;
char *options = NULL;
int silent = 0;
int silent = 0, skipuser = 0;
int res = -1;
LOCAL_USER_ADD(u);
@@ -5665,6 +5667,9 @@ static int vmauthenticate(struct ast_channel *chan, void *data)
s = user;
user = strsep(&s, "@");
context = strsep(&s, "");
if (!ast_strlen_zero(user))
skipuser++;
ast_copy_string(mailbox, user, sizeof(mailbox));
}
}
@@ -5672,9 +5677,10 @@ static int vmauthenticate(struct ast_channel *chan, void *data)
silent = (strchr(options, 's')) != NULL;
}
if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, 0, 3, silent)) {
if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, skipuser, 3, silent)) {
pbx_builtin_setvar_helper(chan, "AUTH_MAILBOX", mailbox);
pbx_builtin_setvar_helper(chan, "AUTH_CONTEXT", vmus.context);
ast_play_and_wait(chan, "auth-thankyou");
res = 0;
}