[Asterisk-cvs] asterisk/apps app_voicemail.c,1.61,1.62

malcolmd at lists.digium.com malcolmd at lists.digium.com
Thu Mar 18 17:54:00 CST 2004


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

Modified Files:
	app_voicemail.c 
Log Message:
Bug # 1247: Add patch to specify minimum vmail length and discard that 
which does not meet the minimum


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- app_voicemail.c	11 Mar 2004 07:00:46 -0000	1.61
+++ app_voicemail.c	18 Mar 2004 22:49:05 -0000	1.62
@@ -190,6 +190,7 @@
 static char mailcmd[160];	/* Configurable mail cmd */
 
 static char vmfmts[80];
+static int vmminmessage;
 static int vmmaxmessage;
 static int maxgreet;
 static int skipms;
@@ -1484,6 +1485,10 @@
 					} else
 						close(fd);
 				}
+				if (end - start < vmminmessage) {
+					ast_filedelete(fn, NULL);
+					goto leave_vm_out;
+				}
 				stringp = fmt;
 				strsep(&stringp, "|");
 				/* Send e-mail if applicable */
@@ -1510,6 +1515,7 @@
 			}
 		} else
 			ast_log(LOG_WARNING, "No format for saving voicemail?\n");					
+leave_vm_out:
 		free_user(vmu);
 	} else {
 		ast_log(LOG_WARNING, "No entry in voicemail config file for '%s'\n", ext);
@@ -3240,6 +3246,15 @@
 				vmmaxmessage = x;
 			} else {
 				ast_log(LOG_WARNING, "Invalid max message time length\n");
+			}
+		}
+
+		vmminmessage = 0;
+		if ((s = ast_variable_retrieve(cfg, "general", "minmessage"))) {
+			if (sscanf(s, "%d", &x) == 1) {
+				vmminmessage = x;
+			} else {
+				ast_log(LOG_WARNING, "Invalid min message time length\n");
 			}
 		}
 		fmt = ast_variable_retrieve(cfg, "general", "format");




More information about the svn-commits mailing list