Index: configs/voicemail.conf.sample =================================================================== --- configs/voicemail.conf.sample (revision 211731) +++ configs/voicemail.conf.sample (working copy) @@ -92,7 +92,8 @@ ; For the directory, you can override the intro file if you want ;directoryintro=dir-intro ; The character set for voicemail messages can be specified here -;charset=ISO-8859-1 +; default: ISO-8859-1 +;charset=UTF-8 ; The ADSI feature descriptor number to download to ;adsifdn=0000000F ; The ADSI security lock code @@ -220,6 +221,13 @@ ; overridden in the per-mailbox settings, unless listed otherwise. ; ; tz=central ; Timezone from zonemessages below. Irrelevant if envelope=no. +; locale=de_DE.UTF-8 ; set the locale for generation of the date/time strings (make + ; sure the locales are installed in your operating system; e.g + ; on Debian Linux you can use "dpkg-reconfigure locales"). + ; If you use UTF-8 locales, make sure to set the "charset" option + ; to UTF-8 too. If you mix different locales for different users + ; you should avoid words in the emaildateformat specification, e.g.: + ; emaildateformat=%A, %d %B %Y, %H:%M:%S ; attach=yes ; Attach the voicemail to the notification email *NOT* the pager email ; attachfmt=wav49 ; Which format to attach to the email. Normally this is the ; first format specified in the format parameter above, but this Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 211731) +++ apps/app_voicemail.c (working copy) @@ -578,6 +578,7 @@ char mailcmd[160]; /*!< Configurable mail command */ char language[MAX_LANGUAGE]; /*!< Config: Language setting */ char zonetag[80]; /*!< Time zone */ + char locale[20]; /*!< The locale (for presentation of date/time) */ char callback[80]; char dialout[80]; char uniqueid[80]; /*!< Unique integer identifier */ @@ -707,6 +708,7 @@ static AST_LIST_HEAD_STATIC(users, ast_vm_user); static AST_LIST_HEAD_STATIC(zones, vm_zone); static char zonetag[80]; +static char locale[20]; static int maxsilence; static int maxmsg; static int maxdeletedmsg; @@ -865,6 +867,7 @@ ast_copy_string(vmu->dialout, dialcontext, sizeof(vmu->dialout)); ast_copy_string(vmu->exit, exitcontext, sizeof(vmu->exit)); ast_copy_string(vmu->zonetag, zonetag, sizeof(vmu->zonetag)); + ast_copy_string(vmu->locale, locale, sizeof(vmu->locale)); if (vmmaxsecs) vmu->maxsecs = vmmaxsecs; if (maxmsg) @@ -897,6 +900,8 @@ ast_copy_string(vmu->language, value, sizeof(vmu->language)); } else if (!strcasecmp(var, "tz")) { ast_copy_string(vmu->zonetag, value, sizeof(vmu->zonetag)); + } else if (!strcasecmp(var, "locale")) { + ast_copy_string(vmu->locale, value, sizeof(vmu->locale)); #ifdef IMAP_STORAGE } else if (!strcasecmp(var, "imapuser")) { ast_copy_string(vmu->imapuser, value, sizeof(vmu->imapuser)); @@ -4094,7 +4099,11 @@ fprintf(p, "Date: %s" ENDL, date); /* Set date format for voicemail mail */ - ast_strftime(date, sizeof(date), emaildateformat, &tm); + if (ast_strlen_zero(vmu->locale)) { + ast_strftime(date, sizeof(date), emaildateformat, &tm); + } else { + ast_strftime_locale(date, sizeof(date), emaildateformat, &tm, vmu->locale); + } if (!ast_strlen_zero(fromstring)) { struct ast_channel *ast; @@ -4504,7 +4513,11 @@ } } - ast_strftime(date, sizeof(date), "%A, %B %d, %Y at %r", &tm); + if (ast_strlen_zero(vmu->locale)) { + ast_strftime(date, sizeof(date), "%A, %B %d, %Y at %r", &tm); + } else { + ast_strftime_locale(date, sizeof(date), "%A, %B %d, %Y at %r", &tm, vmu->locale); + } if (pagerbody) { struct ast_channel *ast; if ((ast = ast_dummy_channel_alloc())) { @@ -11068,6 +11081,9 @@ if ((val = ast_variable_retrieve(cfg, "general", "tz"))) { ast_copy_string(zonetag, val, sizeof(zonetag)); } + if ((val = ast_variable_retrieve(cfg, "general", "locale"))) { + ast_copy_string(locale, val, sizeof(locale)); + } if ((val = ast_variable_retrieve(cfg, "general", "emailsubject"))) { emailsubject = ast_strdup(val); }