aboutsummaryrefslogtreecommitdiffstats
path: root/main/cli.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-21 21:08:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-21 21:08:47 +0000
commit4f428997ca5d8e9ee1023c09cd4109e0823817b4 (patch)
treefc090fae29428e50ebaebee71709d20ea2681aee /main/cli.c
parent02992ab88835322a8f97bd9f26ddde84c43e91d3 (diff)
Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the case where multiple results need to be returned; OBJ_NODATA mode already was supported). In addition, it converts ast_channel_iterators (only the targeted versions, not the ones that iterate over all channels) to use this method. During this work, I removed the 'ao2_flags' arguments to the ast_channel_iterator constructor functions; there were no uses of that argument yet, there is only one possible flag to pass, and it made the iterators less 'opaque'. If at some point in the future someone really needs an ast_channel_iterator that does not lock the container, we can provide constructor(s) for that purpose. Review: https://reviewboard.asterisk.org/r/379/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225244 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/cli.c b/main/cli.c
index 5b31bba2b..abfc8f0a9 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -827,7 +827,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
"CallerID", "Duration", "Accountcode", "PeerAccount", "BridgedTo");
}
- if (!count && !(iter = ast_channel_iterator_all_new(0))) {
+ if (!count && !(iter = ast_channel_iterator_all_new())) {
return CLI_FAILURE;
}
@@ -1454,7 +1454,7 @@ char *ast_complete_channels(const char *line, const char *word, int pos, int sta
return NULL;
}
- if (!(iter = ast_channel_iterator_by_name_new(0, word, strlen(word)))) {
+ if (!(iter = ast_channel_iterator_by_name_new(word, strlen(word)))) {
return NULL;
}
@@ -1467,6 +1467,8 @@ char *ast_complete_channels(const char *line, const char *word, int pos, int sta
ast_channel_unref(c);
}
+ ast_channel_iterator_destroy(iter);
+
return ret == &notfound ? NULL : ret;
}