[asterisk-dev] [Code Review] 4034: chan_pjsip: Fix deadlock when masquerading PJSIP channels.

rmudgett reviewboard at asterisk.org
Mon Sep 29 17:29:11 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4034/
-----------------------------------------------------------

Review request for Asterisk Developers.


Bugs: ASTERISK-24356
    https://issues.asterisk.org/jira/browse/ASTERISK-24356


Repository: Asterisk


Description
-------

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 supported 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.


Diffs
-----

  /branches/13/res/res_pjsip_session.exports.in 424126 
  /branches/13/res/res_pjsip_session.c 424126 
  /branches/13/main/threadpool.c 424126 
  /branches/13/main/taskprocessor.c 424126 
  /branches/13/main/core_unreal.c 424126 
  /branches/13/main/channel.c 424126 
  /branches/13/main/bridge_channel.c 424126 
  /branches/13/include/asterisk/taskprocessor.h 424126 
  /branches/13/include/asterisk/res_pjsip_session.h 424126 
  /branches/13/include/asterisk/frame.h 424126 
  /branches/13/funcs/func_frame_trace.c 424126 
  /branches/13/channels/chan_unistim.c 424126 
  /branches/13/channels/chan_skinny.c 424126 
  /branches/13/channels/chan_sip.c 424126 
  /branches/13/channels/chan_pjsip.c 424126 
  /branches/13/channels/chan_motif.c 424126 
  /branches/13/channels/chan_misdn.c 424126 
  /branches/13/channels/chan_iax2.c 424126 
  /branches/13/addons/chan_ooh323.c 424126 

Diff: https://reviewboard.asterisk.org/r/4034/diff/


Testing
-------

* Performed several directed call pickups without deadlocking.  Before the patch, the system would usually deadlock.

* Performed a SIP attended transfer to an appliction.  The transfer still works.


Thanks,

rmudgett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140929/8a2463fc/attachment.html>


More information about the asterisk-dev mailing list