aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-30 21:37:21 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-30 21:37:21 +0000
commit6c919bbaa07cd613beb00a82fae42c87a5119373 (patch)
treec1b9c7a95644a3f561124323bc76827aca902d3c /apps
parent0d6be1d9f8ddd58ea19e14af1b3989b0887d7346 (diff)
Merged revisions 231688 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r231688 | mnicholson | 2009-11-30 15:31:55 -0600 (Mon, 30 Nov 2009) | 15 lines Merged revisions 231614 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r231614 | mnicholson | 2009-11-30 15:11:44 -0600 (Mon, 30 Nov 2009) | 8 lines Remove duplicate entries from voicemail format lists. This prevents app_voicemail from entering an infinite loop when the same format is specified twice in the format list. (closes issue #15625) Reported by: Shagg63 Tested by: mnicholson Review: https://reviewboard.asterisk.org/r/429/ ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@231691 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 00ba2b91b..612358703 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9198,7 +9198,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 };
@@ -9482,8 +9482,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;