Merged revisions 14275 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r14275 | file | 2006-03-22 18:13:30 -0400 (Wed, 22 Mar 2006) | 2 lines

Issue #6781 - Verbose levels not enforced in app_voicemail (Reported by flobi)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@14277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Joshua Colp 20 years ago
parent 6cda4c3b8b
commit 7b54d83b1e

@ -3697,12 +3697,14 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
if (!ast_strlen_zero(prefile)) { if (!ast_strlen_zero(prefile)) {
/* See if we can find a recorded name for this person instead of their extension number */ /* See if we can find a recorded name for this person instead of their extension number */
if (ast_fileexists(prefile, NULL, NULL) > 0) { if (ast_fileexists(prefile, NULL, NULL) > 0) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid); ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
if (!callback) if (!callback)
res = wait_file2(chan, vms, "vm-from"); res = wait_file2(chan, vms, "vm-from");
res = ast_streamfile(chan, prefile, chan->language) > -1; res = ast_streamfile(chan, prefile, chan->language) > -1;
res = ast_waitstream(chan, ""); res = ast_waitstream(chan, "");
} else { } else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid); ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
/* BB: Say "from extension" as one saying to sound smoother */ /* BB: Say "from extension" as one saying to sound smoother */
if (!callback) if (!callback)
@ -5356,6 +5358,7 @@ static int vm_execmain(struct ast_channel *chan, void *data)
cmd = 't'; cmd = 't';
break; break;
case '2': /* Callback */ case '2': /* Callback */
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n"); ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n");
if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1) { if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1) {
cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain); cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain);
@ -6443,6 +6446,7 @@ static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num,
int retries = 0; int retries = 0;
if (!num) { if (!num) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n"); ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
while (retries < 3 && cmd != 't') { while (retries < 3 && cmd != 't') {
destination[1] = '\0'; destination[1] = '\0';
@ -6463,6 +6467,7 @@ static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num,
if (cmd < 0) if (cmd < 0)
return 0; return 0;
if (cmd == '*') { if (cmd == '*') {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n"); ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
return 0; return 0;
} }
@ -6477,6 +6482,7 @@ static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num,
} }
} else { } else {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Destination number is CID number '%s'\n", num); ast_verbose( VERBOSE_PREFIX_3 "Destination number is CID number '%s'\n", num);
ast_copy_string(destination, num, sizeof(destination)); ast_copy_string(destination, num, sizeof(destination));
} }
@ -6484,6 +6490,7 @@ static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num,
if (!ast_strlen_zero(destination)) { if (!ast_strlen_zero(destination)) {
if (destination[strlen(destination) -1 ] == '*') if (destination[strlen(destination) -1 ] == '*')
return 0; return 0;
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Placing outgoing call to extension '%s' in context '%s' from context '%s'\n", destination, outgoing_context, chan->context); ast_verbose( VERBOSE_PREFIX_3 "Placing outgoing call to extension '%s' in context '%s' from context '%s'\n", destination, outgoing_context, chan->context);
ast_copy_string(chan->exten, destination, sizeof(chan->exten)); ast_copy_string(chan->exten, destination, sizeof(chan->exten));
ast_copy_string(chan->context, outgoing_context, sizeof(chan->context)); ast_copy_string(chan->context, outgoing_context, sizeof(chan->context));
@ -6555,6 +6562,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
if (res) if (res)
return 9; return 9;
} else { } else {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n"); ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
res = ast_play_and_wait(chan, "vm-sorry"); res = ast_play_and_wait(chan, "vm-sorry");
} }
@ -6576,6 +6584,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
break; break;
default: default:
if (num) { if (num) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num); ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
res = ast_play_and_wait(chan, "vm-num-i-have"); res = ast_play_and_wait(chan, "vm-num-i-have");
if (!res) if (!res)
@ -6618,6 +6627,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
if (!ast_strlen_zero(cid)) { if (!ast_strlen_zero(cid)) {
ast_callerid_parse(cid, &name, &num); ast_callerid_parse(cid, &name, &num);
if (!num) { if (!num) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n"); ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
if (!res) if (!res)
res = ast_play_and_wait(chan, "vm-nonumber"); res = ast_play_and_wait(chan, "vm-nonumber");
@ -6626,6 +6636,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
if (find_user(NULL, vmu->context, num)) { if (find_user(NULL, vmu->context, num)) {
struct leave_vm_options leave_options; struct leave_vm_options leave_options;
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context); ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
memset(&leave_options, 0, sizeof(leave_options)); memset(&leave_options, 0, sizeof(leave_options));
@ -6636,6 +6647,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
return res; return res;
} else { } else {
/* Sender has no mailbox, can't reply */ /* Sender has no mailbox, can't reply */
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context); ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
ast_play_and_wait(chan, "vm-nobox"); ast_play_and_wait(chan, "vm-nobox");
res = 't'; res = 't';
@ -6687,6 +6699,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
break; break;
} else { } else {
/* Otherwise 1 is to save the existing message */ /* Otherwise 1 is to save the existing message */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n"); ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
ast_streamfile(chan, "vm-msgsaved", chan->language); ast_streamfile(chan, "vm-msgsaved", chan->language);
ast_waitstream(chan, ""); ast_waitstream(chan, "");
@ -6697,6 +6710,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
} }
case '2': case '2':
/* Review */ /* Review */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\n"); ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\n");
ast_streamfile(chan, recordfile, chan->language); ast_streamfile(chan, recordfile, chan->language);
cmd = ast_waitstream(chan, AST_DIGIT_ANY); cmd = ast_waitstream(chan, AST_DIGIT_ANY);
@ -6705,8 +6719,10 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
message_exists = 0; message_exists = 0;
/* Record */ /* Record */
if (recorded == 1) if (recorded == 1)
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Re-recording the message\n"); ast_verbose(VERBOSE_PREFIX_3 "Re-recording the message\n");
else else
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Recording the message\n"); ast_verbose(VERBOSE_PREFIX_3 "Recording the message\n");
if (recorded && outsidecaller) { if (recorded && outsidecaller) {
cmd = ast_play_and_wait(chan, INTRO); cmd = ast_play_and_wait(chan, INTRO);
@ -6731,6 +6747,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
#if 0 #if 0
else if (vmu->review && (*duration < 5)) { else if (vmu->review && (*duration < 5)) {
/* Message is too short */ /* Message is too short */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Message too short\n"); ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
cmd = ast_play_and_wait(chan, "vm-tooshort"); cmd = ast_play_and_wait(chan, "vm-tooshort");
cmd = vm_delete(recordfile); cmd = vm_delete(recordfile);
@ -6738,6 +6755,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
} }
else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) { else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) {
/* Message is all silence */ /* Message is all silence */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n"); ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
cmd = vm_delete(recordfile); cmd = vm_delete(recordfile);
cmd = ast_play_and_wait(chan, "vm-nothingrecorded"); cmd = ast_play_and_wait(chan, "vm-nothingrecorded");

Loading…
Cancel
Save