[asterisk-commits] trunk r14277 - in /trunk: ./ apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 22 15:27:12 MST 2006


Author: file
Date: Wed Mar 22 16:27:11 2006
New Revision: 14277

URL: http://svn.digium.com/view/asterisk?rev=14277&view=rev
Log:
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)

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=14277&r1=14276&r2=14277&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Mar 22 16:27:11 2006
@@ -3697,13 +3697,15 @@
 				if (!ast_strlen_zero(prefile)) {
 				/* See if we can find a recorded name for this person instead of their extension number */
 					if (ast_fileexists(prefile, NULL, NULL) > 0) {
-						ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: CID number '%s' matches mailbox number, playing recorded name\n", callerid);
 						if (!callback)
 							res = wait_file2(chan, vms, "vm-from");
 						res = ast_streamfile(chan, prefile, chan->language) > -1;
 						res = ast_waitstream(chan, "");
 					} else {
-						ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
+						if (option_verbose > 2)
+							ast_verbose(VERBOSE_PREFIX_3 "Playing envelope info: message from '%s'\n", callerid);
 						/* BB: Say "from extension" as one saying to sound smoother */
 						if (!callback)
 							res = wait_file2(chan, vms, "vm-from-extension");
@@ -5356,7 +5358,8 @@
 					cmd = 't';
 					break;
 				case '2': /* Callback */
-					ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n");
+					if (option_verbose > 2)
+						ast_verbose( VERBOSE_PREFIX_3 "Callback Requested\n");
 					if (!ast_strlen_zero(vmu->callback) && vms.lastmsg > -1) {
 						cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 2, record_gain);
 						if (cmd == 9) {
@@ -6443,7 +6446,8 @@
 	int retries = 0;
 
 	if (!num) {
-		ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
+		if (option_verbose > 2)
+			ast_verbose( VERBOSE_PREFIX_3 "Destination number will be entered manually\n");
 		while (retries < 3 && cmd != 't') {
 			destination[1] = '\0';
 			destination[0] = cmd = ast_play_and_wait(chan,"vm-enter-num-to-call");
@@ -6463,7 +6467,8 @@
 				if (cmd < 0)
 					return 0;
 				if (cmd == '*') {
-					ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
+					if (option_verbose > 2)
+						ast_verbose( VERBOSE_PREFIX_3 "User hit '*' to cancel outgoing call\n");
 					return 0;
 				}
 				if ((cmd = ast_readstring(chan,destination + strlen(destination),sizeof(destination)-1,6000,10000,"#")) < 0) 
@@ -6477,14 +6482,16 @@
 		}
 		
 	} else {
-		ast_verbose( VERBOSE_PREFIX_3 "Destination number is CID number '%s'\n", num);
+		if (option_verbose > 2)
+			ast_verbose( VERBOSE_PREFIX_3 "Destination number is CID number '%s'\n", num);
 		ast_copy_string(destination, num, sizeof(destination));
 	}
 
 	if (!ast_strlen_zero(destination)) {
 		if (destination[strlen(destination) -1 ] == '*')
 			return 0; 
-		ast_verbose( VERBOSE_PREFIX_3 "Placing outgoing call to extension '%s' in context '%s' from context '%s'\n", destination, outgoing_context, chan->context);
+		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_copy_string(chan->exten, destination, sizeof(chan->exten));
 		ast_copy_string(chan->context, outgoing_context, sizeof(chan->context));
 		chan->priority = 0;
@@ -6555,7 +6562,8 @@
 							if (res)
 								return 9;
 						} else {
-							ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
+							if (option_verbose > 2)
+								ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
 							res = ast_play_and_wait(chan, "vm-sorry");
 						}
 						return res;
@@ -6576,7 +6584,8 @@
 						break;
 					default:
 						if (num) {
-							ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
+							if (option_verbose > 2)
+								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");
 							if (!res)
 								res = play_message_callerid(chan, vms, num, vmu->context, 1);
@@ -6618,7 +6627,8 @@
 		if (!ast_strlen_zero(cid)) {
 			ast_callerid_parse(cid, &name, &num);
 			if (!num) {
-				ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
 				if (!res)
 					res = ast_play_and_wait(chan, "vm-nonumber");
 				return res;
@@ -6626,7 +6636,8 @@
 				if (find_user(NULL, vmu->context, num)) {
 					struct leave_vm_options leave_options;
 
-					ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", 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;
@@ -6636,7 +6647,8 @@
 					return res;
 				} else {
 					/* Sender has no mailbox, can't reply */
-					ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
+					if (option_verbose > 2)
+						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");
 					res = 't';
 					return res;
@@ -6687,7 +6699,8 @@
  				break;
  			} else {
  				/* Otherwise 1 is to save the existing message */
- 				ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
+ 				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
  				ast_streamfile(chan, "vm-msgsaved", chan->language);
  				ast_waitstream(chan, "");
 				STORE(recordfile, vmu->mailbox, vmu->context, -1);
@@ -6697,7 +6710,8 @@
  			}
  		case '2':
  			/* Review */
- 			ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\n");
+ 			if (option_verbose > 2)
+				ast_verbose(VERBOSE_PREFIX_3 "Reviewing the message\n");
  			ast_streamfile(chan, recordfile, chan->language);
  			cmd = ast_waitstream(chan, AST_DIGIT_ANY);
  			break;
@@ -6705,9 +6719,11 @@
  			message_exists = 0;
  			/* Record */
  			if (recorded == 1)
-				ast_verbose(VERBOSE_PREFIX_3 "Re-recording the message\n");
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Re-recording the message\n");
  			else	
-				ast_verbose(VERBOSE_PREFIX_3 "Recording the message\n");
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Recording the message\n");
 			if (recorded && outsidecaller) {
  				cmd = ast_play_and_wait(chan, INTRO);
  				cmd = ast_play_and_wait(chan, "beep");
@@ -6731,14 +6747,16 @@
 #if 0			
  			else if (vmu->review && (*duration < 5)) {
  				/* Message is too short */
- 				ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
+ 				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Message too short\n");
 				cmd = ast_play_and_wait(chan, "vm-tooshort");
  				cmd = vm_delete(recordfile);
  				break;
  			}
  			else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) {
  				/* Message is all silence */
- 				ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
+ 				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Nothing recorded\n");
  				cmd = vm_delete(recordfile);
 				cmd = ast_play_and_wait(chan, "vm-nothingrecorded");
 				if (!cmd)



More information about the asterisk-commits mailing list