diff options
author | Automerge script <automerge@asterisk.org> | 2012-11-30 17:20:20 +0000 |
---|---|---|
committer | Automerge script <automerge@asterisk.org> | 2012-11-30 17:20:20 +0000 |
commit | f10729c1a2671457674cc69eedb8f77b9eb96103 (patch) | |
tree | 43c92dba566e5e48d6dda0427d2ec0c437410d3a /channels | |
parent | e044fa5fdefdf1c22ee7d4de8ccd91f84b5c7a80 (diff) |
Merged revisions 376918,376922 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk
................
r376918 | mmichelson | 2012-11-30 10:56:53 -0600 (Fri, 30 Nov 2012) | 29 lines
Fix potential crashes during SIP attended transfers.
The principal behind this patch is simple. During a transfer,
we manipulate channels that are owned by a separate thread than
the one we currently are running in, so it makes sense that we
need to grab a reference to the channels so that they cannot
disappear out from under us.
In the wild, crashes were sometimes seen when the transferring
party would hang up the call before the transfer target answered
the call. The most common place to see the crash occur was when
attempting to send a connected line update to the transferer
channel.
(closes issue ASTERISK-20226)
Reported by Jared Smith
Patches:
ASTERISK-20226.patch uploaded by Mark Michelson (License #5049)
Tested by: Jared Smith
........
Merged revisions 376901 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 376916 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 376917 from http://svn.asterisk.org/svn/asterisk/branches/11
................
r376922 | seanbright | 2012-11-30 11:08:41 -0600 (Fri, 30 Nov 2012) | 11 lines
Minor spelling fix to the VOLUME documentation.
........
Merged revisions 376919 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 376920 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 376921 from http://svn.asterisk.org/svn/asterisk/branches/11
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 30177d195..9c797d60d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -25817,8 +25817,11 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual * } /* We have a channel, find the bridge */ - target.chan1 = targetcall_pvt->owner; /* Transferer to Asterisk */ + target.chan1 = ast_channel_ref(targetcall_pvt->owner); /* Transferer to Asterisk */ target.chan2 = ast_bridged_channel(targetcall_pvt->owner); /* Asterisk to target */ + if (target.chan2) { + ast_channel_ref(target.chan2); + } if (!target.chan2 || !(ast_channel_state(target.chan2) == AST_STATE_UP || ast_channel_state(target.chan2) == AST_STATE_RINGING) ) { /* Wrong state of new channel */ @@ -25960,6 +25963,10 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual * /* at this point if the transfer is successful only the transferer pvt should be locked. */ ast_party_connected_line_free(&connected_to_target); ast_party_connected_line_free(&connected_to_transferee); + ast_channel_unref(target.chan1); + if (target.chan2) { + ast_channel_unref(target.chan2); + } if (targetcall_pvt) ao2_t_ref(targetcall_pvt, -1, "drop targetcall_pvt"); return 1; |