From: David Brooks Date: Fri, 26 Jun 2009 20:13:51 +0000 (+0000) Subject: Fixing voicemail's error in checking max silence vs min message length X-Git-Tag: 11.0.0-beta1~4590 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c6f164227c75e58cea271848476cb31fef79121;p=thirdparty%2Fasterisk.git Fixing voicemail's error in checking max silence vs min message length Max silence was represented in milliseconds, yet vmminsecs (minmessage) was represented as seconds. Also, the inequality was reversed. The warning, if triggered, was "Max silence should be less than minmessage or you may get empty messages", which should have been logged if max silence was greater than minmessage, but the check was for less than. Also, conforming if statement to coding guidelines. closes issue #15331) Reported by: markd Review: https://reviewboard.asterisk.org/r/293/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203721 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index b058ab182f..2b20c73201 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -10750,8 +10750,9 @@ static int load_config(int reload) if ((val = ast_variable_retrieve(cfg, "general", "minsecs"))) { if (sscanf(val, "%d", &x) == 1) { vmminsecs = x; - if (maxsilence <= vmminsecs) + if (maxsilence / 1000 >= vmminsecs) { ast_log(AST_LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n"); + } } else { ast_log(AST_LOG_WARNING, "Invalid min message time length\n"); } @@ -10763,8 +10764,9 @@ static int load_config(int reload) } if (sscanf(val, "%d", &x) == 1) { vmminsecs = x; - if (maxsilence <= vmminsecs) + if (maxsilence / 1000 >= vmminsecs) { ast_log(AST_LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n"); + } } else { ast_log(AST_LOG_WARNING, "Invalid min message time length\n"); }