allow user-configurable date formats in voicemail message body (bug #4554)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6050 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
9bdf537755
commit
d31431d5a7
|
@ -338,6 +338,7 @@ static char charset[32] = "ISO-8859-1";
|
|||
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 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *c
|
|||
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 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *c
|
|||
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 @@ static int load_config(void)
|
|||
char *callbackcxt = NULL;
|
||||
char *exitcxt = NULL;
|
||||
char *extpc;
|
||||
char *emaildateformatstr;
|
||||
int x;
|
||||
int tmpadsi[4];
|
||||
|
||||
|
@ -5349,6 +5353,11 @@ static int load_config(void)
|
|||
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);
|
||||
|
|
|
@ -61,6 +61,12 @@ maxlogins=3
|
|||
; The following definition is very close to the default, but the default shows just
|
||||
; the CIDNAME, if it is not null, else just the CIDNUM, or "an unknown caller" if they are both null.
|
||||
;emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just left a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE}, so you might\nwant to check it when you get a chance. Thanks!\n\n\t\t\t\t--Asterisk\n
|
||||
; Set the date format on outgoing mails. Valid arguments can be found on the strftime(3) man page
|
||||
;
|
||||
; Default
|
||||
emaildateformat=%A, %B %d, %Y at %r
|
||||
; 24h date format
|
||||
;emaildateformat=%A, %d %B %Y at %H:%M:%S
|
||||
|
||||
;
|
||||
; You can override the default program to send e-mail if you wish, too
|
||||
|
|
Reference in New Issue