confbridge: Rename i iterator variables to iter.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
changes/78/78/1
Richard Mudgett 12 years ago
parent 2ebb9863ea
commit 041f958e38

@ -2157,10 +2157,10 @@ static char *complete_confbridge_name(const char *line, const char *word, int po
struct conference_bridge *bridge = NULL; struct conference_bridge *bridge = NULL;
char *res = NULL; char *res = NULL;
int wordlen = strlen(word); int wordlen = strlen(word);
struct ao2_iterator i; struct ao2_iterator iter;
i = ao2_iterator_init(conference_bridges, 0); iter = ao2_iterator_init(conference_bridges, 0);
while ((bridge = ao2_iterator_next(&i))) { while ((bridge = ao2_iterator_next(&iter))) {
if (!strncasecmp(bridge->name, word, wordlen) && ++which > state) { if (!strncasecmp(bridge->name, word, wordlen) && ++which > state) {
res = ast_strdup(bridge->name); res = ast_strdup(bridge->name);
ao2_ref(bridge, -1); ao2_ref(bridge, -1);
@ -2168,7 +2168,7 @@ static char *complete_confbridge_name(const char *line, const char *word, int po
} }
ao2_ref(bridge, -1); ao2_ref(bridge, -1);
} }
ao2_iterator_destroy(&i); ao2_iterator_destroy(&iter);
return res; return res;
} }
@ -2236,10 +2236,7 @@ static void handle_cli_confbridge_list_item(struct ast_cli_args *a, struct confe
static char *handle_cli_confbridge_list(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) static char *handle_cli_confbridge_list(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{ {
struct ao2_iterator i; struct conference_bridge *bridge;
struct conference_bridge *bridge = NULL;
struct conference_bridge tmp;
struct conference_bridge_user *participant = NULL;
switch (cmd) { switch (cmd) {
case CLI_INIT: case CLI_INIT:
@ -2256,18 +2253,23 @@ static char *handle_cli_confbridge_list(struct ast_cli_entry *e, int cmd, struct
} }
if (a->argc == 2) { if (a->argc == 2) {
struct ao2_iterator iter;
ast_cli(a->fd, "Conference Bridge Name Users Marked Locked?\n"); ast_cli(a->fd, "Conference Bridge Name Users Marked Locked?\n");
ast_cli(a->fd, "================================ ====== ====== ========\n"); ast_cli(a->fd, "================================ ====== ====== ========\n");
i = ao2_iterator_init(conference_bridges, 0); iter = ao2_iterator_init(conference_bridges, 0);
while ((bridge = ao2_iterator_next(&i))) { while ((bridge = ao2_iterator_next(&iter))) {
ast_cli(a->fd, "%-32s %6i %6i %s\n", bridge->name, bridge->activeusers + bridge->waitingusers, bridge->markedusers, (bridge->locked ? "locked" : "unlocked")); ast_cli(a->fd, "%-32s %6i %6i %s\n", bridge->name, bridge->activeusers + bridge->waitingusers, bridge->markedusers, (bridge->locked ? "locked" : "unlocked"));
ao2_ref(bridge, -1); ao2_ref(bridge, -1);
} }
ao2_iterator_destroy(&i); ao2_iterator_destroy(&iter);
return CLI_SUCCESS; return CLI_SUCCESS;
} }
if (a->argc == 3) { if (a->argc == 3) {
struct conference_bridge_user *participant;
struct conference_bridge tmp;
ast_copy_string(tmp.name, a->argv[2], sizeof(tmp.name)); ast_copy_string(tmp.name, a->argv[2], sizeof(tmp.name));
bridge = ao2_find(conference_bridges, &tmp, OBJ_POINTER); bridge = ao2_find(conference_bridges, &tmp, OBJ_POINTER);
if (!bridge) { if (!bridge) {
@ -2657,7 +2659,7 @@ static int action_confbridgelistrooms(struct mansession *s, const struct message
{ {
const char *actionid = astman_get_header(m, "ActionID"); const char *actionid = astman_get_header(m, "ActionID");
struct conference_bridge *bridge = NULL; struct conference_bridge *bridge = NULL;
struct ao2_iterator i; struct ao2_iterator iter;
char id_text[512] = ""; char id_text[512] = "";
int totalitems = 0; int totalitems = 0;
@ -2673,8 +2675,8 @@ static int action_confbridgelistrooms(struct mansession *s, const struct message
astman_send_listack(s, m, "Confbridge conferences will follow", "start"); astman_send_listack(s, m, "Confbridge conferences will follow", "start");
/* Traverse the conference list */ /* Traverse the conference list */
i = ao2_iterator_init(conference_bridges, 0); iter = ao2_iterator_init(conference_bridges, 0);
while ((bridge = ao2_iterator_next(&i))) { while ((bridge = ao2_iterator_next(&iter))) {
totalitems++; totalitems++;
ao2_lock(bridge); ao2_lock(bridge);
@ -2695,7 +2697,7 @@ static int action_confbridgelistrooms(struct mansession *s, const struct message
ao2_ref(bridge, -1); ao2_ref(bridge, -1);
} }
ao2_iterator_destroy(&i); ao2_iterator_destroy(&iter);
/* Send final confirmation */ /* Send final confirmation */
astman_append(s, astman_append(s,

Loading…
Cancel
Save