[asterisk-commits] rmudgett: trunk r320013 - in /trunk: ./ apps/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 20 11:20:30 CDT 2011


Author: rmudgett
Date: Fri May 20 11:20:25 2011
New Revision: 320013

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320013
Log:
Merged revisions 320007 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r320007 | rmudgett | 2011-05-20 11:19:01 -0500 (Fri, 20 May 2011) | 2 lines
  
  Change some variable names to make pickup code easier to understand.
........

Modified:
    trunk/   (props changed)
    trunk/apps/app_directed_pickup.c
    trunk/main/features.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_directed_pickup.c?view=diff&rev=320013&r1=320012&r2=320013
==============================================================================
--- trunk/apps/app_directed_pickup.c (original)
+++ trunk/apps/app_directed_pickup.c Fri May 20 11:20:25 2011
@@ -117,15 +117,15 @@
 
 static int pickup_by_name_cb(void *obj, void *arg, void *data, int flags)
 {
-	struct ast_channel *chan = obj;
+	struct ast_channel *target = obj;/*!< Potential pickup target */
 	struct pickup_by_name_args *args = data;
 
-	ast_channel_lock(chan);
-	if (!strncasecmp(chan->name, args->name, args->len) && can_pickup(chan)) {
+	ast_channel_lock(target);
+	if (!strncasecmp(target->name, args->name, args->len) && can_pickup(target)) {
 		/* Return with the channel still locked on purpose */
 		return CMP_MATCH | CMP_STOP;
 	}
-	ast_channel_unlock(chan);
+	ast_channel_unlock(target);
 
 	return 0;
 }
@@ -162,7 +162,7 @@
 static int pickup_by_channel(struct ast_channel *chan, char *pickup)
 {
 	int res = -1;
-	struct ast_channel *target;
+	struct ast_channel *target;/*!< Potential pickup target */
 
 	target = my_ast_get_channel_by_name_locked(pickup);
 	if (target) {
@@ -180,7 +180,7 @@
 /* Attempt to pick up specified extension with context */
 static int pickup_by_exten(struct ast_channel *chan, const char *exten, const char *context)
 {
-	struct ast_channel *target = NULL;
+	struct ast_channel *target = NULL;/*!< Potential pickup target */
 	struct ast_channel_iterator *iter;
 	int res = -1;
 
@@ -211,17 +211,17 @@
 
 static int find_by_mark(void *obj, void *arg, void *data, int flags)
 {
-	struct ast_channel *c = obj;
+	struct ast_channel *target = obj;/*!< Potential pickup target */
 	const char *mark = data;
 	const char *tmp;
 
-	ast_channel_lock(c);
-	tmp = pbx_builtin_getvar_helper(c, PICKUPMARK);
-	if (tmp && !strcasecmp(tmp, mark) && can_pickup(c)) {
+	ast_channel_lock(target);
+	tmp = pbx_builtin_getvar_helper(target, PICKUPMARK);
+	if (tmp && !strcasecmp(tmp, mark) && can_pickup(target)) {
 		/* Return with the channel still locked on purpose */
 		return CMP_MATCH | CMP_STOP;
 	}
-	ast_channel_unlock(c);
+	ast_channel_unlock(target);
 
 	return 0;
 }
@@ -229,7 +229,7 @@
 /* Attempt to pick up specified mark */
 static int pickup_by_mark(struct ast_channel *chan, const char *mark)
 {
-	struct ast_channel *target;
+	struct ast_channel *target;/*!< Potential pickup target */
 	int res = -1;
 
 	/* The found channel is already locked. */
@@ -245,22 +245,22 @@
 
 static int find_channel_by_group(void *obj, void *arg, void *data, int flags)
 {
-	struct ast_channel *chan = obj;
-	struct ast_channel *c = data;
-
-	ast_channel_lock(chan);
-	if (c != chan && (c->pickupgroup & chan->callgroup) && can_pickup(chan)) {
+	struct ast_channel *target = obj;/*!< Potential pickup target */
+	struct ast_channel *chan = data;/*!< Channel wanting to pickup call */
+
+	ast_channel_lock(target);
+	if (chan != target && (chan->pickupgroup & target->callgroup) && can_pickup(target)) {
 		/* Return with the channel still locked on purpose */
 		return CMP_MATCH | CMP_STOP;
 	}
-	ast_channel_unlock(chan);
+	ast_channel_unlock(target);
 
 	return 0;
 }
 
 static int pickup_by_group(struct ast_channel *chan)
 {
-	struct ast_channel *target;
+	struct ast_channel *target;/*!< Potential pickup target */
 	int res = -1;
 
 	/* The found channel is already locked. */
@@ -310,16 +310,17 @@
 /* Find channel for pick up specified by partial channel name */ 
 static int find_by_part(void *obj, void *arg, void *data, int flags)
 {
-	struct ast_channel *c = obj; 
+	struct ast_channel *target = obj;/*!< Potential pickup target */
 	const char *part = data;
 	int len = strlen(part);
 
-	ast_channel_lock(c);
-	if (len <= strlen(c->name) && !strncmp(c->name, part, len) && can_pickup(c)) {
+	ast_channel_lock(target);
+	if (len <= strlen(target->name) && !strncmp(target->name, part, len)
+		&& can_pickup(target)) {
 		/* Return with the channel still locked on purpose */
 		return CMP_MATCH | CMP_STOP;
 	}
-	ast_channel_unlock(c);
+	ast_channel_unlock(target);
 
 	return 0;
 }
@@ -327,7 +328,7 @@
 /* Attempt to pick up specified by partial channel name */ 
 static int pickup_by_part(struct ast_channel *chan, const char *part)
 {
-	struct ast_channel *target;
+	struct ast_channel *target;/*!< Potential pickup target */
 	int res = -1;
 
 	/* The found channel is already locked. */

Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=320013&r1=320012&r2=320013
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Fri May 20 11:20:25 2011
@@ -5759,19 +5759,19 @@
 
 static int find_channel_by_group(void *obj, void *arg, void *data, int flags)
 {
-	struct ast_channel *chan = obj;
-	struct ast_channel *c = data;
-
-	ast_channel_lock(chan);
-	if (c != chan && (c->pickupgroup & chan->callgroup) &&
-		!chan->pbx &&
-		((chan->_state == AST_STATE_RINGING) || (chan->_state == AST_STATE_RING)) &&
-		!chan->masq &&
-		!ast_test_flag(chan, AST_FLAG_ZOMBIE)) {
+	struct ast_channel *target = obj;/*!< Potential pickup target */
+	struct ast_channel *chan = data;/*!< Channel wanting to pickup call */
+
+	ast_channel_lock(target);
+	if (chan != target && (chan->pickupgroup & target->callgroup) &&
+		!target->pbx &&
+		((target->_state == AST_STATE_RINGING) || (target->_state == AST_STATE_RING)) &&
+		!target->masq &&
+		!ast_test_flag(target, AST_FLAG_ZOMBIE)) {
 		/* Return with the channel still locked on purpose */
 		return CMP_MATCH | CMP_STOP;
 	}
-	ast_channel_unlock(chan);
+	ast_channel_unlock(target);
 
 	return 0;
 }
@@ -5786,7 +5786,7 @@
  */
 int ast_pickup_call(struct ast_channel *chan)
 {
-	struct ast_channel *target;
+	struct ast_channel *target;/*!< Potential pickup target */
 	int res = -1;
 	ast_debug(1, "pickup attempt by %s\n", chan->name);
 




More information about the asterisk-commits mailing list