[asterisk-commits] russell: branch russell/ast_channel_ao2 r183551 - in /team/russell/ast_channe...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 20 09:44:05 CDT 2009


Author: russell
Date: Fri Mar 20 09:44:00 2009
New Revision: 183551

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=183551
Log:
whitespace cleanup

Modified:
    team/russell/ast_channel_ao2/apps/app_chanspy.c
    team/russell/ast_channel_ao2/apps/app_directed_pickup.c
    team/russell/ast_channel_ao2/channels/chan_sip.c
    team/russell/ast_channel_ao2/funcs/func_logic.c
    team/russell/ast_channel_ao2/include/asterisk/autochan.h
    team/russell/ast_channel_ao2/include/asterisk/channel.h
    team/russell/ast_channel_ao2/main/autochan.c
    team/russell/ast_channel_ao2/main/channel.c
    team/russell/ast_channel_ao2/main/cli.c
    team/russell/ast_channel_ao2/main/features.c
    team/russell/ast_channel_ao2/main/manager.c
    team/russell/ast_channel_ao2/main/pbx.c
    team/russell/ast_channel_ao2/res/res_monitor.c
    team/russell/ast_channel_ao2/res/snmp/agent.c

Modified: team/russell/ast_channel_ao2/apps/app_chanspy.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/apps/app_chanspy.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/apps/app_chanspy.c (original)
+++ team/russell/ast_channel_ao2/apps/app_chanspy.c Fri Mar 20 09:44:00 2009
@@ -407,7 +407,7 @@
 
 	res = ast_audiohook_attach(autochan->chan, audiohook);
 
-	if (!res && ast_test_flag(autochan->chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(autochan->chan))) { 
+	if (!res && ast_test_flag(autochan->chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(autochan->chan))) {
 		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
 	}
 	return res;
@@ -427,8 +427,8 @@
 	}
 }
 
-static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_autochan, 
-	int *volfactor, int fd, struct ast_flags *flags, char *exitcontext) 
+static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_autochan,
+	int *volfactor, int fd, struct ast_flags *flags, char *exitcontext)
 {
 	struct chanspy_translation_helper csth;
 	int running = 0, res, x = 0;
@@ -468,9 +468,9 @@
 		return 0;
 	}
 
- 	ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
+	ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
 	ast_audiohook_init(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "Chanspy");
-  	if (start_spying(spyee_autochan, spyer_name, &csth.whisper_audiohook)) {
+	if (start_spying(spyee_autochan, spyer_name, &csth.whisper_audiohook)) {
 		ast_log(LOG_WARNING, "Unable to attach whisper audiohook to spyee %s. Whisper mode disabled!\n", name);
 	}
 	if ((spyee_bridge_autochan = ast_autochan_setup(ast_bridged_channel(spyee_autochan->chan)))) {
@@ -616,7 +616,7 @@
 	if (spyee_bridge_autochan) {
 		ast_autochan_destroy(spyee_bridge_autochan);
 	}
-	
+
 	ast_verb(2, "Done Spying on channel %s\n", name);
 	manager_event(EVENT_FLAG_CALL, "ChanSpyStop", "SpyeeChannel: %s\r\n", name);
 
@@ -706,7 +706,7 @@
 					ast_debug(2, "Exit by single digit did not work in chanspy. Extension %s does not exist in context %s\n", tmp, exitcontext);
 			}
 		}
-		
+
 		/* Set up the iterator we'll be using during this call */
 		if (!ast_strlen_zero(spec)) {
 			iter = ast_channel_iterator_by_name_new(0, spec, strlen(spec));
@@ -743,7 +743,7 @@
 		     autochan;
 			 prev = autochan->chan, ast_autochan_destroy(autochan),
 		     autochan = next_autochan ? next_autochan : 
-			 	next_channel(iter, autochan, chan), next_autochan = NULL) {
+				next_channel(iter, autochan, chan), next_autochan = NULL) {
 			int igrp = !mygroup;
 			int ienf = !myenforced;
 			char *s;

Modified: team/russell/ast_channel_ao2/apps/app_directed_pickup.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/apps/app_directed_pickup.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/apps/app_directed_pickup.c (original)
+++ team/russell/ast_channel_ao2/apps/app_directed_pickup.c Fri Mar 20 09:44:00 2009
@@ -213,13 +213,13 @@
 	const char *mark = data;
 	const char *tmp;
 	int res;
-	
+
 	ast_channel_lock(c);
 
 	res = (tmp = pbx_builtin_getvar_helper(c, PICKUPMARK)) &&
 		!strcasecmp(tmp, mark) &&
 		can_pickup(c);
-	
+
 	ast_channel_unlock(c);
 
 	return res ? CMP_MATCH | CMP_STOP : 0;

Modified: team/russell/ast_channel_ao2/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/channels/chan_sip.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/channels/chan_sip.c (original)
+++ team/russell/ast_channel_ao2/channels/chan_sip.c Fri Mar 20 09:44:00 2009
@@ -10388,7 +10388,7 @@
 			   the hint'd device is not sufficient. */
 			if (sip_cfg.notifycid) {
 				struct ast_channel *caller;
-				
+
 				if ((caller = ast_channel_callback(find_calling_channel, NULL, p, 0))) {
 					int need = strlen(caller->cid.cid_num) + strlen(p->fromdomain) + sizeof("sip:@");
 					local_target = alloca(need);

Modified: team/russell/ast_channel_ao2/funcs/func_logic.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/funcs/func_logic.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/funcs/func_logic.c (original)
+++ team/russell/ast_channel_ao2/funcs/func_logic.c Fri Mar 20 09:44:00 2009
@@ -235,7 +235,7 @@
 
 	if (!ast_strlen_zero(args.varname)) {
 		struct ast_channel *chan2;
-		
+
 		if ((chan2 = ast_channel_get_by_name(args.channel))) {
 			char *s = alloca(strlen(args.varname) + 4);
 			sprintf(s, "${%s}", args.varname);

Modified: team/russell/ast_channel_ao2/include/asterisk/autochan.h
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/include/asterisk/autochan.h?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/include/asterisk/autochan.h (original)
+++ team/russell/ast_channel_ao2/include/asterisk/autochan.h Fri Mar 20 09:44:00 2009
@@ -21,7 +21,7 @@
  * \brief "smart" channels that update automatically if a channel is masqueraded
  *
  * \author Mark Michelson <mmichelson at digium.com>
- * 
+ *
  */
 
 #include "asterisk.h"
@@ -42,8 +42,8 @@
  * to is masqueraded into a different channel.
  *
  * This has a great benefit for any application or service which creates a thread
- * outside of the channel's main operating thread which keeps a pointer to said 
- * channel. when a masquerade occurs on the channel, the autochan's chan pointer 
+ * outside of the channel's main operating thread which keeps a pointer to said
+ * channel. when a masquerade occurs on the channel, the autochan's chan pointer
  * will automatically update to point to the new channel.
  *
  * Some rules for autochans

Modified: team/russell/ast_channel_ao2/include/asterisk/channel.h
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/include/asterisk/channel.h?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/include/asterisk/channel.h (original)
+++ team/russell/ast_channel_ao2/include/asterisk/channel.h Fri Mar 20 09:44:00 2009
@@ -433,7 +433,7 @@
  * gets called before the channel goes away.
  */
 
-/*! \brief Main Channel structure associated with a channel. 
+/*! \brief Main Channel structure associated with a channel.
  * This is the side of it mostly used by the pbx and call management.
  *
  * \note XXX It is important to remember to increment .cleancount each time
@@ -1844,7 +1844,7 @@
  * \retval NULL on failure
  * \retval a new channel iterator based on the specified parameters
  */
-struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, const char *exten, 
+struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, const char *exten,
 	const char *context);
 
 /*!
@@ -1863,7 +1863,7 @@
  * \retval NULL on failure
  * \retval a new channel iterator based on the specified parameters
  */
-struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, const char *name, 
+struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, const char *name,
 	size_t name_len);
 
 /*!

Modified: team/russell/ast_channel_ao2/main/autochan.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/main/autochan.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/main/autochan.c (original)
+++ team/russell/ast_channel_ao2/main/autochan.c Fri Mar 20 09:44:00 2009
@@ -21,7 +21,7 @@
  * \brief "smart" channels
  *
  * \author Mark Michelson <mmichelson at digium.com>
- * 
+ *
  */
 
 #include "asterisk.h"
@@ -80,7 +80,7 @@
 			autochan->chan = ast_channel_unref(old_chan);
 			autochan->chan = ast_channel_ref(new_chan);
 			if (option_debug > 1) {
-				ast_log(LOG_DEBUG, "Autochan %p used to hold channel %s (%p) but now holds channel %s (%p)\n", 
+				ast_log(LOG_DEBUG, "Autochan %p used to hold channel %s (%p) but now holds channel %s (%p)\n",
 						autochan, old_chan->name, old_chan, new_chan->name, new_chan);
 			}
 		}

Modified: team/russell/ast_channel_ao2/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/main/channel.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/main/channel.c (original)
+++ team/russell/ast_channel_ao2/main/channel.c Fri Mar 20 09:44:00 2009
@@ -1147,7 +1147,7 @@
 	return NULL;
 }
 
-static struct ast_channel_iterator *ast_channel_iterator_new(int ao2_flags, const char *name, 
+static struct ast_channel_iterator *ast_channel_iterator_new(int ao2_flags, const char *name,
 	size_t name_len, const char *exten, const char *context)
 {
 	struct ast_channel_iterator *i;
@@ -1190,13 +1190,13 @@
 	return NULL;
 }
 
-struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, const char *exten, 
+struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, const char *exten,
 	const char *context)
 {
 	return ast_channel_iterator_new(ao2_flags, NULL, 0, exten, context);
 }
 
-struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, const char *name, 
+struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, const char *name,
 	size_t name_len)
 {
 	return ast_channel_iterator_new(ao2_flags, name, name_len, NULL, NULL);
@@ -1215,7 +1215,7 @@
 {
 	struct ast_channel *chan = NULL;
 
-	for (; (chan = ao2_iterator_next(&i->i)); 
+	for (; (chan = ao2_iterator_next(&i->i));
 			ast_channel_unlock(chan), ast_channel_unref(chan)) {
 
 		ast_channel_lock(chan);
@@ -1333,7 +1333,7 @@
 }
 
 struct ast_channel *ast_channel_release(struct ast_channel *chan)
-{	
+{
 	/* Safe, even if already unlinked. */
 	ao2_unlink(channels, chan);
 	return ast_channel_unref(chan);
@@ -1352,9 +1352,9 @@
 	struct varshead *headp;
 	struct ast_datastore *datastore = NULL;
 	char name[AST_CHANNEL_NAME], *dashptr;
-	
+
 	headp = &chan->varshead;
-	
+
 	/* Get rid of each of the data stores on the channel */
 	while ((datastore = AST_LIST_REMOVE_HEAD(&chan->datastores, entry)))
 		/* Free the data store */
@@ -1713,7 +1713,7 @@
 		ast_cdr_detach(chan->cdr);
 		chan->cdr = NULL;
 	}
-	
+
 	chan = ast_channel_release(chan);
 
 	return res;

Modified: team/russell/ast_channel_ao2/main/cli.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/main/cli.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/main/cli.c (original)
+++ team/russell/ast_channel_ao2/main/cli.c Fri Mar 20 09:44:00 2009
@@ -843,7 +843,7 @@
 		ast_channel_lock(c);
 
 		bc = ast_bridged_channel(c);
-		
+
 		if (!count) {
 			if ((concise || verbose)  && c->cdr && !ast_tvzero(c->cdr->start)) {
 				int duration = (int)(ast_tvdiff_ms(ast_tvnow(), c->cdr->start) / 1000);
@@ -1213,7 +1213,7 @@
 			chan->fin |= DEBUGCHAN_FLAG;
 			chan->fout |= DEBUGCHAN_FLAG;
 		}
-		ast_cli(args->fd, "Debugging %s on channel %s\n", args->is_off ? "disabled" : "enabled", 
+		ast_cli(args->fd, "Debugging %s on channel %s\n", args->is_off ? "disabled" : "enabled",
 				chan->name);
 	}
 

Modified: team/russell/ast_channel_ao2/main/features.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/main/features.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/main/features.c (original)
+++ team/russell/ast_channel_ao2/main/features.c Fri Mar 20 09:44:00 2009
@@ -2863,35 +2863,35 @@
 	      to attend to; if the chan or peer changed names,
 	      we have the before and after attached CDR's.
 	*/
-	
+
 	if (new_chan_cdr) {
 		struct ast_channel *chan_ptr = NULL;
- 
- 		if (strcasecmp(orig_channame, chan->name) != 0) { 
- 			/* old channel */
+
+		if (strcasecmp(orig_channame, chan->name) != 0) { 
+			/* old channel */
 			if ((chan_ptr == ast_channel_get_by_name(orig_channame))) {
 				ast_channel_lock(chan_ptr);
- 				if (!ast_bridged_channel(chan_ptr)) {
- 					struct ast_cdr *cur;
- 					for (cur = chan_ptr->cdr; cur; cur = cur->next) {
- 						if (cur == chan_cdr) {
- 							break;
- 						}
- 					}
- 					if (cur) {
- 						ast_cdr_specialized_reset(chan_cdr, 0);
+				if (!ast_bridged_channel(chan_ptr)) {
+					struct ast_cdr *cur;
+					for (cur = chan_ptr->cdr; cur; cur = cur->next) {
+						if (cur == chan_cdr) {
+							break;
+						}
 					}
- 				}
- 				ast_channel_unlock(chan_ptr);
+					if (cur) {
+						ast_cdr_specialized_reset(chan_cdr, 0);
+					}
+				}
+				ast_channel_unlock(chan_ptr);
 				chan_ptr = ast_channel_unref(chan_ptr);
- 			}
- 			/* new channel */
- 			ast_cdr_specialized_reset(new_chan_cdr, 0);
- 		} else {
- 			ast_cdr_specialized_reset(chan_cdr, 0); /* nothing changed, reset the chan_cdr  */
- 		}
-	}
-	
+			}
+			/* new channel */
+			ast_cdr_specialized_reset(new_chan_cdr, 0);
+		} else {
+			ast_cdr_specialized_reset(chan_cdr, 0); /* nothing changed, reset the chan_cdr  */
+		}
+	}
+
 	{
 		struct ast_channel *chan_ptr = NULL;
 		new_peer_cdr = pick_unlocked_cdr(peer->cdr); /* the proper chan cdr, if there are forked cdrs */
@@ -4556,7 +4556,7 @@
 	}
 
 	/* make sure we have a valid end point */
-	if (!(current_dest_chan = ast_channel_get_by_name_prefix(args.dest_chan, 
+	if (!(current_dest_chan = ast_channel_get_by_name_prefix(args.dest_chan,
 			strlen(args.dest_chan)))) {
 		ast_log(LOG_WARNING, "Bridge failed because channel %s does not exists or we "
 			"cannot get its lock\n", args.dest_chan);

Modified: team/russell/ast_channel_ao2/main/manager.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/main/manager.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/main/manager.c (original)
+++ team/russell/ast_channel_ao2/main/manager.c Fri Mar 20 09:44:00 2009
@@ -1912,15 +1912,15 @@
 		idText[0] = '\0';
 	}
 
- 	if (all) {
- 		if (!(iter = ast_channel_iterator_all_new(0))) {
- 			ast_free(str);
- 			astman_send_error(s, m, "Memory Allocation Failure");
- 			return 1;
- 		}
- 		c = ast_channel_iterator_next(iter);
- 	} else {
- 		if (!(c = ast_channel_get_by_name(name))) {
+	if (all) {
+		if (!(iter = ast_channel_iterator_all_new(0))) {
+			ast_free(str);
+			astman_send_error(s, m, "Memory Allocation Failure");
+			return 1;
+		}
+		c = ast_channel_iterator_next(iter);
+	} else {
+		if (!(c = ast_channel_get_by_name(name))) {
 			astman_send_error(s, m, "No such channel");
 			ast_free(str);
 			return 0;
@@ -2008,7 +2008,7 @@
 				S_OR(c->cid.cid_num, "<unknown>"),
 				S_OR(c->cid.cid_name, "<unknown>"),
 				c->accountcode,
-				ast_state2str(c->_state), bridge, c->uniqueid, 
+				ast_state2str(c->_state), bridge, c->uniqueid,
 				ast_str_buffer(str), idText);
 		}
 
@@ -2860,7 +2860,7 @@
 
 		ast_channel_lock(c);
 
- 		bc = ast_bridged_channel(c);
+		bc = ast_bridged_channel(c);
 		if (c->cdr && !ast_tvzero(c->cdr->start)) {
 			duration = (int)(ast_tvdiff_ms(ast_tvnow(), c->cdr->start) / 1000);
 			durh = duration / 3600;

Modified: team/russell/ast_channel_ao2/main/pbx.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/main/pbx.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/main/pbx.c (original)
+++ team/russell/ast_channel_ao2/main/pbx.c Fri Mar 20 09:44:00 2009
@@ -6232,7 +6232,7 @@
 	pbx_builtin_setvar_helper(chan, var_name, var_value);
 
 	chan = ast_channel_unref(chan);
-	
+
 	ast_cli(a->fd, "\n    -- Channel variable '%s' set to '%s' for '%s'\n",  var_name, var_value, chan_name);
 
 	return CLI_SUCCESS;

Modified: team/russell/ast_channel_ao2/res/res_monitor.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/res/res_monitor.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/res/res_monitor.c (original)
+++ team/russell/ast_channel_ao2/res/res_monitor.c Fri Mar 20 09:44:00 2009
@@ -698,7 +698,7 @@
 		astman_send_error(s, m, "Could not change monitored filename of channel");
 		return 0;
 	}
-	
+
 	ast_channel_unlock(c);
 	c = ast_channel_unref(c);
 

Modified: team/russell/ast_channel_ao2/res/snmp/agent.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/res/snmp/agent.c?view=diff&rev=183551&r1=183550&r2=183551
==============================================================================
--- team/russell/ast_channel_ao2/res/snmp/agent.c (original)
+++ team/russell/ast_channel_ao2/res/snmp/agent.c Fri Mar 20 09:44:00 2009
@@ -251,7 +251,7 @@
 		ast_channel_unref(chan);
 		i--;
 	}
-	
+
 	iter = ast_channel_iterator_destroy(iter);
 
 	if (chan == NULL) {




More information about the asterisk-commits mailing list