]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 203721 via svnmerge from
authorDavid Brooks <dbrooks@digium.com>
Fri, 26 Jun 2009 20:18:11 +0000 (20:18 +0000)
committerDavid Brooks <dbrooks@digium.com>
Fri, 26 Jun 2009 20:18:11 +0000 (20:18 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r203721 | dbrooks | 2009-06-26 15:13:51 -0500 (Fri, 26 Jun 2009) | 16 lines

  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/branches/1.6.1@203727 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 66e3b402f4eb7bc899975c90a9ec75e7aa1c4a8c..af11228d0f1dec2011d10c4dfc85e0432a939b14 100644 (file)
@@ -10557,8 +10557,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");
                        }
@@ -10570,8 +10571,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");
                        }