aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-17 16:33:30 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-17 16:33:30 +0000
commitf0c69768ebfe74a90b40aad9a4841387804e43aa (patch)
tree9f75d23a6707fa39645c3006596557c66caad353 /apps
parent3aee3bbab972426eb71e386560faf541a6dd8cf7 (diff)
fix a couple of places where a logical member name (if specified) was not used, but instead the direct interface was listed
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82590 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 3792e3526..7fa030f33 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3773,6 +3773,7 @@ static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, c
if (q) {
int buflen = 0, count = 0;
struct ao2_iterator mem_iter = ao2_iterator_init(q->members, 0);
+ const char *name_to_list;
while ((m = ao2_iterator_next(&mem_iter))) {
/* strcat() is always faster than printf() */
@@ -3780,8 +3781,9 @@ static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, c
strncat(buf + buflen, ",", len - buflen - 1);
buflen++;
}
- strncat(buf + buflen, m->interface, len - buflen - 1);
- buflen += strlen(m->interface);
+ name_to_list = ast_strlen_zero(m->membername) ? m->interface : m->membername;
+ strncat(buf + buflen, name_to_list, len - buflen - 1);
+ buflen += strlen(name_to_list);
/* Safeguard against overflow (negative length) */
if (buflen >= len - 2) {
ao2_ref(m, -1);
@@ -4111,9 +4113,13 @@ static int __queues_show(struct mansession *s, int manager, int fd, int argc, ch
} else
ast_build_string(&max, &max_left, " has taken no calls yet");
if (s)
- astman_append(s, " %s%s%s", mem->interface, max_buf, term);
+ astman_append(s, " %s%s%s",
+ ast_strlen_zero(mem->membername) ? mem->interface : mem->membername,
+ max_buf, term);
else
- ast_cli(fd, " %s%s%s", mem->interface, max_buf, term);
+ ast_cli(fd, " %s%s%s",
+ ast_strlen_zero(mem->membername) ? mem->interface : mem->membername,
+ max_buf, term);
ao2_ref(mem, -1);
}
} else if (s)
@@ -4541,7 +4547,7 @@ static char *complete_queue_remove_member(const char *line, const char *word, in
if (++which > state) {
char *tmp;
ast_mutex_unlock(&q->lock);
- tmp = ast_strdup(m->interface);
+ tmp = ast_strdup((ast_strlen_zero(m->membername) ? m->interface : m->membername));
ao2_ref(m, -1);
return tmp;
}