]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_sip: Prevent deadlock when issuing "sip show channels" 76/3276/5
authorGeorge Joseph <gjoseph@digium.com>
Thu, 21 Jul 2016 14:05:03 +0000 (08:05 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 21 Jul 2016 22:08:39 +0000 (17:08 -0500)
commit5bc48a290b5d17674f053cbd45a4a7b0a98a2b00
tree45f97f95bfe200b564bd8f6c0d0d730c160bb968
parent45e0392397605b8c8d0d975c63e21dd7b2c951de
chan_sip: Prevent deadlock when issuing "sip show channels"

sip_show_channels locks the dialogs container first then locks each
sip_pvt so it can spit out the details.  The rest of sip dialog
processing locks the sip_pvt first then locks the dialogs container
if it needs to.  Both lock in the order they need but deadlocks can
result.  To fix, sip_show_channels and sip_show_channelstats have
been converted to use an iterator rather than ao2_callback.  This way
the container is locked only while getting the next entry and is
unlocked when the callback is called.

ASTERISK-23013 #close

Change-Id: Id9980419909e811f89484950ed46ef117b9eb990
channels/chan_sip.c