summaryrefslogtreecommitdiff
path: root/channel.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-07-28 23:36:06 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-07-28 23:36:06 +0000
commit4bc6613648c863e6dab86cbc6b902ee5d44fbfac (patch)
tree6a03ba2a438a96f11af09b7196a9e89010ab4af6 /channel.c
parent99f9d827c1a7e339eafec12325c32daecd0b8c45 (diff)
add ExtenSpy variant of ChanSpy
implement whisper mode for ExtenSpy/ChanSpy git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/channel.c b/channel.c
index 965f87c77..dce6d0a40 100644
--- a/channel.c
+++ b/channel.c
@@ -858,16 +858,17 @@ static struct ast_channel *channel_find_locked(const struct ast_channel *prev,
continue;
/* found, prepare to return c->next */
c = AST_LIST_NEXT(c, chan_list);
- } else if (name) { /* want match by name */
- if ( (!namelen && strcasecmp(c->name, name)) ||
- (namelen && strncasecmp(c->name, name, namelen)) )
+ }
+ if (name) { /* want match by name */
+ if ((!namelen && strcasecmp(c->name, name)) ||
+ (namelen && strncasecmp(c->name, name, namelen)))
continue; /* name match failed */
} else if (exten) {
if (context && strcasecmp(c->context, context) &&
- strcasecmp(c->macrocontext, context))
+ strcasecmp(c->macrocontext, context))
continue; /* context match failed */
if (strcasecmp(c->exten, exten) &&
- strcasecmp(c->macroexten, exten))
+ strcasecmp(c->macroexten, exten))
continue; /* exten match failed */
}
/* if we get here, c points to the desired record */
@@ -924,6 +925,13 @@ struct ast_channel *ast_get_channel_by_exten_locked(const char *exten, const cha
return channel_find_locked(NULL, NULL, 0, context, exten);
}
+/*! \brief Get next channel by exten (and optionally context) and lock it */
+struct ast_channel *ast_walk_channel_by_exten_locked(const struct ast_channel *chan, const char *exten,
+ const char *context)
+{
+ return channel_find_locked(chan, NULL, 0, context, exten);
+}
+
/*! \brief Wait, look for hangups and condition arg */
int ast_safe_sleep_conditional(struct ast_channel *chan, int ms, int (*cond)(void*), void *data)
{