[Asterisk-cvs] asterisk/apps app_voicemail.c,1.151.2.2,1.151.2.3

russell at lists.digium.com russell at lists.digium.com
Sat Oct 23 07:51:35 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv32747/apps

Modified Files:
      Tag: v1-0
	app_voicemail.c 
Log Message:
make operator=no work correctly, fix typo (bug #2665)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.151.2.2
retrieving revision 1.151.2.3
diff -u -d -r1.151.2.2 -r1.151.2.3
--- app_voicemail.c	12 Oct 2004 01:39:21 -0000	1.151.2.2
+++ app_voicemail.c	23 Oct 2004 11:55:21 -0000	1.151.2.3
@@ -1418,16 +1418,22 @@
 		}
 		/* Check for a '0' here */
 		if (res == '0') {
-		transfer:
-			strncpy(chan->exten, "o", sizeof(chan->exten) - 1);
-			if (!ast_strlen_zero(vmu->exit)) {
-				strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1);
-			} else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
-				strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1);
+			transfer:
+			if (vmu->operator) {
+				strncpy(chan->exten, "o", sizeof(chan->exten) - 1);
+				if (!ast_strlen_zero(vmu->exit)) {
+					strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1);
+				} else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
+					strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1);
+				}
+				ast_play_and_wait(chan, "transfer");
+				chan->priority = 0;
+				free_user(vmu);
+				return 0;
+			} else {
+				ast_play_and_wait(chan, "vm-sorry");
+				return 0;
 			}
-			chan->priority = 0;
-			free_user(vmu);
-			return 0;
 		}
 		if (res < 0) {
 			free_user(vmu);
@@ -4653,9 +4659,7 @@
  			/* User has hung up, no options to give */
  				return res;
  			if (cmd == '0') {
- 				/* Erase the message if 0 pushed during playback */
- 				ast_play_and_wait(chan, "vm-deleted");
- 			 	vm_delete(recordfile);
+ 				break;
  			} else if (cmd == '*') {
  				break;
  			} 
@@ -4708,13 +4712,11 @@
  				return 1;
 #endif
  		case '0':
- 			if (outsidecaller && vmu->operator) {
- 				if (message_exists)
- 					ast_play_and_wait(chan, "vm-msgsaved");
- 				return cmd;
- 			} else
- 				cmd = ast_play_and_wait(chan, "vm-sorry");
- 			break;
+			if (message_exists || recorded) {
+				ast_play_and_wait(chan, "vm-deleted");
+				vm_delete(recordfile);
+			}
+			return cmd;
  		default:
 			/* If the caller is an ouside caller, and the review option is enabled,
 			   allow them to review the message, but let the owner of the box review




More information about the svn-commits mailing list