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: https://origsvn.digium.com/svn/asterisk/trunk@225244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2009-10-21 21:08:47 +00:00
parent 1ebf7767d0
commit cdd1f9e296
12 changed files with 184 additions and 198 deletions

View File

@@ -786,11 +786,11 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
/* Set up the iterator we'll be using during this call */
if (!ast_strlen_zero(spec)) {
iter = ast_channel_iterator_by_name_new(0, spec, strlen(spec));
iter = ast_channel_iterator_by_name_new(spec, strlen(spec));
} else if (!ast_strlen_zero(exten)) {
iter = ast_channel_iterator_by_exten_new(0, exten, context);
iter = ast_channel_iterator_by_exten_new(exten, context);
} else {
iter = ast_channel_iterator_all_new(0);
iter = ast_channel_iterator_all_new();
}
if (!iter) {