[Asterisk-cvs] asterisk/apps app_voicemail.c,1.218,1.219

kpfleming at lists.digium.com kpfleming at lists.digium.com
Thu Jul 7 18:48:08 CDT 2005


Update of /usr/cvsroot/asterisk/apps
In directory localhost.localdomain:/tmp/cvs-serv16725/apps

Modified Files:
	app_voicemail.c 
Log Message:
allow user-configurable date formats in voicemail message body (bug #4554)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -d -r1.218 -r1.219
--- app_voicemail.c	23 Jun 2005 17:44:20 -0000	1.218
+++ app_voicemail.c	7 Jul 2005 22:56:49 -0000	1.219
@@ -338,6 +338,7 @@
 static char adsifdn[4] = "\x00\x00\x00\x0F";
 static char adsisec[4] = "\x9B\xDB\xF7\xAC";
 static int adsiver = 1;
+static char emaildateformat[32] = "%A, %B %d, %Y at %r";
 
 STANDARD_LOCAL_USER;
 
@@ -1540,6 +1541,9 @@
 		strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm);
 		fprintf(p, "Date: %s\n", date);
 
+		/* Set date format for voicemail mail */
+		strftime(date, sizeof(date), emaildateformat, &tm);
+
 		if (*fromstring) {
 			struct ast_channel *ast = ast_channel_alloc(0);
 			if (ast) {
@@ -1589,7 +1593,6 @@
 			fprintf(p, "--%s\n", bound);
 		}
 		fprintf(p, "Content-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n\n", charset);
-		strftime(date, sizeof(date), "%A, %B %d, %Y at %r", &tm);
 		if (emailbody) {
 			struct ast_channel *ast = ast_channel_alloc(0);
 			if (ast) {
@@ -5300,6 +5303,7 @@
 	char *callbackcxt = NULL;	
 	char *exitcxt = NULL;	
 	char *extpc;
+	char *emaildateformatstr;
 	int x;
 	int tmpadsi[4];
 
@@ -5349,6 +5353,11 @@
 				maxsilence *= 1000;
 		}
 
+		/* Load date format config for voicemail mail */
+		if ((emaildateformatstr = ast_variable_retrieve(cfg, "general", "emaildateformat"))) {
+			strncpy(emaildateformat, emaildateformatstr, sizeof(emaildateformat) - 1);
+		}
+
 		/* External password changing command */
 		if ((extpc = ast_variable_retrieve(cfg, "general", "externpass"))) {
 			strncpy(ext_pass_cmd,extpc,sizeof(ext_pass_cmd) - 1);




More information about the svn-commits mailing list