Index: CHANGES =================================================================== --- CHANGES (revision 198469) +++ CHANGES (working copy) @@ -344,6 +344,7 @@ o speeddial variable added o addon variable added 24. voicemail.conf + o emaildatelocale variable added o userscontext variable added o smdiport variable added o attachfmt variable added Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 198469) +++ apps/app_voicemail.c (working copy) @@ -65,6 +65,9 @@ #include #include #include +#ifdef HAVE_LOCALE_H +#include +#endif #include #ifdef IMAP_STORAGE #include @@ -577,6 +580,10 @@ static unsigned char adsisec[4] = "\x9B\xDB\xF7\xAC"; static int adsiver = 1; static char emaildateformat[32] = "%A, %B %d, %Y at %r"; +#ifdef HAVE_LOCALE_H +static char emaildatelocale[32]; +AST_MUTEX_DEFINE_STATIC(setlocale_emaildate_lock); +#endif static char *strip_control(const char *input, char *buf, size_t buflen) @@ -3197,7 +3204,21 @@ fprintf(p, "Date: %s" ENDL, date); /* Set date format for voicemail mail */ +#ifdef HAVE_LOCALE_H + if (*emaildatelocale) { + char *loc; + ast_mutex_lock(&setlocale_emaildate_lock); + loc = ast_strdup(setlocale(LC_TIME, NULL)); + setlocale(LC_TIME, emaildatelocale); + strftime(date, sizeof(date), emaildateformat, &tm); + setlocale(LC_TIME, loc); + ast_free(loc); + ast_mutex_unlock(&setlocale_emaildate_lock); + } else + strftime(date, sizeof(date), emaildateformat, &tm); +#else strftime(date, sizeof(date), emaildateformat, &tm); +#endif if (*fromstring) { struct ast_channel *ast; @@ -8387,6 +8408,14 @@ ast_copy_string(emaildateformat, emaildateformatstr, sizeof(emaildateformat)); } +#ifdef HAVE_LOCALE_H + /* Load date locale config for voicemail mail */ + memset(emaildatelocale,0,sizeof(emaildatelocale)); + if ((s = ast_variable_retrieve(cfg, "general", "emaildatelocale"))) { + ast_copy_string(emaildatelocale,s,sizeof(emaildatelocale)); + } +#endif + /* External password changing command */ if ((extpc = ast_variable_retrieve(cfg, "general", "externpass"))) { ast_copy_string(ext_pass_cmd,extpc,sizeof(ext_pass_cmd));