[asterisk-commits] tilghman: trunk r232916 - in /trunk: ./ apps/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 3 16:14:00 CST 2009


Author: tilghman
Date: Thu Dec  3 16:13:56 2009
New Revision: 232916

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=232916
Log:
Add pagerdateformat, to allow shorter dates for SMS messages.
(closes issue #16263)
 Reported by: andrew
 Patches: 
       pagerdate.patch uploaded by andrew (license 240)
       (with a slight modification by me)

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

Modified: trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/trunk/CHANGES?view=diff&rev=232916&r1=232915&r2=232916
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Thu Dec  3 16:13:56 2009
@@ -108,6 +108,8 @@
  * Voicemail now supports per mailbox settings for folders when using IMAP storage.
    Previously the folder could only be set per context, but has now been extended 
    using the imapfolder option.
+ * Voicemail now allows the pager date format to be specified separately from the
+   email date format.
 
 Dialplan Functions
 ------------------

Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=232916&r1=232915&r2=232916
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Dec  3 16:13:56 2009
@@ -833,6 +833,7 @@
 static unsigned char adsisec[4] = "\x9B\xDB\xF7\xAC";
 static int adsiver = 1;
 static char emaildateformat[32] = "%A, %B %d, %Y at %r";
+static char pagerdateformat[32] = "%A, %B %d, %Y at %r";
 
 /* Forward declarations - generic */
 static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box);
@@ -4565,6 +4566,9 @@
 	ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
 	fprintf(p, "Date: %s\n", date);
 
+	/* Reformat for custom pager format */
+	ast_strftime(date, sizeof(date), pagerdateformat, vmu_tm(vmu, &tm));
+
 	if (!ast_strlen_zero(pagerfromstring)) {
 		struct ast_channel *ast;
 		if ((ast = ast_dummy_channel_alloc())) {
@@ -4642,7 +4646,6 @@
 		}
 	}
 
-	ast_strftime(date, sizeof(date), "%A, %B %d, %Y at %r", &tm);
 	if (pagerbody) {
 		struct ast_channel *ast;
 		if ((ast = ast_dummy_channel_alloc())) {
@@ -10783,6 +10786,11 @@
 			ast_copy_string(emaildateformat, val, sizeof(emaildateformat));
 		}
 
+		/* Load date format config for voicemail pager mail */
+		if ((val = ast_variable_retrieve(cfg, "general", "pagerdateformat"))) {
+			ast_copy_string(pagerdateformat, val, sizeof(pagerdateformat));
+		}
+
 		/* External password changing command */
 		if ((val = ast_variable_retrieve(cfg, "general", "externpass"))) {
 			ast_copy_string(ext_pass_cmd, val, sizeof(ext_pass_cmd));

Modified: trunk/configs/voicemail.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/voicemail.conf.sample?view=diff&rev=232916&r1=232915&r2=232916
==============================================================================
--- trunk/configs/voicemail.conf.sample (original)
+++ trunk/configs/voicemail.conf.sample Thu Dec  3 16:13:56 2009
@@ -146,6 +146,11 @@
 emaildateformat=%A, %B %d, %Y at %r
 ; 24h date format
 ;emaildateformat=%A, %d %B %Y at %H:%M:%S
+;
+; Default for pager use
+pagerdateformat=%A, %B %d, %Y at %r
+; Short 24h date format for pager use
+;pagerdateformat=%T %D
 ;
 ; You can override the default program to send e-mail if you wish, too
 ;




More information about the asterisk-commits mailing list