mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@82590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3773,6 +3773,7 @@ static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, c
|
|||||||
if (q) {
|
if (q) {
|
||||||
int buflen = 0, count = 0;
|
int buflen = 0, count = 0;
|
||||||
struct ao2_iterator mem_iter = ao2_iterator_init(q->members, 0);
|
struct ao2_iterator mem_iter = ao2_iterator_init(q->members, 0);
|
||||||
|
const char *name_to_list;
|
||||||
|
|
||||||
while ((m = ao2_iterator_next(&mem_iter))) {
|
while ((m = ao2_iterator_next(&mem_iter))) {
|
||||||
/* strcat() is always faster than printf() */
|
/* 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);
|
strncat(buf + buflen, ",", len - buflen - 1);
|
||||||
buflen++;
|
buflen++;
|
||||||
}
|
}
|
||||||
strncat(buf + buflen, m->interface, len - buflen - 1);
|
name_to_list = ast_strlen_zero(m->membername) ? m->interface : m->membername;
|
||||||
buflen += strlen(m->interface);
|
strncat(buf + buflen, name_to_list, len - buflen - 1);
|
||||||
|
buflen += strlen(name_to_list);
|
||||||
/* Safeguard against overflow (negative length) */
|
/* Safeguard against overflow (negative length) */
|
||||||
if (buflen >= len - 2) {
|
if (buflen >= len - 2) {
|
||||||
ao2_ref(m, -1);
|
ao2_ref(m, -1);
|
||||||
@@ -4111,9 +4113,13 @@ static int __queues_show(struct mansession *s, int manager, int fd, int argc, ch
|
|||||||
} else
|
} else
|
||||||
ast_build_string(&max, &max_left, " has taken no calls yet");
|
ast_build_string(&max, &max_left, " has taken no calls yet");
|
||||||
if (s)
|
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
|
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);
|
ao2_ref(mem, -1);
|
||||||
}
|
}
|
||||||
} else if (s)
|
} else if (s)
|
||||||
@@ -4541,7 +4547,7 @@ static char *complete_queue_remove_member(const char *line, const char *word, in
|
|||||||
if (++which > state) {
|
if (++which > state) {
|
||||||
char *tmp;
|
char *tmp;
|
||||||
ast_mutex_unlock(&q->lock);
|
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);
|
ao2_ref(m, -1);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
@@ -5835,7 +5835,7 @@ static void reg_source_db(struct iax2_peer *p)
|
|||||||
if (p->expire > -1)
|
if (p->expire > -1)
|
||||||
ast_sched_del(sched, p->expire);
|
ast_sched_del(sched, p->expire);
|
||||||
ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
|
ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
|
||||||
p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, (void *)p->name);
|
p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, (void *)(char *)p->name);
|
||||||
if (iax2_regfunk)
|
if (iax2_regfunk)
|
||||||
iax2_regfunk(p->name, 1);
|
iax2_regfunk(p->name, 1);
|
||||||
register_peer_exten(p, 1);
|
register_peer_exten(p, 1);
|
||||||
|
Reference in New Issue
Block a user