[asterisk-commits] kmoore: branch kmoore/stasis-bridging_events-rework r390036 - in /team/kmoore...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 29 13:26:29 CDT 2013


Author: kmoore
Date: Wed May 29 13:26:25 2013
New Revision: 390036

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390036
Log:
Break out some bridging functionality into its own module

Added:
    team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c   (with props)
    team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in   (with props)
Modified:
    team/kmoore/stasis-bridging_events-rework/res/stasis/control.c

Added: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c?view=auto&rev=390036
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c (added)
+++ team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c Wed May 29 13:26:25 2013
@@ -1,0 +1,73 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2013, Digium, Inc.
+ *
+ * Kinsey Moore <kmoore at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief res_stasis bridge add channel support.
+ *
+ * \author Kinsey Moore <kmoore at digium.com>
+ */
+
+/*** MODULEINFO
+	<depend type="module">res_stasis</depend>
+	<support_level>core</support_level>
+ ***/
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/module.h"
+#include "asterisk/stasis_app_impl.h"
+#include "asterisk/bridging.h"
+
+static void *app_control_join_bridge(struct stasis_app_control *control,
+	struct ast_channel *chan, void *data)
+{
+	struct ast_bridge_features features;
+	struct ast_bridge *bridge = data;
+	ast_bridge_features_init(&features);
+	ast_bridge_join(bridge,	chan, NULL, &features, NULL, 0);
+	ast_bridge_features_cleanup(&features);
+
+	return NULL;
+}
+
+void stasis_app_control_add_channel_to_bridge(struct stasis_app_control *control, struct ast_bridge *bridge)
+{
+	ast_debug(3, "%s: Sending channel add_to_bridge command\n",
+			stasis_app_control_get_channel_id(control));
+
+	stasis_app_send_command_async(control, app_control_join_bridge, bridge);
+}
+
+static int load_module(void)
+{
+	return AST_MODULE_LOAD_SUCCESS;
+}
+
+static int unload_module(void)
+{
+	return 0;
+}
+
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS,
+	"Stasis application bridge add channel support",
+	.load = load_module,
+	.unload = unload_module,
+	.nonoptreq = "res_stasis");

Propchange: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in?view=auto&rev=390036
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in (added)
+++ team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in Wed May 29 13:26:25 2013
@@ -1,0 +1,6 @@
+{
+	global:
+		LINKER_SYMBOL_PREFIXstasis_app_*;
+	local:
+		*;
+};

Propchange: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kmoore/stasis-bridging_events-rework/res/res_stasis_bridge_add.exports.in
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/kmoore/stasis-bridging_events-rework/res/stasis/control.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/res/stasis/control.c?view=diff&rev=390036&r1=390035&r2=390036
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/res/stasis/control.c (original)
+++ team/kmoore/stasis-bridging_events-rework/res/stasis/control.c Wed May 29 13:26:25 2013
@@ -203,26 +203,7 @@
 	return count;
 }
 
-static void *app_control_join_bridge(struct stasis_app_control *control,
-	struct ast_channel *chan, void *data)
-{
-	struct ast_bridge_features features;
-	struct ast_bridge *bridge = data;
-	ast_bridge_features_init(&features);
-	ast_bridge_join(bridge,	control->channel, NULL, &features, NULL, 0);
-	ast_bridge_features_cleanup(&features);
-
-	return NULL;
-}
-
-void stasis_app_control_add_channel_to_bridge(struct stasis_app_control *control, struct ast_bridge *bridge)
-{
-	ast_debug(3, "%s: Sending channel add_to_bridge command\n",
-			ast_channel_uniqueid(control->channel));
-
-	stasis_app_send_command_async(control, app_control_join_bridge, bridge);
-}
-
+/* Must be defined here since it must operate on the channel outside of the queue */
 int stasis_app_control_remove_channel_from_bridge(
 	struct stasis_app_control *control, struct ast_bridge *bridge)
 {




More information about the asterisk-commits mailing list