diff options
author | Mark Michelson <mmichelson@digium.com> | 2009-06-30 19:59:20 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2009-06-30 19:59:20 +0000 |
commit | 320c8d27b9ef3a40122ff18efedbc364296da567 (patch) | |
tree | 031ebea5c0e7395b1ec54bd4197c6ce5e0b651f3 /channels | |
parent | ab2b9bd16d965d94ec6faeedf7e9875d4542b5cd (diff) |
Move the masquerade in local_attended_transfer to a point where we hold the channel lock.
Masquerading without the channel's lock held is a *horrible* idea.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1226206e4..57c4d515e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -20800,11 +20800,7 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual * if (target.chan2 && !ast_strlen_zero(xfersound) && ast_streamfile(target.chan2, xfersound, target.chan2->language) >= 0) { ast_waitstream(target.chan2, ""); } - if (targetcall_pvt->owner) { - ast_debug(1, "SIP attended transfer: Unlocking channel %s\n", targetcall_pvt->owner->name); - ast_channel_unlock(targetcall_pvt->owner); - } - + /* By forcing the masquerade, we know that target.chan1 and target.chan2 are bridged. We then * can queue connected line updates where they need to go. * @@ -20814,6 +20810,12 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual * /* If the channel thread already did the masquerade, then we don't need to do anything */ ast_do_masquerade(target.chan1); } + + if (targetcall_pvt->owner) { + ast_debug(1, "SIP attended transfer: Unlocking channel %s\n", targetcall_pvt->owner->name); + ast_channel_unlock(targetcall_pvt->owner); + } + if (target.chan2) { ast_channel_queue_connected_line_update(target.chan1, &connected_to_transferee); ast_channel_queue_connected_line_update(target.chan2, &connected_to_target); |