From 6a844be566478d6fed1ec93c0836fbf5d5d46ff3 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 3 Oct 2014 17:39:50 +0000 Subject: 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 --- funcs/func_frame_trace.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'funcs/func_frame_trace.c') diff --git a/funcs/func_frame_trace.c b/funcs/func_frame_trace.c index 3ad048d28..512d685f1 100644 --- a/funcs/func_frame_trace.c +++ b/funcs/func_frame_trace.c @@ -334,6 +334,10 @@ static void print_frame(struct ast_frame *frame) case AST_CONTROL_PVT_CAUSE_CODE: ast_verbose("SubClass: PVT_CAUSE_CODE\n"); break; + case AST_CONTROL_MASQUERADE_NOTIFY: + /* Should never happen. */ + ast_assert(0); + break; case AST_CONTROL_STREAM_STOP: ast_verbose("SubClass: STREAM_STOP\n"); break; -- cgit v1.2.3