From 723a84dbd98a63951bccdea6b71a0d6c1243ecbe Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Tue, 11 Jun 2013 22:21:36 +0000 Subject: 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 --- main/framehook.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'main/framehook.c') diff --git a/main/framehook.c b/main/framehook.c index 830a4593a..f85a4c298 100644 --- a/main/framehook.c +++ b/main/framehook.c @@ -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); -- cgit v1.2.3