diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-09 01:59:59 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-09 01:59:59 +0000 |
commit | 2034723f38d4ae9c8eb29f45c5611e834ff6cfa9 (patch) | |
tree | 5e7ff2cd6ece5b2ac5438a59b2737c5705b928cc /main/channel.c | |
parent | 70ff546e20c930fe8c28001a7cef10d8ee569896 (diff) |
In order to move away from nested function use, some changes to the recently introduced
ast_channel_search_locked need to be made. Specifically, the caller needs to be able to
pass arbitrary data which in turn is passed to the callback. This patch addresses all
of the nested functions currently in asterisk trunk.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@155590 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c index ec253ae04..b5a4054a4 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1227,14 +1227,14 @@ struct ast_channel *ast_walk_channel_by_exten_locked(const struct ast_channel *c } /*! \brief Search for a channel based on the passed channel matching callback (first match) and return it, locked */ -struct ast_channel *ast_channel_search_locked(int (*is_match)(struct ast_channel *)) +struct ast_channel *ast_channel_search_locked(int (*is_match)(struct ast_channel *, void *), void *data) { struct ast_channel *c = NULL; AST_RWLIST_RDLOCK(&channels); AST_RWLIST_TRAVERSE(&channels, c, chan_list) { ast_channel_lock(c); - if (is_match(c)) { + if (is_match(c, data)) { break; } ast_channel_unlock(c); |