[asterisk-commits] rmudgett: branch rmudgett/bridge_phase r381519 - /team/rmudgett/bridge_phase/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 14 17:42:02 CST 2013


Author: rmudgett
Date: Thu Feb 14 17:41:58 2013
New Revision: 381519

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381519
Log:
Move some code around.

Remove three BUGBUG notes and create a new one.  Progress!

Modified:
    team/rmudgett/bridge_phase/main/bridging.c
    team/rmudgett/bridge_phase/main/features.c
    team/rmudgett/bridge_phase/main/manager.c

Modified: team/rmudgett/bridge_phase/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/bridging.c?view=diff&rev=381519&r1=381518&r2=381519
==============================================================================
--- team/rmudgett/bridge_phase/main/bridging.c (original)
+++ team/rmudgett/bridge_phase/main/bridging.c Thu Feb 14 17:41:58 2013
@@ -53,6 +53,7 @@
 #include "asterisk/timing.h"
 #include "asterisk/stringfields.h"
 #include "asterisk/musiconhold.h"
+#include "asterisk/features.h"
 
 static AST_RWLIST_HEAD_STATIC(bridge_technologies, ast_bridge_technology);
 
@@ -1432,8 +1433,6 @@
 		ao2_unlock(bridge_channel);
 	}
 
-	ast_channel_internal_bridge_set(bridge_channel->chan, NULL);
-
 	/* See if we need to dissolve the bridge itself if they hung up */
 	switch (bridge_channel->state) {
 	case AST_BRIDGE_CHANNEL_STATE_END:
@@ -1483,6 +1482,25 @@
 		ast_frfree(action);
 	}
 	ao2_unlock(bridge_channel);
+
+/* BUGBUG Revisit in regards to moving channels between bridges and local channel optimization. */
+	/* Complete any partial DTMF digit before exiting the bridge. */
+	if (ast_channel_sending_dtmf_digit(bridge_channel->chan)) {
+		ast_bridge_end_dtmf(bridge_channel->chan,
+			ast_channel_sending_dtmf_digit(bridge_channel->chan),
+			ast_channel_sending_dtmf_tv(bridge_channel->chan), "bridge end");
+	}
+
+	/*
+	 * Wait for any dual redirect to complete.
+	 *
+	 * Must be done while "still in the bridge" for ast_async_goto()
+	 * to work right.
+	 */
+	while (ast_test_flag(ast_channel_flags(bridge_channel->chan), AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT)) {
+		sched_yield();
+	}
+	ast_channel_internal_bridge_set(bridge_channel->chan, NULL);
 
 	/* Restore original formats of the channel as they came in */
 	if (ast_format_cmp(ast_channel_readformat(bridge_channel->chan), &formats[0]) == AST_FORMAT_CMP_NOT_EQUAL) {

Modified: team/rmudgett/bridge_phase/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/features.c?view=diff&rev=381519&r1=381518&r2=381519
==============================================================================
--- team/rmudgett/bridge_phase/main/features.c (original)
+++ team/rmudgett/bridge_phase/main/features.c Thu Feb 14 17:41:58 2013
@@ -4569,22 +4569,6 @@
 
 	ast_bridge_features_cleanup(&chan_features);
 
-/* BUGBUG move this to bridge_channel_join before dissolve the bridge check. */
-	if (ast_channel_sending_dtmf_digit(chan)) {
-		ast_bridge_end_dtmf(chan, ast_channel_sending_dtmf_digit(chan),
-			ast_channel_sending_dtmf_tv(chan), "bridge end");
-	}
-	if (ast_channel_sending_dtmf_digit(peer)) {
-		ast_bridge_end_dtmf(peer, ast_channel_sending_dtmf_digit(peer),
-			ast_channel_sending_dtmf_tv(peer), "bridge end");
-	}
-
-/* BUGBUG move this to bridge_channel_join before dissolve the bridge check. */
-	/* Wait for any dual redirect to complete. */
-	while (ast_test_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT)) {
-		sched_yield();
-	}
-
 /* BUGBUG this is used by Dial and FollowMe for CDR information.  By Queue for Queue stats like CDRs. */
 	if (res && config->end_bridge_callback) {
 		config->end_bridge_callback(config->end_bridge_callback_data);

Modified: team/rmudgett/bridge_phase/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/manager.c?view=diff&rev=381519&r1=381518&r2=381519
==============================================================================
--- team/rmudgett/bridge_phase/main/manager.c (original)
+++ team/rmudgett/bridge_phase/main/manager.c Thu Feb 14 17:41:58 2013
@@ -3806,7 +3806,6 @@
 		return 0;
 	}
 
-/* BUGBUG The use of AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT will need to be reexamined. */
 	/* Dual channel redirect in progress. */
 	if (ast_channel_pbx(chan)) {
 		ast_channel_lock(chan);




More information about the asterisk-commits mailing list