From 0c03eab9626a3262d6b4f122ceaca29e7d390bbc Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Thu, 5 Apr 2018 18:33:40 -0500 Subject: res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge There is a problem when an INVITE-with-Replaces transfer targets a channel in a ConfBridge. The transfer will unconditionally swap out the ConfBridge channel. Unfortunately, the ConfBridge state will not be aware of this change. Unexpected behavior will happen as a result since ConfBridge channels currently can only be replaced by a masquerade and not normal bridge channel moves. * We just need to pretend that the channel isn't in a bridge (like other transfer methods already do) so the transfer channel will masquerade into the ConfBridge channel. Change-Id: I209beb0e748fa4f4b92a576f36afa8f495ba4c82 --- channels/chan_sip.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'channels/chan_sip.c') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 138021e82..3891dada6 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -25886,10 +25886,7 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, ast_raw_answer(c); - ast_channel_lock(replaces_chan); - bridge = ast_channel_get_bridge(replaces_chan); - ast_channel_unlock(replaces_chan); - + bridge = ast_bridge_transfer_acquire_bridge(replaces_chan); if (bridge) { if (ast_bridge_impart(bridge, c, replaces_chan, NULL, AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) { -- cgit v1.2.3