[asterisk-commits] qwell: trunk r82871 - in /trunk: apps/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 18 16:07:08 CDT 2007


Author: qwell
Date: Tue Sep 18 16:07:08 2007
New Revision: 82871

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82871
Log:
(closes issue #10739)
Reported by: ruffle
Patches:
      app_voicemail.c.diff uploaded by ruffle (license 201)
      10739-moveheard.diff uploaded by qwell (license 4)
Tested by: callguy, ruffle

Add an option to disable the automatic moving of "heard" messages to the Old folder.

Modified:
    trunk/apps/app_voicemail.c
    trunk/configs/voicemail.conf.sample

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=82871&r1=82870&r2=82871
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Tue Sep 18 16:07:08 2007
@@ -223,6 +223,7 @@
 #define VM_ALLOCED       (1 << 13)
 #define VM_SEARCH        (1 << 14)
 #define VM_TEMPGREETWARN (1 << 15)  /*!< Remind user tempgreeting is set */
+#define VM_MOVEHEARD     (1 << 16)  /*!< Move a "heard" message to Old after listening to it */
 #define ERROR_LOCK_PATH  -100
 
 
@@ -716,6 +717,8 @@
 		ast_set2_flag(vmu, ast_true(value), VM_OPERATOR);	
 	} else if (!strcasecmp(var, "envelope")){
 		ast_set2_flag(vmu, ast_true(value), VM_ENVELOPE);	
+	} else if (!strcasecmp(var, "moveheard")){
+		ast_set2_flag(vmu, ast_true(value), VM_MOVEHEARD);
 	} else if (!strcasecmp(var, "sayduration")){
 		ast_set2_flag(vmu, ast_true(value), VM_SAYDURATION);	
 	} else if (!strcasecmp(var, "saydurationm")){
@@ -5183,7 +5186,7 @@
 		return ERROR_LOCK_PATH;
 	 
 	for (x = 0; x < vmu->maxmsg; x++) { 
-		if (!vms->deleted[x] && (strcasecmp(vms->curbox, "INBOX") || !vms->heard[x])) { 
+		if (!vms->deleted[x] && (strcasecmp(vms->curbox, "INBOX") || !vms->heard[x] || (vms->heard[x] && !ast_test_flag(vmu, VM_MOVEHEARD)))) { 
 			/* Save this message.  It's not in INBOX or hasn't been heard */ 
 			make_file(vms->fn, sizeof(vms->fn), vms->curdir, x); 
 			if (!EXISTS(vms->curdir, x, vms->fn, NULL)) 
@@ -5193,7 +5196,7 @@
 			if (strcmp(vms->fn, vms->fn2)) { 
 				RENAME(vms->curdir, x, vmu->mailbox,vmu->context, vms->curdir, vms->curmsg, vms->fn, vms->fn2);
 			} 
-		} else if (!strcasecmp(vms->curbox, "INBOX") && vms->heard[x] && !vms->deleted[x]) { 
+		} else if (!strcasecmp(vms->curbox, "INBOX") && vms->heard[x] && ast_test_flag(vmu, VM_MOVEHEARD) && !vms->deleted[x]) { 
 			/* Move to old folder before deleting */ 
 			res = save_to_folder(vmu, vms, x, 1);
 			if (res == ERROR_LOCK_PATH) {
@@ -8295,6 +8298,12 @@
 			val = "yes";
 		}
 		ast_set2_flag((&globalflags), ast_true(val), VM_ENVELOPE);	
+
+		if (!(val = ast_variable_retrieve(cfg, "general", "moveheard"))) {
+			ast_debug(1,"Move Heard enabled globally\n");
+			val = "yes";
+		}
+		ast_set2_flag((&globalflags), ast_true(val), VM_MOVEHEARD);	
 
 		if (!(val = ast_variable_retrieve(cfg, "general", "sayduration"))) {
 			ast_debug(1,"Duration info before msg enabled globally\n");

Modified: trunk/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/voicemail.conf.sample?view=diff&rev=82871&r1=82870&r2=82871
==============================================================================
--- trunk/configs/voicemail.conf.sample (original)
+++ trunk/configs/voicemail.conf.sample Tue Sep 18 16:07:08 2007
@@ -50,6 +50,9 @@
 silencethreshold=128
 ; Max number of failed login attempts
 maxlogins=3
+;
+; Move heard messages to the 'Old' folder automagically.  Defaults to on.
+;moveheard=yes
 ;
 ; User context is where entries from users.conf are registered.  The
 ; default value is 'default'
@@ -279,7 +282,7 @@
 ;4200 => 9855,Mark Spencer,markster at linux-support.net,mypager at digium.com,attach=no|serveremail=myaddy at digium.com|tz=central|maxmsg=10
 ;4300 => 3456,Ben Rigas,ben at american-computer.net
 ;4310 => -5432,Sales,sales at marko.net
-;4069 => 6522,Matt Brooks,matt at marko.net,,|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes|envelope=yes|sayduration=yes|saydurationm=1
+;4069 => 6522,Matt Brooks,matt at marko.net,,|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes|envelope=yes|moveheard=yes|sayduration=yes|saydurationm=1
 ;4073 => 1099,Bianca Paige,bianca at biancapaige.com,,delete=1
 ;4110 => 3443,Rob Flynn,rflynn at blueridge.net
 ;4235 => 1234,Jim Holmes,jim at astricon.ips,,Tz=european




More information about the asterisk-commits mailing list