[asterisk-commits] file: branch file/bridging r92619 - /team/file/bridging/main/bridging.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 12 15:26:21 CST 2007


Author: file
Date: Wed Dec 12 15:26:21 2007
New Revision: 92619

URL: http://svn.digium.com/view/asterisk?view=rev&rev=92619
Log:
Finish up the hangup feature and make it the responsibility of the feature callback to unlock/lock the bridge.

Modified:
    team/file/bridging/main/bridging.c

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=92619&r1=92618&r2=92619
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Wed Dec 12 15:26:21 2007
@@ -699,10 +699,8 @@
 	bridge_channel->dtmfq[0] = '\0';
 	bridge_channel->go_feature = 0;
 
-	/* Now the logic is simple, release the bridge lock and actually execute the feature callback */
-	ast_mutex_unlock(&bridge->lock);
+	/* Execute the function callback, it is up to that callback to release the bridge lock when doing things */
 	callback(bridge, bridge_channel);
-	ast_mutex_lock(&bridge->lock);
 
 	return;
 }
@@ -1216,12 +1214,16 @@
 /*! \brief Internal built in feature for blind transfers */
 static int feature_blind_transfer(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
 {
+	ast_mutex_unlock(&bridge->lock);
+	ast_mutex_lock(&bridge->lock);
 	return 0;
 }
 
 /*! \brief Internal built in feature for attended transfers */
 static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
 {
+	ast_mutex_unlock(&bridge->lock);
+	ast_mutex_lock(&bridge->lock);
 	return 0;
 }
 
@@ -1230,6 +1232,8 @@
 {
 	/* This is very simple, we basically change the state on the bridge channel to end and the core takes care of the rest */
 	bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_END;
+	/* See if the bridge needs to dissolve away */
+	bridge_check_dissolve(bridge);
 	return 0;
 }
 




More information about the asterisk-commits mailing list