[asterisk-commits] file: branch file/bridging r78169 - in /team/file/bridging: include/asterisk/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 6 09:54:27 CDT 2007


Author: file
Date: Mon Aug  6 09:54:26 2007
New Revision: 78169

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78169
Log:
Add ability to suspend a bridge technology from consideration. This is useful for bridge technologies that may have limited resources for mixing.

Modified:
    team/file/bridging/include/asterisk/bridging.h
    team/file/bridging/main/bridging.c

Modified: team/file/bridging/include/asterisk/bridging.h
URL: http://svn.digium.com/view/asterisk/team/file/bridging/include/asterisk/bridging.h?view=diff&rev=78169&r1=78168&r2=78169
==============================================================================
--- team/file/bridging/include/asterisk/bridging.h (original)
+++ team/file/bridging/include/asterisk/bridging.h Mon Aug  6 09:54:26 2007
@@ -75,6 +75,7 @@
 	int (*write)(struct ast_bridge *bridge, struct ast_bridge_channel *bridged_channel, struct ast_frame *frame); /*! Callback for writing a frame to the bridge */
 	int (*signal)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel);                          /*! Callback for a bridge channel thread signal */
 	int formats;                                                                                                  /*! Formats this bridge technology can support */
+	int suspended:1;                                                                                              /*! Is this bridge technology suspended from use or not? */
 	AST_RWLIST_ENTRY(ast_bridge_technology) list;                                                                 /*! Linked list information */
 };
 
@@ -158,6 +159,16 @@
  */
 int ast_bridge_merge(struct ast_bridge *bridge0, struct ast_bridge *bridge1);
 
+/*! \brief Suspend a bridge technology from consideration
+ * \param technology The bridge technology to suspend
+ */
+void ast_bridge_technology_suspend(struct ast_bridge_technology *technology);
+
+/*! \brief Unsuspend a bridge technology
+ * \param technology The bridge technology to unsuspend
+ */
+void ast_bridge_technology_unsuspend(struct ast_bridge_technology *technology);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=78169&r1=78168&r2=78169
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Mon Aug  6 09:54:26 2007
@@ -219,6 +219,8 @@
 	AST_RWLIST_TRAVERSE(&bridge_technologies, current, list) {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Bridge technology %s has capabilities %d and we want %d\n", current->name, current->capabilities, capabilities);
+		if (current->suspended)
+			continue;
 		if (!(current->capabilities & capabilities))
 			continue;
 		if (best && best->preference < current->preference)
@@ -631,3 +633,21 @@
 {
 	return -1;
 }
+
+/*! \brief Suspend a bridge technology from consideration
+ * \param technology The bridge technology to suspend
+ */
+void ast_bridge_technology_suspend(struct ast_bridge_technology *technology)
+{
+	technology->suspended = 1;
+	return;
+}
+
+/*! \brief Unsuspend a bridge technology
+ * \param technology The bridge technology to unsuspend
+ */
+void ast_bridge_technology_unsuspend(struct ast_bridge_technology *technology)
+{
+	technology->suspended = 0;
+	return;
+}




More information about the asterisk-commits mailing list