]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Properly set caller_warning and callee_warning before we try to use them.
authorMatthew Nicholson <mnicholson@digium.com>
Mon, 12 Sep 2011 15:54:41 +0000 (15:54 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Mon, 12 Sep 2011 15:54:41 +0000 (15:54 +0000)
ASTERISK-18199
Patch by: elguero
Testing by: rtang

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

main/channel.c

index 439887949c77b306f55601ad8dbe8c0c08a89f3f..1f9128fe387b4cbe25ec585f96d1d40b0b735643 100644 (file)
@@ -7216,6 +7216,9 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
            ast_test_flag(c1, AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c1))
                return -1;
 
+       caller_warning = ast_test_flag(&config->features_caller, AST_FEATURE_PLAY_WARNING);
+       callee_warning = ast_test_flag(&config->features_callee, AST_FEATURE_PLAY_WARNING);
+
        if (ast_tvzero(config->start_time)) {
                config->start_time = ast_tvnow();
                if (config->start_sound) {
@@ -7241,8 +7244,6 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
                config->nexteventts = ast_tvadd(config->feature_start_time, ast_samp2tv(config->feature_timer, 1000));
        } else if (config->timelimit) {
                time_left_ms = config->timelimit - ast_tvdiff_ms(ast_tvnow(), config->start_time);
-               caller_warning = ast_test_flag(&config->features_caller, AST_FEATURE_PLAY_WARNING);
-               callee_warning = ast_test_flag(&config->features_callee, AST_FEATURE_PLAY_WARNING);
                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;