diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-28 23:36:06 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-28 23:36:06 +0000 |
commit | 051ef64e46e2d8e501a6918d5e13daa51805ce7b (patch) | |
tree | 6a03ba2a438a96f11af09b7196a9e89010ab4af6 /channel.c | |
parent | 071cba7f50d095ee69f8d1c052824b2333c761ac (diff) |
add ExtenSpy variant of ChanSpy
implement whisper mode for ExtenSpy/ChanSpy
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38465 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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) { |