[svn-commits] file: branch file/bridging r111816 - in /team/file/bridging: bridges/ include...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Mar 28 15:17:57 CDT 2008


Author: file
Date: Fri Mar 28 15:17:57 2008
New Revision: 111816

URL: http://svn.digium.com/view/asterisk?view=rev&rev=111816
Log:
Let's be C++ friendly! (pfft not really)

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

Modified: team/file/bridging/bridges/bridge_softmix.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/bridges/bridge_softmix.c?view=diff&rev=111816&r1=111815&r2=111816
==============================================================================
--- team/file/bridging/bridges/bridge_softmix.c (original)
+++ team/file/bridging/bridges/bridge_softmix.c Fri Mar 28 15:17:57 2008
@@ -168,7 +168,7 @@
 		struct timespec ts = {0, };
 
 		/* Go through pulling audio from each factory that has it available */
-		AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, list) {
+		AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
 			struct softmix_channel *sc = bridge_channel->bridge_pvt;
 
 			ast_mutex_lock(&sc->lock);
@@ -191,7 +191,7 @@
 		}
 
 		/* Next step go through removing the channel's own audio and creating a good frame... */
-		AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, list) {
+		AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
 			struct softmix_channel *sc = bridge_channel->bridge_pvt;
 			int i = 0;
 			

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=111816&r1=111815&r2=111816
==============================================================================
--- team/file/bridging/include/asterisk/bridging.h (original)
+++ team/file/bridging/include/asterisk/bridging.h Fri Mar 28 15:17:57 2008
@@ -97,7 +97,7 @@
 	int (*poke)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel);                                                     /*! Callback for poking a bridge technology */
 	int formats;                                                                                                                           /*! Formats this bridge technology can support */
 	unsigned int suspended:1;                                                                                                              /*! Is this bridge technology suspended from use or not? */
-	AST_RWLIST_ENTRY(ast_bridge_technology) list;                                                                                          /*! Linked list information */
+	AST_RWLIST_ENTRY(ast_bridge_technology) entry;                                                                                         /*! Linked list information */
 };
 
 
@@ -107,7 +107,7 @@
 	char dtmf[8];
 	ast_bridge_features_hook_callback callback;
 	void *hook_pvt;
-	AST_LIST_ENTRY(ast_bridge_features_hook) list;
+	AST_LIST_ENTRY(ast_bridge_features_hook) entry;
 };
 
 struct ast_bridge_features {
@@ -128,7 +128,7 @@
 	unsigned int suspended:1;                /*! Is this bridged channel suspended from the bridge or not? */
 	struct ast_bridge_features *features;    /*! Enabled features information */
 	char dtmf_stream_q[8];                   /*! DTMF stream queue */
-	AST_LIST_ENTRY(ast_bridge_channel) list; /*! Linked list information */
+	AST_LIST_ENTRY(ast_bridge_channel) entry;/*! Linked list information */
 };
 
 struct ast_bridge {

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=111816&r1=111815&r2=111816
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Fri Mar 28 15:17:57 2008
@@ -61,7 +61,7 @@
 	AST_RWLIST_WRLOCK(&bridge_technologies);
 
 	/* Look for duplicate bridge technology already using this name, or already registered */
-	AST_RWLIST_TRAVERSE(&bridge_technologies, current, list) {
+	AST_RWLIST_TRAVERSE(&bridge_technologies, current, entry) {
 		if ((!strcasecmp(current->name, technology->name)) || (current == technology)) {
 			ast_log(LOG_WARNING, "A bridge technology of %s already claims to exist in our world.\n", technology->name);
 			AST_RWLIST_UNLOCK(&bridge_technologies);
@@ -70,7 +70,7 @@
 	}
 
 	/* Insert our new bridge technology into the list and print out a pretty message */
-	AST_RWLIST_INSERT_TAIL(&bridge_technologies, technology, list);
+	AST_RWLIST_INSERT_TAIL(&bridge_technologies, technology, entry);
 
 	AST_RWLIST_UNLOCK(&bridge_technologies);
 
@@ -91,9 +91,9 @@
 	AST_RWLIST_WRLOCK(&bridge_technologies);
 
 	/* Ensure the bridge technology is registered before removing it */
-	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&bridge_technologies, current, list) {
+	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&bridge_technologies, current, entry) {
 		if (current == technology) {
-			AST_RWLIST_REMOVE_CURRENT(list);
+			AST_RWLIST_REMOVE_CURRENT(entry);
 			if (option_verbose > 1)
 				ast_verbose(VERBOSE_PREFIX_2 "Unregistered bridge technology %s\n", technology->name);
 			break;
@@ -111,7 +111,7 @@
 {
 	struct ast_bridge_channel *bridge_channel = NULL;
 
-	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, list) {
+	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
 		if (bridge_channel->chan == chan)
 			break;
 	}
@@ -129,7 +129,7 @@
 
 	ast_debug(1, "Dissolving bridge %p\n", bridge);
 
-	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel2, list) {
+	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel2, entry) {
 		if (bridge_channel2->state != AST_BRIDGE_CHANNEL_STATE_END && bridge_channel2->state != AST_BRIDGE_CHANNEL_STATE_DEPART)
 			ast_bridge_change_state(bridge_channel2, AST_BRIDGE_CHANNEL_STATE_HANGUP);
 	}
@@ -151,7 +151,7 @@
 		return frame;
 
 	/* See if this DTMF matches the beginnings of any feature hooks, if so we switch to the feature state to either execute the feature or collect more DTMF */
-	AST_LIST_TRAVERSE(&features->hooks, hook, list) {
+	AST_LIST_TRAVERSE(&features->hooks, hook, entry) {
 		if (hook->dtmf[0] == frame->subclass) {
 			ast_frfree(frame);
 			frame = NULL;
@@ -223,7 +223,7 @@
 			struct ast_bridge_channel *bridge_channel = NULL;
 			int i = 0;
 
-			AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, list) {
+			AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
 				if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_WAIT && !bridge_channel->suspended)
 					cs[i++] = bridge_channel->chan;
 			}
@@ -290,7 +290,7 @@
 	struct ast_bridge_technology *current = NULL, *best = NULL;
 
 	AST_RWLIST_RDLOCK(&bridge_technologies);
-	AST_RWLIST_TRAVERSE(&bridge_technologies, current, list) {
+	AST_RWLIST_TRAVERSE(&bridge_technologies, current, entry) {
 		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);
@@ -368,7 +368,7 @@
 	ast_mutex_lock(&bridge->lock);
 
 	/* Drop every bridged channel */
-	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, list) {
+	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
 		ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_END);
 	}
 
@@ -546,7 +546,7 @@
 	}
 
 	/* Our next step is to depart all the channels from one bridge technology and join them with the other */
-	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel2, list) {
+	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel2, entry) {
 		/* Skip over channel that initiated the smart bridge operation if present */
 		if (bridge_channel && bridge_channel2 == bridge_channel)
 			continue;
@@ -700,7 +700,7 @@
 		look_for_dtmf = 0;
 
 		/* See if a DTMF feature hook matches or can match */
-		AST_LIST_TRAVERSE(&features->hooks, hook, list) {
+		AST_LIST_TRAVERSE(&features->hooks, hook, entry) {
 			/* If this hook matches just break out now */
 			if (!strcmp(hook->dtmf, dtmf)) {
 				ast_debug(1, "DTMF feature hook %p matched DTMF string '%s' on bridge channel %p\n", hook, dtmf, bridge_channel);
@@ -833,7 +833,7 @@
 	/* If this channel is exiting the bridge in a swap state then we need not remove them or perform the smart bridge operation, it doesn't matter */
 	if (bridge_channel->state != AST_BRIDGE_CHANNEL_STATE_SWAP) {
 		/* Remove ourselves from the bridge */
-		AST_LIST_REMOVE(&bridge->channels, bridge_channel, list);
+		AST_LIST_REMOVE(&bridge->channels, bridge_channel, entry);
 		
 		/* And for my last trick... perform the smart bridge operation yet again */
 		if (ast_test_flag(&bridge->feature_flags, AST_BRIDGE_FLAG_SMART))
@@ -894,7 +894,7 @@
 	ast_mutex_lock(&bridge->lock);
 
 	/* Add channel to the bridge now, but suspended */
-	AST_LIST_INSERT_TAIL(&bridge->channels, &bridge_channel, list);
+	AST_LIST_INSERT_TAIL(&bridge->channels, &bridge_channel, entry);
 
 	/* Increment channel count since we are joining */
 	ast_atomic_fetchadd_int(&bridge->num, +1);
@@ -907,7 +907,7 @@
 		struct ast_bridge_channel *swap_channel = NULL;
 		if ((swap_channel = find_bridge_channel(bridge, swap))) {
 			ast_debug(1, "Removing bridge channel %p from bridge %p and setting it to a swap state\n", swap_channel, bridge);
-			AST_LIST_REMOVE(&bridge->channels, swap_channel, list);
+			AST_LIST_REMOVE(&bridge->channels, swap_channel, entry);
 			/* Signal the bridge thread to rebuild and poke it if required */
 			ast_bridge_rebuild(bridge);
 			ast_debug(1, "Releasing bridge lock on %p to ensure swap operation from bridge thread\n", bridge);
@@ -1022,7 +1022,7 @@
 	ast_mutex_lock(&bridge->lock);
 
 	/* Add channel to the bridge now, but suspended */
-	AST_LIST_INSERT_TAIL(&bridge->channels, bridge_channel, list);
+	AST_LIST_INSERT_TAIL(&bridge->channels, bridge_channel, entry);
 
 	/* Before we actually hand over this channel to the other thread increment the bridge channel number so the bridge can't go away */
 	ast_atomic_fetchadd_int(&bridge->num, +1);
@@ -1032,7 +1032,7 @@
 		struct ast_bridge_channel *swap_channel = NULL;
 		if ((swap_channel = find_bridge_channel(bridge, swap))) {
 			ast_debug(1, "Removing bridge channel %p from bridge %p and setting it to a swap state\n", swap_channel, bridge);
-			AST_LIST_REMOVE(&bridge->channels, swap_channel, list);
+			AST_LIST_REMOVE(&bridge->channels, swap_channel, entry);
 			/* Signal the bridge thread to rebuild and poke it if required */
 			ast_bridge_rebuild(bridge);
 			ast_debug(1, "Releasing bridge lock on %p to ensure swap operation from bridge thread\n", bridge);
@@ -1225,7 +1225,7 @@
 	}
 
 	/* Move channels from bridge1 to bridge0 */
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&bridge1->channels, bridge_channel, list) {
+	AST_LIST_TRAVERSE_SAFE_BEGIN(&bridge1->channels, bridge_channel, entry) {
 		/* Tell the old bridge they are leaving */
 		if (bridge1->technology->leave) {
 			ast_debug(1, "Giving bridge technology %s notification that %p is leaving bridge %p\n", bridge1->technology->name, bridge_channel, bridge1);
@@ -1233,7 +1233,7 @@
 			    ast_debug(1, "Bridge technology %s failed to allow %p to leave bridge %p\n", bridge1->technology->name, bridge_channel, bridge1);
 		}
 		/* Now actually remove them from the list, but don't decrement the channel count... this is important */
-		AST_LIST_REMOVE_CURRENT(list);
+		AST_LIST_REMOVE_CURRENT(entry);
 		/* Change the state to merge. This tells the bridged channel to update their own bridge pointer to the new bridge and decrement the channel count. */
 		ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_MERGE);
 		/* Now make this channel compatible with the new bridge */
@@ -1241,7 +1241,7 @@
 		/* Update the bridged channel to point to the new bridge */
 		bridge_channel->chan->bridge = bridge0;
 		/* And add them in list and count wise */
-		AST_LIST_INSERT_TAIL(&bridge0->channels, bridge_channel, list);
+		AST_LIST_INSERT_TAIL(&bridge0->channels, bridge_channel, entry);
 		ast_atomic_fetchadd_int(&bridge0->num, +1);
 		/* The last step is to simply tell the new bridge they are joining */
 		if (bridge0->technology->join) {
@@ -1358,7 +1358,7 @@
 	hook->hook_pvt = hook_pvt;
 
 	/* Once done we add it onto the list. Now it will be picked up when DTMF is used */
-	AST_LIST_INSERT_TAIL(&features->hooks, hook, list);
+	AST_LIST_INSERT_TAIL(&features->hooks, hook, entry);
 
 	features->usable = 1;
 
@@ -1618,7 +1618,7 @@
 	struct ast_bridge_features_hook *hook = NULL;
 
 	/* This is relatively simple, hooks are kept as a list on the features structure so we just pop them off and free them */
-	while ((hook = AST_LIST_REMOVE_HEAD(&features->hooks, list)))
+	while ((hook = AST_LIST_REMOVE_HEAD(&features->hooks, entry)))
 		free(hook);
 
 	return 0;
@@ -1639,7 +1639,7 @@
 	/* Trigger a rebuild now just in case */
 	ast_bridge_rebuild(bridge);
 
-	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, list) {
+	AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
 		if (bridge_channel->chan == chan)
 			continue;
 		ast_copy_string(bridge_channel->dtmf_stream_q, dtmf, sizeof(bridge_channel->dtmf_stream_q));




More information about the svn-commits mailing list