[asterisk-commits] jrose: branch jrose/bridge_projects r384115 - /team/jrose/bridge_projects/res...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 27 13:36:18 CDT 2013


Author: jrose
Date: Wed Mar 27 13:36:14 2013
New Revision: 384115

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384115
Log:
Oh yeah, need to add parking_bridge.c

Added:
    team/jrose/bridge_projects/res/parking/parking_bridge.c   (with props)

Added: team/jrose/bridge_projects/res/parking/parking_bridge.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/parking/parking_bridge.c?view=auto&rev=384115
==============================================================================
--- team/jrose/bridge_projects/res/parking/parking_bridge.c (added)
+++ team/jrose/bridge_projects/res/parking/parking_bridge.c Wed Mar 27 13:36:14 2013
@@ -1,0 +1,149 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2013, Digium, Inc.
+ *
+ * Jonathan Rose <jrose 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 Parking Bridge Class
+ *
+ * \author Jonathan Rose <jrose at digium.com>
+ */
+
+#include "asterisk.h"
+#include "asterisk/logger.h"
+#include "res_parking.h"
+#include "asterisk/astobj2.h"
+
+/*!
+ * \internal
+ * \brief ast_bridge parking class destructor
+ * \since 12.0.0
+ *
+ * \param self Bridge to operate upon.
+ *
+ * \note XXX Stub
+ *
+ * \return Nothing
+ */
+static void bridge_parking_destroy(struct ast_bridge *self)
+{
+}
+
+/*!
+ * \internal
+ * \brief ast_bridge parking can_push method.
+ * \since 12.0.0
+ *
+ * \param self Bridge to operate upon
+ * \param bridge_channel Bridge channel wanting to push.
+ * \param swap Bridge channel to swap places with if not NULL.
+ *
+ * \note On entry, self is already locked.
+ * \note XXX Stub
+ *
+ * \retval TRUE if can push this channel into the bridge.
+ */
+static int bridge_parking_can_push(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap)
+{
+	return 1;
+}
+
+/*!
+ * \internal
+ * \brief ast_bridge parking push method.
+ * \since 12.0.0
+ *
+ * \param self Bridge to operate upon
+ * \param bridge_channel Bridge channel to push
+ * \param swap Bridge channel to swap places with if not NULL
+ *
+ * \note On entry, self is already locked
+ * \note XXX Stub
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ */
+static int bridge_parking_push(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap)
+{
+	return 0;
+}
+
+/*!
+ * \internal
+ * \brief ast_bridge parking pull method.
+ * \since 12.0.0
+ *
+ * \param self Bridge to operate upon.
+ * \param bridge_channel Bridge channel to pull.
+ *
+ * \note On entry, self is already locked.
+ * \note XXX Stub
+ *
+ * \return Nothing
+ */
+static void bridge_parking_pull(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel)
+{
+	ast_bridge_base_v_table.pull(self, bridge_channel);
+}
+
+/*!
+ * \internal
+ * \brief ast_bridge parking notify_masquerade method.
+ * \since 12.0.0
+ *
+ * \param self Bridge to operate upon.
+ * \param bridge_channel Bridge channel that was masqueraded.
+ *
+ * \note On entry, self is already locked.
+ * \note XXX Stub
+ *
+ * \return Nothing
+ */
+static void bridge_parking_notify_masquerade(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel)
+{
+	ast_bridge_base_v_table.notify_masquerade(self, bridge_channel);
+}
+
+struct ast_bridge_methods ast_bridge_parking_v_table = {
+	.name = "parking",
+	.destroy = bridge_parking_destroy,
+	.can_push = bridge_parking_can_push,
+	.push = bridge_parking_push,
+	.pull = bridge_parking_pull,
+	.notify_masquerade = bridge_parking_notify_masquerade,
+};
+
+static struct ast_bridge *ast_bridge_parking_init(struct ast_bridge *self, struct parking_lot_state *bridge_lot)
+{
+	int flags = AST_BRIDGE_FLAG_MERGE_INHIBIT_TO | AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM;
+	uint32_t capabilities = AST_BRIDGE_CAPABILITY_HOLDING;
+	ast_bridge_base_init(self, capabilities, flags);
+
+	/* XXX Use the parking lot state as the bridge private */
+
+	return self;
+}
+
+struct ast_bridge *bridge_parking_new(struct parking_lot_state *bridge_lot)
+{
+	void *bridge;
+
+	bridge = ast_bridge_alloc(sizeof(struct ast_bridge), &ast_bridge_parking_v_table);
+	bridge = ast_bridge_parking_init(bridge, bridge_lot);
+
+	return bridge;
+}

Propchange: team/jrose/bridge_projects/res/parking/parking_bridge.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/jrose/bridge_projects/res/parking/parking_bridge.c
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Rev URL"

Propchange: team/jrose/bridge_projects/res/parking/parking_bridge.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list