diff options
author | Matthew Nicholson <mnicholson@digium.com> | 2009-11-30 21:13:42 +0000 |
---|---|---|
committer | Matthew Nicholson <mnicholson@digium.com> | 2009-11-30 21:13:42 +0000 |
commit | 8d1f4fa5ead02500a192acf0cca8bbb811c7cdd9 (patch) | |
tree | 3398dee593ce0203b6decedd6c7b104a227b6789 /apps | |
parent | c899add7f93bee564e6926d0c11e50615ba477f1 (diff) |
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: https://origsvn.digium.com/svn/asterisk/trunk@231616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index a69b306f2..673990ca4 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -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; |