bridge_native_rtp: Fix native bridge tech being incompatible when it should be.

When checking compatability for the native RTP bridge technology there is a
race condition between clearing framehooks that are destroyed when leaving
certain bridges with certain technologies (such as bridge_native_rtp) and
joining bridges with the bridge_native_rtp technology. Yes, that means a
channel in a native RTP bridge could move to another native RTP bridge and
be considered incompatible with the new native RTP bridge causing it to
revert to a simple bridge technology0. This fixes that bug by ignoring
framehooks that have been marked for destruction when checking for
compatibility with the bridge_native_rtp technology.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2013-06-11 22:21:36 +00:00
parent a1f45147c9
commit 723a84dbd9
3 changed files with 44 additions and 7 deletions

View File

@@ -181,6 +181,28 @@ int ast_framehook_list_is_empty(struct ast_framehook_list *framehooks)
return AST_LIST_EMPTY(&framehooks->list) ? 1 : 0;
}
int ast_framehook_list_contains_no_active(struct ast_framehook_list *framehooks)
{
struct ast_framehook *cur;
if (!framehooks) {
return 1;
}
if (AST_LIST_EMPTY(&framehooks->list)) {
return 1;
}
AST_LIST_TRAVERSE(&framehooks->list, cur, list) {
if (cur->detach_and_destroy_me) {
continue;
}
return 0;
}
return 1;
}
struct ast_frame *ast_framehook_list_write_event(struct ast_framehook_list *framehooks, struct ast_frame *frame)
{
return framehook_list_push_event(framehooks, frame, AST_FRAMEHOOK_EVENT_WRITE);