[asterisk-commits] jrose: branch jrose/bridge_projects r385515 - /team/jrose/bridge_projects/res...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 12 12:33:41 CDT 2013


Author: jrose
Date: Fri Apr 12 12:33:38 2013
New Revision: 385515

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385515
Log:
bridging register and dissolving

Modified:
    team/jrose/bridge_projects/res/parking/parking_bridge.c

Modified: team/jrose/bridge_projects/res/parking/parking_bridge.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/parking/parking_bridge.c?view=diff&rev=385515&r1=385514&r2=385515
==============================================================================
--- team/jrose/bridge_projects/res/parking/parking_bridge.c (original)
+++ team/jrose/bridge_projects/res/parking/parking_bridge.c Fri Apr 12 12:33:38 2013
@@ -51,6 +51,20 @@
 static void bridge_parking_destroy(struct ast_bridge_parking *self)
 {
 	ast_bridge_base_v_table.destroy(&self->base);
+}
+
+static void bridge_parking_dissolving(struct ast_bridge_parking *self)
+{
+	struct parking_lot_state *lot_state = self->lot;
+
+	ast_bridge_base_v_table.dissolving(&self->base);
+
+	/* Unlink the parking bridge from the parking lot state that owns it */
+	lot_state->parking_bridge = NULL;
+	ao2_ref(lot_state, -1);
+
+	/* Disassociate the bridge from the parking lot as well. */
+	self->lot = NULL;
 }
 
 /*!
@@ -229,6 +243,7 @@
 struct ast_bridge_methods ast_bridge_parking_v_table = {
 	.name = "parking",
 	.destroy = (ast_bridge_destructor_fn) bridge_parking_destroy,
+	.dissolving = (ast_bridge_dissolving_fn) bridge_parking_dissolving,
 	.can_push = (ast_bridge_can_push_channel_fn) bridge_parking_can_push,
 	.push = (ast_bridge_push_channel_fn) bridge_parking_push,
 	.pull = (ast_bridge_pull_channel_fn) bridge_parking_pull,
@@ -260,11 +275,12 @@
 	bridge = ast_bridge_alloc(sizeof(struct ast_bridge_parking), &ast_bridge_parking_v_table);
 
 	bridge = ast_bridge_base_init(bridge, AST_BRIDGE_CAPABILITY_HOLDING, AST_BRIDGE_FLAG_MERGE_INHIBIT_TO | AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM);
+	bridge = ast_bridge_parking_init(bridge, bridge_lot);
 	if (!bridge) {
 		return NULL;
 	}
 
-	bridge = ast_bridge_parking_init(bridge, bridge_lot);
+	ast_bridge_register(bridge);
 
 	return bridge;
 }




More information about the asterisk-commits mailing list