diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-07 22:56:49 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-07 22:56:49 +0000 |
commit | d31431d5a744d72ea5a015df243a7a2e6a19f900 (patch) | |
tree | 11deb3375388860f850a66542d3575331ce5b028 /apps/app_voicemail.c | |
parent | 9bdf5377557f2107aa4fba3f5127264145f33539 (diff) |
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
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-x | apps/app_voicemail.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 61f63d3f8..64bee7beb 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -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); |