summaryrefslogtreecommitdiff
path: root/res/parking
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-05-23 20:48:41 +0000
committerJonathan Rose <jrose@digium.com>2013-05-23 20:48:41 +0000
commitdd6923d0a96645d52d9c944d38d001e71eeb94d6 (patch)
tree12b353a4e52c646e70f982a39824f774fd661f93 /res/parking
parent814fa7fe114cdab78d8e8a163ea5658b97d97caf (diff)
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/parking')
-rw-r--r--res/parking/parking_bridge.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/res/parking/parking_bridge.c b/res/parking/parking_bridge.c
index b9ceb5203..56c5839bc 100644
--- a/res/parking/parking_bridge.c
+++ b/res/parking/parking_bridge.c
@@ -56,15 +56,7 @@ static void bridge_parking_destroy(struct ast_bridge_parking *self)
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);
}
@@ -200,6 +192,8 @@ static int bridge_parking_push(struct ast_bridge_parking *self, struct ast_bridg
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) {
ast_answer(bridge_channel->chan);
@@ -227,6 +221,12 @@ static int bridge_parking_push(struct ast_bridge_parking *self, struct ast_bridg
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;
}