Fix potential deadlock between masquerade and chan_local.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 4 Jun 2012 19:46:33 +0000 (19:46 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 4 Jun 2012 19:46:33 +0000 (19:46 +0000)
commitc1bbe79748bb1615ab116fe287b8d5d28a83b330
tree1e3667142b9bfbf9d3b636b52410e497a4f5b2b5
parent380c7c5c39b9a0879d90df99196c06d01a70dd92
Fix potential deadlock between masquerade and chan_local.

* Restructure ast_do_masquerade() to not hold channel locks while it calls
ast_indicate().

* Simplify many calls to ast_do_masquerade() since it will never return a
failure now.  If it does fail internally because a channel driver callback
operation failed, the only thing ast_do_masquerade() can do is generate a
warning message about strange things may happen and press on.

* Fixed the call to ast_bridged_channel() in ast_do_masquerade().  This
change fixes half of the deadlock reported in ASTERISK-19801 between
masquerades and chan_iax.

(closes issue ASTERISK-19537)
Reported by: rmudgett
Tested by: rmudgett

Review: https://reviewboard.asterisk.org/r/1915/
........

Merged revisions 368405 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 368407 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/channel.c