mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
chan_pjsip: Fix deadlock when masquerading PJSIP channels.
Performing a directed call pickup resulted in a deadlock when PJSIP channels were involved. A masquerade needs to hold onto the channel locks while it swaps channel information between the two channels involved in the masquerade. With PJSIP channels, the fixup routine needed to push a fixup task onto the PJSIP channel's serializer. Unfortunately, if the serializer was also processing a task that needed to lock the channel, you get deadlock. * Added a new control frame that is used to notify the channels that a masquerade is about to start and when it has completed. * Added the ability to query taskprocessors if the current thread is the taskprocessor thread. * Added the ability to suspend/unsuspend the PJSIP serializer thread so a masquerade could fixup the PJSIP channel without using the serializer. ASTERISK-24356 #close Reported by: rmudgett Review: https://reviewboard.asterisk.org/r/4034/ ........ Merged revisions 424471 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -530,6 +530,12 @@ int ast_unreal_indicate(struct ast_channel *ast, int condition, const void *data
|
||||
ao2_ref(p, 1); /* ref for unreal_queue_frame */
|
||||
|
||||
switch (condition) {
|
||||
case AST_CONTROL_MASQUERADE_NOTIFY:
|
||||
/*
|
||||
* Always block this because this is the channel being
|
||||
* masqueraded; not anything down the chain.
|
||||
*/
|
||||
break;
|
||||
case AST_CONTROL_CONNECTED_LINE:
|
||||
case AST_CONTROL_REDIRECTING:
|
||||
res = unreal_colp_redirect_indicate(p, ast, condition);
|
||||
|
Reference in New Issue
Block a user