[asterisk-commits] rmudgett: trunk r394791 - /trunk/main/bridging.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 19 12:55:52 CDT 2013
Author: rmudgett
Date: Fri Jul 19 12:55:49 2013
New Revision: 394791
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394791
Log:
Made audiohooks, framehooks, and monitor prevent local channel optimization.
Audiohooks, framehooks, and monitor represent state on a local channel
that will go away if it is optimized out.
(closes issue ASTERISK-21954)
Reported by: rmudgett
Review: https://reviewboard.asterisk.org/r/2685/
Modified:
trunk/main/bridging.c
Modified: trunk/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/bridging.c?view=diff&rev=394791&r1=394790&r2=394791
==============================================================================
--- trunk/main/bridging.c (original)
+++ trunk/main/bridging.c Fri Jul 19 12:55:49 2013
@@ -63,6 +63,7 @@
#include "asterisk/core_local.h"
#include "asterisk/core_unreal.h"
#include "asterisk/features_config.h"
+#include "asterisk/audiohook.h"
/*! All bridges container. */
static struct ao2_container *bridges;
@@ -4721,6 +4722,13 @@
if (!AST_LIST_EMPTY(ast_channel_readq(chan))) {
return NULL;
}
+ if (ast_channel_monitor(chan)
+ || (ast_channel_audiohooks(chan)
+ && !ast_audiohook_write_list_empty(ast_channel_audiohooks(chan)))
+ || !ast_framehook_list_contains_no_active(ast_channel_framehooks(chan))) {
+ /* Channel has an active monitor, audiohook, or framehook. */
+ return NULL;
+ }
bridge_channel = ast_channel_internal_bridge_channel(chan);
if (!bridge_channel || ast_bridge_channel_trylock(bridge_channel)) {
return NULL;
@@ -4760,6 +4768,14 @@
return NULL;
}
if (!AST_LIST_EMPTY(ast_channel_readq(peer))) {
+ ast_channel_unlock(peer);
+ return NULL;
+ }
+ if (ast_channel_monitor(peer)
+ || (ast_channel_audiohooks(peer)
+ && !ast_audiohook_write_list_empty(ast_channel_audiohooks(peer)))
+ || !ast_framehook_list_contains_no_active(ast_channel_framehooks(peer))) {
+ /* Peer has an active monitor, audiohook, or framehook. */
ast_channel_unlock(peer);
return NULL;
}
More information about the asterisk-commits
mailing list