[asterisk-commits] kmoore: branch 11 r423010 - in /branches/11: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 12 13:18:48 CDT 2014


Author: kmoore
Date: Fri Sep 12 13:18:44 2014
New Revision: 423010

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=423010
Log:
Bridging: Fix bouncing native bridge

This fixes a situation in Asterisk 1.8 and 11 where ast_channel_bridge
could cause a bouncing native bridge. In the case of the
dial_LS_options test, this was a remote RTP bridge which caused the
audio path to continually cycle between Asterisk and the remote
endpoints generating a large number of SIP messages and delaying the
test long enough to cause it to fail (checking timing was part of the
test). The root cause was that the code to decide whether to use native
bridging was expecting a time-remaining value of 0 to be the default
instead of the actual default value of -1. A value of 0 or negative
numbers could also be generated by preceding code in some
circumstances. Both issues are addressed in this patch.

ASTERISK-24211 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3987/
........

Merged revisions 423006 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/main/channel.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/11/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/channel.c?view=diff&rev=423010&r1=423009&r2=423010
==============================================================================
--- branches/11/main/channel.c (original)
+++ branches/11/main/channel.c Fri Sep 12 13:18:44 2014
@@ -7963,8 +7963,13 @@
 
 		if (config->timelimit) {
 			time_left_ms = config->timelimit - ast_tvdiff_ms(now, config->start_time);
-			if (time_left_ms < to)
+			if (time_left_ms < 0) {
+				time_left_ms = 0;
+			}
+
+			if (time_left_ms < to) {
 				to = time_left_ms;
+			}
 
 			if (time_left_ms <= 0) {
 				if (caller_warning && config->end_sound)
@@ -7972,7 +7977,7 @@
 				if (callee_warning && config->end_sound)
 					bridge_playfile(c1, c0, config->end_sound, 0);
 				*fo = NULL;
-				res = 0;
+				res = AST_BRIDGE_COMPLETE;
 				ast_test_suite_event_notify("BRIDGE_TIMELIMIT", "Channel1: %s\r\nChannel2: %s", ast_channel_name(c0), ast_channel_name(c1));
 				break;
 			}
@@ -8015,7 +8020,7 @@
 		if (ast_test_flag(ast_channel_flags(c0), AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c0) ||
 		    ast_test_flag(ast_channel_flags(c1), AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c1)) {
 			*fo = NULL;
-			res = 0;
+			res = AST_BRIDGE_COMPLETE;
 			ast_debug(1, "Bridge stops because we're zombie or need a soft hangup: c0=%s, c1=%s, flags: %s,%s,%s,%s\n",
 				ast_channel_name(c0), ast_channel_name(c1),
 				ast_test_flag(ast_channel_flags(c0), AST_FLAG_ZOMBIE) ? "Yes" : "No",
@@ -8031,7 +8036,7 @@
 
 		if (ast_channel_tech(c0)->bridge &&
 			/* if < 1 ms remains use generic bridging for accurate timing */
-			(!config->timelimit || to > 1000 || to == 0) &&
+			(!config->timelimit || to > 1000 || to == -1) &&
 		    (ast_channel_tech(c0)->bridge == ast_channel_tech(c1)->bridge) &&
 		    !ast_channel_monitor(c0) && !ast_channel_monitor(c1) &&
 		    !ast_channel_audiohooks(c0) && !ast_channel_audiohooks(c1) &&




More information about the asterisk-commits mailing list