summaryrefslogtreecommitdiff
path: root/main/framehook.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-06-11 22:21:36 +0000
committerJonathan Rose <jrose@digium.com>2013-06-11 22:21:36 +0000
commit723a84dbd98a63951bccdea6b71a0d6c1243ecbe (patch)
tree1fb35f5b6cb75f179996423224bc58020cc858b5 /main/framehook.c
parenta1f45147c97128bdbc733b5cfa44b53573cb4619 (diff)
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
Diffstat (limited to 'main/framehook.c')
-rw-r--r--main/framehook.c22
1 files changed, 22 insertions, 0 deletions
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);