From 9a46c1d0199e5e3627665b68f88d4ec21f09d2a9 Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Fri, 26 Jul 2013 16:34:56 +0000 Subject: Add name argument to BridgeWait() so multiple holding bridges may be used Changes arguments for BridgeWait from BridgeWait(role, options) to BridgeWait(bridge_name, role, options). Now multiple holding bridges may be created and referenced by this application. (closes issue ASTERISK-21922) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2642/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395509 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/bridge.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'main/bridge.c') diff --git a/main/bridge.c b/main/bridge.c index bb90de7e4..6a6744490 100644 --- a/main/bridge.c +++ b/main/bridge.c @@ -1420,7 +1420,7 @@ void ast_bridge_notify_masquerade(struct ast_channel *chan) * Need to update the features parameter doxygen when this * change is made to be like ast_bridge_impart(). */ -enum bridge_channel_state ast_bridge_join(struct ast_bridge *bridge, +int ast_bridge_join(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, @@ -1428,21 +1428,21 @@ enum bridge_channel_state ast_bridge_join(struct ast_bridge *bridge, int pass_reference) { struct ast_bridge_channel *bridge_channel; - enum bridge_channel_state state; + int res; bridge_channel = bridge_channel_internal_alloc(bridge); if (pass_reference) { ao2_ref(bridge, -1); } if (!bridge_channel) { - state = BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE; + res = -1; goto join_exit; } /* BUGBUG features cannot be NULL when passed in. When it is changed to allocated we can do like ast_bridge_impart() and allocate one. */ ast_assert(features != NULL); if (!features) { ao2_ref(bridge_channel, -1); - state = BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE; + res = -1; goto join_exit; } if (tech_args) { @@ -1458,8 +1458,7 @@ enum bridge_channel_state ast_bridge_join(struct ast_bridge *bridge, bridge_channel->swap = swap; bridge_channel->features = features; - bridge_channel_internal_join(bridge_channel); - state = bridge_channel->state; + res = bridge_channel_internal_join(bridge_channel); /* Cleanup all the data in the bridge channel after it leaves the bridge. */ ast_channel_lock(chan); @@ -1481,7 +1480,7 @@ join_exit:; ast_softhangup_nolock(chan, AST_SOFTHANGUP_ASYNCGOTO); ast_channel_unlock(chan); } - return state; + return res; } /*! \brief Thread responsible for imparted bridged channels to be departed */ -- cgit v1.2.3