[asterisk-commits] file: branch file/bridge_native r388161 - in /team/file/bridge_native: apps/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 9 05:28:26 CDT 2013


Author: file
Date: Thu May  9 05:28:22 2013
New Revision: 388161

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388161
Log:
Incorporate review feedback.

Modified:
    team/file/bridge_native/apps/app_chanspy.c
    team/file/bridge_native/apps/app_mixmonitor.c
    team/file/bridge_native/bridges/bridge_native_rtp.c
    team/file/bridge_native/channels/chan_sip.c
    team/file/bridge_native/main/bridging.c

Modified: team/file/bridge_native/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_native/apps/app_chanspy.c?view=diff&rev=388161&r1=388160&r2=388161
==============================================================================
--- team/file/bridge_native/apps/app_chanspy.c (original)
+++ team/file/bridge_native/apps/app_chanspy.c Thu May  9 05:28:22 2013
@@ -489,9 +489,11 @@
 	res = ast_audiohook_attach(autochan->chan, audiohook);
 
 	if (!res) {
-		if (ast_channel_internal_bridge(autochan->chan)) {
-			ast_softhangup(autochan->chan, AST_SOFTHANGUP_UNBRIDGE);
-		}
+		ast_channel_lock(autochan->chan);
+		if (ast_channel_is_bridged(autochan->chan)) {
+			ast_softhangup_nolock(autochan->chan, AST_SOFTHANGUP_UNBRIDGE);
+		}
+		ast_channel_unlock(autochan->chan);
 	}
 	return res;
 }

Modified: team/file/bridge_native/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_native/apps/app_mixmonitor.c?view=diff&rev=388161&r1=388160&r2=388161
==============================================================================
--- team/file/bridge_native/apps/app_mixmonitor.c (original)
+++ team/file/bridge_native/apps/app_mixmonitor.c Thu May  9 05:28:22 2013
@@ -419,9 +419,11 @@
 	ast_audiohook_attach(chan, audiohook);
 
 	if (!res) {
-		if (ast_channel_internal_bridge(chan)) {
-			ast_softhangup(chan, AST_SOFTHANGUP_UNBRIDGE);
-		}
+		ast_channel_lock(chan);
+		if (ast_channel_is_bridged(chan)) {
+			ast_softhangup_nolock(chan, AST_SOFTHANGUP_UNBRIDGE);
+		}
+		ast_channel_unlock(chan);
 	}
 
 	return res;

Modified: team/file/bridge_native/bridges/bridge_native_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_native/bridges/bridge_native_rtp.c?view=diff&rev=388161&r1=388160&r2=388161
==============================================================================
--- team/file/bridge_native/bridges/bridge_native_rtp.c (original)
+++ team/file/bridge_native/bridges/bridge_native_rtp.c Thu May  9 05:28:22 2013
@@ -153,7 +153,7 @@
 	int read_ptime0, read_ptime1, write_ptime0, write_ptime1;
 
 	/* We require two channels before even considering native bridging */
-	if (c0 == c1) {
+	if (bridge->num_channels != 2) {
 		ast_debug(1, "Bridge '%s' can not use native RTP bridge as two channels are required\n",
 			bridge->uniqueid);
 		return 0;

Modified: team/file/bridge_native/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_native/channels/chan_sip.c?view=diff&rev=388161&r1=388160&r2=388161
==============================================================================
--- team/file/bridge_native/channels/chan_sip.c (original)
+++ team/file/bridge_native/channels/chan_sip.c Thu May  9 05:28:22 2013
@@ -32923,7 +32923,7 @@
 
 	/* Disable early RTP bridge  */
 	if ((instance || vinstance || tinstance) &&
-		!ast_channel_internal_bridge(chan) &&
+		!ast_channel_is_bridged(chan) &&
 		!sip_cfg.directrtpsetup) {
 		sip_pvt_unlock(p);
 		ast_channel_unlock(chan);

Modified: team/file/bridge_native/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_native/main/bridging.c?view=diff&rev=388161&r1=388160&r2=388161
==============================================================================
--- team/file/bridge_native/main/bridging.c (original)
+++ team/file/bridge_native/main/bridging.c Thu May  9 05:28:22 2013
@@ -903,8 +903,6 @@
 		bridge_channel, custom_play, playfile, moh_class);
 }
 
-static void bridge_reconfigured(struct ast_bridge *bridge);
-
 /*!
  * \internal
  * \brief Feed notification that a frame is waiting on a channel into the bridging core
@@ -927,13 +925,6 @@
 	}
 	switch (frame->frametype) {
 	case AST_FRAME_NULL:
-		if (ast_channel_softhangup_internal_flag(bridge_channel->chan) & AST_SOFTHANGUP_UNBRIDGE) {
-			ast_channel_clear_softhangup(bridge_channel->chan, AST_SOFTHANGUP_UNBRIDGE);
-			ast_bridge_channel_lock_bridge(bridge_channel);
-			bridge_channel->bridge->reconfigured = 1;
-			bridge_reconfigured(bridge_channel->bridge);
-			ast_bridge_unlock(bridge_channel->bridge);
-		}
 		/* Just discard it. */
 		ast_frfree(frame);
 		return;
@@ -1036,7 +1027,7 @@
 				current->name);
 			continue;
 		}
-		if (!(current->capabilities & capabilities)) {
+		if ((current->capabilities & capabilities) != capabilities) {
 			ast_debug(1, "Bridge technology %s does not have the capabilities we need.\n",
 				current->name);
 			continue;
@@ -2251,6 +2242,13 @@
 		chan = ast_waitfor_nandfds(&bridge_channel->chan, 1,
 			&bridge_channel->alert_pipe[0], 1, NULL, &outfd, &ms);
 		bridge_channel->waiting = 0;
+		if (ast_channel_softhangup_internal_flag(bridge_channel->chan) & AST_SOFTHANGUP_UNBRIDGE) {
+			ast_channel_clear_softhangup(bridge_channel->chan, AST_SOFTHANGUP_UNBRIDGE);
+			ast_bridge_channel_lock_bridge(bridge_channel);
+			bridge_channel->bridge->reconfigured = 1;
+			bridge_reconfigured(bridge_channel->bridge);
+			ast_bridge_unlock(bridge_channel->bridge);
+		}
 		ast_bridge_channel_lock(bridge_channel);
 		bridge_channel->activity = AST_BRIDGE_CHANNEL_THREAD_FRAME;
 		ast_bridge_channel_unlock(bridge_channel);




More information about the asterisk-commits mailing list