]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merge "res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge...
authorJenkins2 <jenkins2@gerrit.asterisk.org>
Wed, 11 Apr 2018 12:03:19 +0000 (07:03 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Wed, 11 Apr 2018 12:03:19 +0000 (07:03 -0500)
1  2 
channels/chan_sip.c

index 702d66657235950aade29c13471fc3581217db19,b096c33a3ddd35be208405ac090654a2955a3181..4e65c7b89a9e644e35bd5f93c582cbea88b3d945
@@@ -25671,17 -25670,8 +25671,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);