Skip to content

Fix deadlock on 3-way closing and optimize a bit with codec sync

Wenpeng Song requested to merge backport_fix into release-6.5

backport: asterisk-chan-voicemngr@4ff66d8f

  • fix the deadlock issue on 3-way closing.
    Inside the lock pvt_lock(sub->parent),ast_channel_lock(ast) after getting the rtp_stats is waiting for another lock from channel.c(ast_indicate_data) that coming in between to be unlocked. However, the lock of (ast_indicate_data) was waiting for the pvt_lock(sub->parent).
  • remove the extra 'unlock' in the function chan_brcm_modify_codec ast_channel_bridge_peer required to be unlocked which is not easy to handle here, so using AST_LIST_TRAVERSE instead.
  • optimized a bit with the condition for return in the function chan_brcm_modify_codec the condition for the incoming call that has no bridge at the time calling this function is not needed for now, as a default codec has been set based on the negotiated result when calling the local channel.
  • Avoid future potential deadlock with the same reason around chan_brcm_modify_codec

Merge request reports