Merge "chan_sip: Attempt ast_do_pickup in handle_invite_replaces" into 16

This commit is contained in:
George Joseph 2018-11-05 09:32:34 -06:00 committed by Gerrit Code Review
commit 5710cf7c94
1 changed files with 7 additions and 1 deletions

View File

@ -25903,7 +25903,13 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req,
}
ao2_ref(bridge, -1);
} else {
ast_channel_move(replaces_chan, c);
int pickedup;
ast_channel_lock(replaces_chan);
pickedup = ast_can_pickup(replaces_chan) && !ast_do_pickup(c, replaces_chan);
ast_channel_unlock(replaces_chan);
if (!pickedup) {
ast_channel_move(replaces_chan, c);
}
ast_hangup(c);
}
ast_channel_unref(c);