mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-21 09:10:36 +00:00
Merged revisions 325339 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r325339 | dvossel | 2011-06-28 15:31:00 -0500 (Tue, 28 Jun 2011) | 4 lines Fixes locking inversion caused by holding sip pvt lock during async_goto. (closes ASTERISK-17352) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -23441,13 +23441,21 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
|
|||||||
}
|
}
|
||||||
ast_set_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER); /* Delay hangup */
|
ast_set_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER); /* Delay hangup */
|
||||||
|
|
||||||
|
{
|
||||||
|
char *refer_to_context = ast_strdupa(p->refer->refer_to_context);
|
||||||
|
char *refer_to = ast_strdupa(p->refer->refer_to);
|
||||||
|
|
||||||
/* For blind transfers, move the call to the new extensions. For attended transfers on multiple
|
/* Do not hold the pvt lock during the indicate and async_goto. Those functions
|
||||||
servers - generate an INVITE with Replaces. Either way, let the dial plan decided */
|
* lock channels which will invalidate locking order if the pvt lock is held.*/
|
||||||
/* indicate before masquerade so the indication actually makes it to the real channel
|
ao2_unlock(p);
|
||||||
when using local channels with MOH passthru */
|
/* For blind transfers, move the call to the new extensions. For attended transfers on multiple
|
||||||
ast_indicate(current.chan2, AST_CONTROL_UNHOLD);
|
* servers - generate an INVITE with Replaces. Either way, let the dial plan decided */
|
||||||
res = ast_async_goto(current.chan2, p->refer->refer_to_context, p->refer->refer_to, 1);
|
/* indicate before masquerade so the indication actually makes it to the real channel
|
||||||
|
*when using local channels with MOH passthru */
|
||||||
|
ast_indicate(current.chan2, AST_CONTROL_UNHOLD);
|
||||||
|
res = ast_async_goto(current.chan2, refer_to_context, refer_to, 1);
|
||||||
|
ao2_lock(p);
|
||||||
|
}
|
||||||
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
ast_manager_event_multichan(EVENT_FLAG_CALL, "Transfer", 2, chans,
|
ast_manager_event_multichan(EVENT_FLAG_CALL, "Transfer", 2, chans,
|
||||||
|
|||||||
Reference in New Issue
Block a user