[Asterisk-cvs] asterisk/apps app_voicemail.c,1.131,1.132

markster at lists.digium.com markster at lists.digium.com
Fri Jul 9 03:53:52 CDT 2004


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

Modified Files:
	app_voicemail.c 
Log Message:
Add "skipaftercmd" option to voicemail to move to the next message automatically (bug #1984)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- app_voicemail.c	8 Jul 2004 16:24:16 -0000	1.131
+++ app_voicemail.c	9 Jul 2004 07:39:39 -0000	1.132
@@ -263,6 +263,7 @@
 static int calloper;
 static int saycidinfo;
 static int hearenv;
+static int skipaftercmd;
 static char dialcontext[80];
 static char callcontext[80];
 static char exitcontext[80];
@@ -3771,7 +3772,16 @@
 					cmd = play_and_wait(chan, "vm-deleted");
 				else
 					cmd = play_and_wait(chan, "vm-undeleted");
+				if (skipaftercmd) {
+					if (vms.curmsg < vms.lastmsg) {
+                                	        vms.curmsg++;
+                                	        cmd = play_message(chan, vmu, &vms);
+                                	} else {
+                                        	cmd = play_and_wait(chan, "vm-nomore");
+                                	}
+                                }
 				break;
+	
 			case '8':
 				if(vms.lastmsg > -1)
 					cmd = forward_message(chan, context, vms.curdir, vms.curmsg, vmu, vmfmts);
@@ -3815,7 +3825,16 @@
 					if (!cmd)
 						cmd = play_and_wait(chan, "vm-messages");
 				}
-				break;
+				if (skipaftercmd) {
+					if (vms.curmsg < vms.lastmsg) {
+                                       		 vms.curmsg++;
+                                       	 	cmd = play_message(chan, vmu, &vms);
+                                	} else {
+                                        	cmd = play_and_wait(chan, "vm-nomore");
+                                	}
+				}
+                                break;
+
 			case '*':
 				if (!vms.starting) {
 					cmd = play_and_wait(chan, "vm-onefor");
@@ -4131,6 +4150,7 @@
 	char *astsaycid;
 	char *astcallop;
 	char *astreview;
+	char *astskipcmd;
 	char *asthearenv;
 	char *silencestr;
 	char *thresholdstr;
@@ -4291,7 +4311,14 @@
 			asthearenv = "yes";
 		}
 		hearenv = ast_true(asthearenv);	
-		
+
+		skipaftercmd = 0;
+		if (!(astskipcmd = ast_variable_retrieve(cfg, "general", "nextaftercmd"))) {
+			ast_log(LOG_DEBUG,"We are not going to skip to the next msg after save/delete\n");
+			astskipcmd = "no";
+		}
+		skipaftercmd = ast_true(astskipcmd);
+
 		if ((dialoutcxt = ast_variable_retrieve(cfg, "general", "dialout"))) {
                         strncpy(dialcontext, dialoutcxt, sizeof(dialcontext) - 1);
                         ast_log(LOG_DEBUG, "found dialout context: %s\n", dialcontext);




More information about the svn-commits mailing list