[asterisk-commits] kpfleming: branch 1.4 r82590 - in /branches/1.4: apps/ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 17 11:33:30 CDT 2007


Author: kpfleming
Date: Mon Sep 17 11:33:30 2007
New Revision: 82590

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82590
Log:
fix a couple of places where a logical member name (if specified) was not used, but instead the direct interface was listed

Modified:
    branches/1.4/apps/app_queue.c
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=82590&r1=82589&r2=82590
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Mon Sep 17 11:33:30 2007
@@ -3773,6 +3773,7 @@
 	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 @@
 				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 @@
 				} 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 @@
 				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;
 				}

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=82590&r1=82589&r2=82590
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Mon Sep 17 11:33:30 2007
@@ -5835,7 +5835,7 @@
 					if (p->expire > -1)
 						ast_sched_del(sched, p->expire);
 					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)
 						iax2_regfunk(p->name, 1);
 					register_peer_exten(p, 1);




More information about the asterisk-commits mailing list