[asterisk-commits] jrose: trunk r389618 - /trunk/res/parking/parking_bridge.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 23 15:48:45 CDT 2013


Author: jrose
Date: Thu May 23 15:48:41 2013
New Revision: 389618

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389618
Log:
res_parking: Fix some simple bugs

Both of them are covered in the dynamic parking review on
https://reviewboard.asterisk.org/r/2550 - Remove unref against
parking lot that the bridge did on dissolve since the reference
wasn't taken in the first place. On a swap, reapply bridge roles
in order to get music on hold and such playing on the channel that
swaps into the bridge.

Modified:
    trunk/res/parking/parking_bridge.c

Modified: trunk/res/parking/parking_bridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/parking/parking_bridge.c?view=diff&rev=389618&r1=389617&r2=389618
==============================================================================
--- trunk/res/parking/parking_bridge.c (original)
+++ trunk/res/parking/parking_bridge.c Thu May 23 15:48:41 2013
@@ -56,15 +56,7 @@
 
 static void bridge_parking_dissolving(struct ast_bridge_parking *self)
 {
-	struct parking_lot *lot = self->lot;
-
-	/* Unlink the parking bridge from the parking lot that owns it */
-	lot->parking_bridge = NULL;
-	ao2_ref(lot, -1);
-
-	/* Disassociate the bridge from the parking lot as well. */
 	self->lot = NULL;
-
 	ast_bridge_base_v_table.dissolving(&self->base);
 }
 
@@ -199,6 +191,8 @@
 	RAII_VAR(char *, comeback_override, NULL, ast_free);
 
 	ast_bridge_base_v_table.push(&self->base, bridge_channel, swap);
+
+	ast_assert(self->lot != NULL);
 
 	/* Answer the channel if needed */
 	if (ast_channel_state(bridge_channel->chan) != AST_STATE_UP) {
@@ -227,6 +221,12 @@
 
 		parking_set_duration(bridge_channel->features, pu);
 
+		/* BUGBUG Adding back local channel swapping made us not hear music on hold for the channel that got swapped
+		 * into the parking lot. Setting the roels back up gets around that, but we still need to deal with the ringing option
+		 * to the park application here somehow.
+		 */
+		parking_channel_set_roles(bridge_channel->chan, self->lot, 0);
+
 		return 0;
 	}
 




More information about the asterisk-commits mailing list