Merge "res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge"
authorJenkins2 <jenkins2@gerrit.asterisk.org>
Wed, 11 Apr 2018 12:11:16 +0000 (07:11 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Wed, 11 Apr 2018 12:11:16 +0000 (07:11 -0500)
1  2 
channels/chan_sip.c
include/asterisk/bridge.h
main/bridge.c

@@@ -25887,17 -25886,8 +25887,14 @@@ static int handle_invite_replaces(struc
  
        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) {
 +              /*
 +               * We have two refs of the channel.  One is held in c and the other
 +               * is notionally represented by p->owner.  The impart is "stealing"
 +               * the p->owner ref on success so the bridging system can have
 +               * control of when the channel is hung up.
 +               */
                if (ast_bridge_impart(bridge, c, replaces_chan, NULL,
                        AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) {
                        ast_hangup(c);
Simple merge
diff --cc main/bridge.c
Simple merge