aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-03 22:13:56 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-03 22:13:56 +0000
commitdc26f23367bdc4a8b56dbb47ded722cc45a86406 (patch)
treeb14dc1803b8cf32f2d23eccd84b610467428cb60
parent76c6c5584ac26fd108f273980059f6cb794e109b (diff)
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) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232916 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--CHANGES2
-rw-r--r--apps/app_voicemail.c10
-rw-r--r--configs/voicemail.conf.sample5
3 files changed, 16 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index e744b497a..1398f1bf9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -108,6 +108,8 @@ Applications
* 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
------------------
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fa1da49be..eb3769d7b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -833,6 +833,7 @@ static unsigned char adsifdn[4] = "\x00\x00\x00\x0F";
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 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
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 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
}
}
- 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 @@ static int load_config(int reload)
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));
diff --git a/configs/voicemail.conf.sample b/configs/voicemail.conf.sample
index 59c191871..e748fdbd5 100644
--- a/configs/voicemail.conf.sample
+++ b/configs/voicemail.conf.sample
@@ -147,6 +147,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
;
;mailcmd=/usr/sbin/sendmail -t