[asterisk-commits] rmudgett: branch 1.8 r320007 - in /branches/1.8: apps/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri May 20 11:19:08 CDT 2011
Author: rmudgett
Date: Fri May 20 11:19:01 2011
New Revision: 320007
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320007
Log:
Change some variable names to make pickup code easier to understand.
Modified:
branches/1.8/apps/app_directed_pickup.c
branches/1.8/main/features.c
Modified: branches/1.8/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_directed_pickup.c?view=diff&rev=320007&r1=320006&r2=320007
==============================================================================
--- branches/1.8/apps/app_directed_pickup.c (original)
+++ branches/1.8/apps/app_directed_pickup.c Fri May 20 11:19:01 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: branches/1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/features.c?view=diff&rev=320007&r1=320006&r2=320007
==============================================================================
--- branches/1.8/main/features.c (original)
+++ branches/1.8/main/features.c Fri May 20 11:19:01 2011
@@ -5703,19 +5703,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;
}
@@ -5730,7 +5730,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