[asterisk-commits] file: branch file/bridge_native r385962 - /team/file/bridge_native/bridges/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Apr 17 06:53:22 CDT 2013
Author: file
Date: Wed Apr 17 06:53:19 2013
New Revision: 385962
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385962
Log:
Add some additional checks for stuff that would prevent native RTP bridging.
Modified:
team/file/bridge_native/bridges/bridge_native_rtp.c
Modified: team/file/bridge_native/bridges/bridge_native_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_native/bridges/bridge_native_rtp.c?view=diff&rev=385962&r1=385961&r2=385962
==============================================================================
--- team/file/bridge_native/bridges/bridge_native_rtp.c (original)
+++ team/file/bridge_native/bridges/bridge_native_rtp.c Wed Apr 17 06:53:19 2013
@@ -45,6 +45,16 @@
#include "asterisk/bridging_technology.h"
#include "asterisk/frame.h"
#include "asterisk/rtp_engine.h"
+
+/*! \brief Internal helper function which checks whether the channels are compatible with our native bridging */
+static int native_rtp_bridge_capable(struct ast_channel *chan)
+{
+ if (ast_channel_monitor(chan) || ast_channel_audiohooks(chan) || !ast_framehook_list_is_empty(ast_channel_framehooks(chan))) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
/*! \brief Internal helper function which gets aspects of the channels */
static enum ast_rtp_glue_result native_rtp_bridge_get(struct ast_channel *c0, struct ast_channel *c1, struct ast_rtp_glue **glue0,
@@ -114,6 +124,18 @@
if (c0 == c1) {
ast_debug(1, "Bridge '%s' can not use native RTP bridge as two channels are required\n",
bridge->uniqueid);
+ return 0;
+ }
+
+ if (!native_rtp_bridge_capable(c0->chan)) {
+ ast_debug(1, "Bridge '%s' can not use native RTP bridge as channel '%s' has features which prevent it\n",
+ bridge->uniqueid, ast_channel_name(c0->chan));
+ return 0;
+ }
+
+ if (!native_rtp_bridge_capable(c1->chan)) {
+ ast_debug(1, "Bridge '%s' can not use native RTP bridge as channel '%s' has features which prevent it\n",
+ bridge->uniqueid, ast_channel_name(c1->chan));
return 0;
}
More information about the asterisk-commits
mailing list