[asterisk-commits] russell: branch russell/chan_refcount r100237 - in /team/russell/chan_refcoun...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 24 13:15:03 CST 2008
Author: russell
Date: Thu Jan 24 13:15:02 2008
New Revision: 100237
URL: http://svn.digium.com/view/asterisk?view=rev&rev=100237
Log:
Add astobj2 iterator flags as an argument to the channel iterator creation functions
(Thanks to Mark M. for the suggestion)
Modified:
team/russell/chan_refcount/apps/app_chanspy.c
team/russell/chan_refcount/apps/app_directed_pickup.c
team/russell/chan_refcount/apps/app_pickupchan.c
team/russell/chan_refcount/apps/app_softhangup.c
team/russell/chan_refcount/apps/app_zapscan.c
team/russell/chan_refcount/include/asterisk/channel.h
team/russell/chan_refcount/main/channel.c
team/russell/chan_refcount/main/cli.c
team/russell/chan_refcount/main/features.c
team/russell/chan_refcount/main/manager.c
Change Statistics:
0 files changed
Modified: team/russell/chan_refcount/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_chanspy.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/apps/app_chanspy.c (original)
+++ team/russell/chan_refcount/apps/app_chanspy.c Thu Jan 24 13:15:02 2008
@@ -448,11 +448,11 @@
num_spyed_upon = 0;
if (spec)
- iter = ast_channel_iterator_by_name_new(spec, strlen(spec));
+ iter = ast_channel_iterator_by_name_new(0, spec, strlen(spec));
else if (exten)
- iter = ast_channel_iterator_by_exten_new(exten, context);
+ iter = ast_channel_iterator_by_exten_new(0, exten, context);
else
- iter = ast_channel_iterator_all_new();
+ iter = ast_channel_iterator_all_new(0);
if (!iter)
goto exit;
Modified: team/russell/chan_refcount/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_directed_pickup.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/apps/app_directed_pickup.c (original)
+++ team/russell/chan_refcount/apps/app_directed_pickup.c Thu Jan 24 13:15:02 2008
@@ -92,7 +92,7 @@
struct ast_channel *target = NULL;
struct ast_channel_iterator *iter;
- if (!(iter = ast_channel_iterator_all_new()))
+ if (!(iter = ast_channel_iterator_all_new(0)))
return -1;
while ((target = ast_channel_iterator_next(iter))) {
@@ -122,7 +122,7 @@
struct ast_channel *target = NULL;
struct ast_channel_iterator *iter;
- if (!(iter = ast_channel_iterator_all_new()))
+ if (!(iter = ast_channel_iterator_all_new(0)))
return -1;
while ((target = ast_channel_iterator_next(iter))) {
Modified: team/russell/chan_refcount/apps/app_pickupchan.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_pickupchan.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/apps/app_pickupchan.c (original)
+++ team/russell/chan_refcount/apps/app_pickupchan.c Thu Jan 24 13:15:02 2008
@@ -74,7 +74,7 @@
strcpy(chkchan, channame);
strcat(chkchan, "-");
- iter = ast_channel_iterator_by_name_new(channame, strlen(channame));
+ iter = ast_channel_iterator_by_name_new(0, channame, strlen(channame));
while ((chan = ast_channel_iterator_next(iter))) {
if (!strncasecmp(chan->name, chkchan, strlen(chkchan)) && can_pickup(chan))
break;
Modified: team/russell/chan_refcount/apps/app_softhangup.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_softhangup.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/apps/app_softhangup.c (original)
+++ team/russell/chan_refcount/apps/app_softhangup.c Thu Jan 24 13:15:02 2008
@@ -77,7 +77,7 @@
if (args.argc == 2)
ast_app_parse_options(app_opts, &flags, opts, args.options);
- if (!(iter = ast_channel_iterator_by_name_new(args.channel, strlen(args.channel))))
+ if (!(iter = ast_channel_iterator_by_name_new(0, args.channel, strlen(args.channel))))
return -1;
ast_autoservice_start(chan);
Modified: team/russell/chan_refcount/apps/app_zapscan.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_zapscan.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/apps/app_zapscan.c (original)
+++ team/russell/chan_refcount/apps/app_zapscan.c Thu Jan 24 13:15:02 2008
@@ -299,7 +299,7 @@
search_group = 1;
}
- iter = ast_channel_iterator_all_new();
+ iter = ast_channel_iterator_all_new(0);
if (!iter)
return -1;
Modified: team/russell/chan_refcount/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/include/asterisk/channel.h?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/include/asterisk/channel.h (original)
+++ team/russell/chan_refcount/include/asterisk/channel.h Thu Jan 24 13:15:02 2008
@@ -1671,6 +1671,7 @@
/*!
* \brief Create a new channel iterator based on extension
*
+ * \arg ao2_flags astobj2 iterator flags
* \arg exten The extension that channels must be in
* \arg context The context that channels must be in (optional)
*
@@ -1681,12 +1682,13 @@
* \retval NULL on failure
* \retval a new channel iterator based on the specified parameters
*/
-struct ast_channel_iterator *ast_channel_iterator_by_exten_new(const char *exten,
+struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, const char *exten,
const char *context);
/*!
* \brief Create a new channel iterator based on name
*
+ * \arg ao2_flags astobj2 iterator flags
* \arg name channel name or channel uniqueid to match
* \arg name_len number of characters in the channel name to match on. This
* would be used to match based on name prefix. If matching on the full
@@ -1699,11 +1701,13 @@
* \retval NULL on failure
* \retval a new channel iterator based on the specified parameters
*/
-struct ast_channel_iterator *ast_channel_iterator_by_name_new(const char *name,
+struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, const char *name,
size_t name_len);
/*!
* \brief Create a new channel iterator
+ *
+ * \arg ao2_flags astobj2 iterator flags
*
* After creating an iterator using this function, the ast_channel_iterator_next()
* function can be used to iterate through all channels that exist.
@@ -1711,7 +1715,7 @@
* \retval NULL on failure
* \retval a new channel iterator
*/
-struct ast_channel_iterator *ast_channel_iterator_all_new(void);
+struct ast_channel_iterator *ast_channel_iterator_all_new(int ao2_flags);
/*!
* \brief Get the next channel for a channel iterator
Modified: team/russell/chan_refcount/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/main/channel.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/main/channel.c (original)
+++ team/russell/chan_refcount/main/channel.c Thu Jan 24 13:15:02 2008
@@ -1033,7 +1033,7 @@
return NULL;
}
-static struct ast_channel_iterator *ast_channel_iterator_new(const char *name,
+static struct ast_channel_iterator *ast_channel_iterator_new(int ao2_flags, const char *name,
size_t name_len, const char *exten, const char *context)
{
struct ast_channel_iterator *i;
@@ -1052,7 +1052,7 @@
i->name_len = name_len;
- i->i = ao2_iterator_init(channels, 0);
+ i->i = ao2_iterator_init(channels, ao2_flags);
return i;
@@ -1066,21 +1066,21 @@
return NULL;
}
-struct ast_channel_iterator *ast_channel_iterator_by_exten_new(const char *exten,
+struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, const char *exten,
const char *context)
{
- return ast_channel_iterator_new(NULL, 0, exten, context);
-}
-
-struct ast_channel_iterator *ast_channel_iterator_by_name_new(const char *name,
+ return ast_channel_iterator_new(ao2_flags, NULL, 0, exten, context);
+}
+
+struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, const char *name,
size_t name_len)
{
- return ast_channel_iterator_new(name, name_len, NULL, NULL);
-}
-
-struct ast_channel_iterator *ast_channel_iterator_all_new(void)
-{
- return ast_channel_iterator_new(NULL, 0, NULL, NULL);
+ return ast_channel_iterator_new(ao2_flags, name, name_len, NULL, NULL);
+}
+
+struct ast_channel_iterator *ast_channel_iterator_all_new(int ao2_flags)
+{
+ return ast_channel_iterator_new(ao2_flags, NULL, 0, NULL, NULL);
}
struct ast_channel *ast_channel_iterator_next(struct ast_channel_iterator *i)
Modified: team/russell/chan_refcount/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/main/cli.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/main/cli.c (original)
+++ team/russell/chan_refcount/main/cli.c Thu Jan 24 13:15:02 2008
@@ -684,7 +684,7 @@
"CallerID", "Duration", "Accountcode", "BridgedTo");
}
- if (!(iter = ast_channel_iterator_all_new()))
+ if (!(iter = ast_channel_iterator_all_new(0)))
return CLI_FAILURE;
while ((c = ast_channel_iterator_next(iter))) {
@@ -943,7 +943,7 @@
global_fin |= DEBUGCHAN_FLAG;
global_fout |= DEBUGCHAN_FLAG;
}
- iter = ast_channel_iterator_all_new();
+ iter = ast_channel_iterator_all_new(0);
if (iter)
c = ast_channel_iterator_next(iter);
} else {
Modified: team/russell/chan_refcount/main/features.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/main/features.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/main/features.c (original)
+++ team/russell/chan_refcount/main/features.c Thu Jan 24 13:15:02 2008
@@ -3248,7 +3248,7 @@
int res = -1;
struct ast_channel_iterator *iter;
- if (!(iter = ast_channel_iterator_all_new()))
+ if (!(iter = ast_channel_iterator_all_new(0)))
return -1;
while ((cur = ast_channel_iterator_next(iter))) {
Modified: team/russell/chan_refcount/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/main/manager.c?view=diff&rev=100237&r1=100236&r2=100237
==============================================================================
--- team/russell/chan_refcount/main/manager.c (original)
+++ team/russell/chan_refcount/main/manager.c Thu Jan 24 13:15:02 2008
@@ -1599,7 +1599,7 @@
snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
if (all) {
- iter = ast_channel_iterator_all_new();
+ iter = ast_channel_iterator_all_new(0);
if (iter)
c = ast_channel_iterator_next(iter);
} else {
@@ -2354,7 +2354,7 @@
astman_send_listack(s, m, "Channels will follow", "start");
- iter = ast_channel_iterator_all_new();
+ iter = ast_channel_iterator_all_new(0);
while ((c = ast_channel_iterator_next(iter))) {
struct ast_channel *bc;
More information about the asterisk-commits
mailing list