]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Avoid dividing by zero with L() option to Dial()
authorLeif Madsen <leif@leifmadsen.com>
Mon, 13 Jun 2011 19:51:52 +0000 (19:51 +0000)
committerLeif Madsen <leif@leifmadsen.com>
Mon, 13 Jun 2011 19:51:52 +0000 (19:51 +0000)
Reported by: nicolasom
Patches:

issue-17995.patch - nicolasom (License #5994)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323213 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 5cdc3c94528ce2c81cc9b7186dd0a7bcca41888e..2c61d86ce33c560fb1bab862181dd127c565ed33 100644 (file)
@@ -7175,7 +7175,7 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
                config->nexteventts = ast_tvadd(config->start_time, ast_samp2tv(config->timelimit, 1000));
                if ((caller_warning || callee_warning) && config->play_warning) {
                        long next_warn = config->play_warning;
-                       if (time_left_ms < config->play_warning) {
+                       if (time_left_ms < config->play_warning && config->warning_freq > 0) {
                                /* At least one warning was played, which means we are returning after feature */
                                long warns_passed = (config->play_warning - time_left_ms) / config->warning_freq;
                                /* It is 'warns_passed * warning_freq' NOT '(warns_passed + 1) * warning_freq',