Merged revisions 231614 via svnmerge from
[asterisk/asterisk.git] / apps / app_voicemail.c
index a69b306..673990c 100644 (file)
@@ -10617,7 +10617,7 @@ static int load_config(int reload)
        char *cat;
        struct ast_variable *var;
        const char *val;
-       char *q, *stringp;
+       char *q, *stringp, *tmp;
        int x;
        int tmpadsi[4];
        struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
@@ -10926,8 +10926,16 @@ static int load_config(int reload)
                }
 
                val = ast_variable_retrieve(cfg, "general", "format");
-               if (!val)
+               if (!val) {
                        val = "wav";    
+               } else {
+                       tmp = ast_strdupa(val);
+                       val = ast_format_str_reduce(tmp);
+                       if (!val) {
+                               ast_log(LOG_ERROR, "Error processing format string, defaulting to format 'wav'\n");
+                               val = "wav";
+                       }
+               }
                ast_copy_string(vmfmts, val, sizeof(vmfmts));
 
                skipms = 3000;