Avoid deadlock during R4 call transfer
There was a situation that during attended call transfer deadlock happened on the channel. Usually brcm_indicate() which is run in locked channel finished before bridge_channel_queue_deferred_frames() was called and acquired lock on the same channel. Sometimes brcm_indicate() takes more time or bridge_channel_queue_deferred_frames() is called quicker and deadlock happened. For some reason even if brcm_indicate() finished we did not proceed further with the call transfer.
Applying deadlock avoidance, i.e. try to lock bridge_channel and channel at the same time in bridge_channel_queue_deferred_frames() fixes the issue.
Edited by Yalu Zhang