]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fixing voicemail's error in checking max silence vs min message length
authorDavid Brooks <dbrooks@digium.com>
Fri, 26 Jun 2009 20:03:42 +0000 (20:03 +0000)
committerDavid Brooks <dbrooks@digium.com>
Fri, 26 Jun 2009 20:03:42 +0000 (20:03 +0000)
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.4@203719 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 9b05d2b3bfbc610b95157952c4d4d5963e6d4260..5625b01c85d1fae3aaba4669519e59baf550d879 100644 (file)
@@ -8510,7 +8510,7 @@ static int load_config(void)
                if ((s = ast_variable_retrieve(cfg, "general", "minmessage"))) {
                        if (sscanf(s, "%d", &x) == 1) {
                                vmminmessage = x;
-                               if (maxsilence <= vmminmessage)
+                               if (maxsilence / 1000 >= vmminmessage)
                                        ast_log(LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n");
                        } else {
                                ast_log(LOG_WARNING, "Invalid min message time length\n");