[svn-commits] twilson: branch 1.8 r319920 - in /branches/1.8: include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu May 19 18:28:17 CDT 2011


Author: twilson
Date: Thu May 19 18:28:13 2011
New Revision: 319920

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319920
Log:
Revert part of a change to the bridging API code

The capabilities used in the bridging API are very different than the
ones used for formats. When the conversion was made expanding the bit
width of codecs, the bridging code was accidentally accosted in ways
that it didn't deserve.

Modified:
    branches/1.8/include/asterisk/bridging.h
    branches/1.8/include/asterisk/bridging_technology.h
    branches/1.8/main/bridging.c

Modified: branches/1.8/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/bridging.h?view=diff&rev=319920&r1=319919&r2=319920
==============================================================================
--- branches/1.8/include/asterisk/bridging.h (original)
+++ branches/1.8/include/asterisk/bridging.h Thu May 19 18:28:13 2011
@@ -193,7 +193,7 @@
  * This creates a simple two party bridge that will be destroyed once one of
  * the channels hangs up.
  */
-struct ast_bridge *ast_bridge_new(format_t capabilities, int flags);
+struct ast_bridge *ast_bridge_new(enum ast_bridge_capability capabilities, int flags);
 
 /*! \brief See if it is possible to create a bridge
  *
@@ -211,7 +211,7 @@
  * This sees if it is possible to create a bridge capable of bridging two channels
  * together.
  */
-int ast_bridge_check(format_t capabilities);
+int ast_bridge_check(enum ast_bridge_capability capabilities);
 
 /*! \brief Destroy a bridge
  *

Modified: branches/1.8/include/asterisk/bridging_technology.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/bridging_technology.h?view=diff&rev=319920&r1=319919&r2=319920
==============================================================================
--- branches/1.8/include/asterisk/bridging_technology.h (original)
+++ branches/1.8/include/asterisk/bridging_technology.h Thu May 19 18:28:13 2011
@@ -45,7 +45,7 @@
 	/*! Unique name to this bridge technology */
 	const char *name;
 	/*! The capabilities that this bridge technology is capable of */
-	format_t capabilities;
+	int capabilities;
 	/*! Preference level that should be used when determining whether to use this bridge technology or not */
 	enum ast_bridge_preference preference;
 	/*! Callback for when a bridge is being created */

Modified: branches/1.8/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/bridging.c?view=diff&rev=319920&r1=319919&r2=319920
==============================================================================
--- branches/1.8/main/bridging.c (original)
+++ branches/1.8/main/bridging.c Thu May 19 18:28:13 2011
@@ -382,16 +382,13 @@
 }
 
 /*! \brief Helper function used to find the "best" bridge technology given a specified capabilities */
-static struct ast_bridge_technology *find_best_technology(format_t capabilities)
+static struct ast_bridge_technology *find_best_technology(enum ast_bridge_capability capabilities)
 {
 	struct ast_bridge_technology *current = NULL, *best = NULL;
 
 	AST_RWLIST_RDLOCK(&bridge_technologies);
 	AST_RWLIST_TRAVERSE(&bridge_technologies, current, entry) {
-		char tmp1[256], tmp2[256];
-		ast_debug(1, "Bridge technology %s has capabilities %s and we want %s\n", current->name,
-			ast_getformatname_multiple(tmp1, sizeof(tmp1), current->capabilities),
-			ast_getformatname_multiple(tmp2, sizeof(tmp2), capabilities));
+		ast_debug(1, "Bridge technology %s has capabilities %d and we want %d\n", current->name, current->capabilities, capabilities);
 		if (current->suspended) {
 			ast_debug(1, "Bridge technology %s is suspended. Skipping.\n", current->name);
 			continue;
@@ -448,7 +445,7 @@
 	return;
 }
 
-struct ast_bridge *ast_bridge_new(format_t capabilities, int flags)
+struct ast_bridge *ast_bridge_new(enum ast_bridge_capability capabilities, int flags)
 {
 	struct ast_bridge *bridge = NULL;
 	struct ast_bridge_technology *bridge_technology = NULL;
@@ -470,9 +467,7 @@
 
 	/* If no bridge technology was found we can't possibly do bridging so fail creation of the bridge */
 	if (!bridge_technology) {
-		char codec_buf[256];
-		ast_debug(1, "Failed to find a bridge technology to satisfy capabilities %s\n",
-			ast_getformatname_multiple(codec_buf, sizeof(codec_buf), capabilities));
+		ast_debug(1, "Failed to find a bridge technology to satisfy capabilities %d\n", capabilities);
 		return NULL;
 	}
 
@@ -503,7 +498,7 @@
 	return bridge;
 }
 
-int ast_bridge_check(format_t capabilities)
+int ast_bridge_check(enum ast_bridge_capability capabilities)
 {
 	struct ast_bridge_technology *bridge_technology = NULL;
 
@@ -591,7 +586,7 @@
 /*! \brief Perform the smart bridge operation. Basically sees if a new bridge technology should be used instead of the current one. */
 static int smart_bridge_operation(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, int count)
 {
-	format_t new_capabilities = 0;
+	enum ast_bridge_capability new_capabilities = 0;
 	struct ast_bridge_technology *new_technology = NULL, *old_technology = bridge->technology;
 	struct ast_bridge temp_bridge = {
 		.technology = bridge->technology,
@@ -621,9 +616,7 @@
 
 	/* Attempt to find a new bridge technology to satisfy the capabilities */
 	if (!(new_technology = find_best_technology(new_capabilities))) {
-		char codec_buf[256];
-		ast_debug(1, "Smart bridge operation was unable to find new bridge technology with capabilities %s to satisfy bridge %p\n",
-			ast_getformatname_multiple(codec_buf, sizeof(codec_buf), new_capabilities), bridge);
+		ast_debug(1, "Smart bridge operation was unable to find new bridge technology with capabilities %d to satisfy bridge %p\n", new_capabilities, bridge);
 		return -1;
 	}
 




More information about the svn-commits mailing list