[asterisk-commits] bweschke: branch 1.2 r43897 - /branches/1.2/apps/app_queue.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Sep 28 09:37:15 MST 2006


Author: bweschke
Date: Thu Sep 28 11:37:15 2006
New Revision: 43897

URL: http://svn.digium.com/view/asterisk?rev=43897&view=rev
Log:
 app_queue is comparing the device names incorrectly while checking their statuses. It's internal list of interfaces includes the dial string, while the argument passed to this function does not have the dial string (/n for a local channel). This causes it to ignore the device state changes because it thinks it belongs to none of its members. (#8040 reported and patch by tim_ringenbach)


Modified:
    branches/1.2/apps/app_queue.c

Modified: branches/1.2/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_queue.c?rev=43897&r1=43896&r2=43897&view=diff
==============================================================================
--- branches/1.2/apps/app_queue.c (original)
+++ branches/1.2/apps/app_queue.c Thu Sep 28 11:37:15 2006
@@ -483,7 +483,14 @@
 
 	AST_LIST_LOCK(&interfaces);
 	AST_LIST_TRAVERSE(&interfaces, curint, list) {
-		if (!strcasecmp(curint->interface, sc->dev))
+		char *interface;
+		char *slash_pos;
+		interface = ast_strdupa(curint->interface);
+		if ((slash_pos = strchr(interface, '/')))
+			if ((slash_pos = strchr(slash_pos + 1, '/')))
+				*slash_pos = '\0';
+
+		if (!strcasecmp(interface, sc->dev))
 			break;
 	}
 	AST_LIST_UNLOCK(&interfaces);
@@ -501,7 +508,14 @@
 	for (q = queues; q; q = q->next) {
 		ast_mutex_lock(&q->lock);
 		for (cur = q->members; cur; cur = cur->next) {
-			if (strcasecmp(sc->dev, cur->interface))
+			char *interface;
+			char *slash_pos;
+			interface = ast_strdupa(cur->interface);
+			if ((slash_pos = strchr(interface, '/')))
+				if ((slash_pos = strchr(slash_pos + 1, '/')))
+					*slash_pos = '\0';
+
+			if (strcasecmp(sc->dev, interface))
 				continue;
 
 			if (cur->status != sc->state) {



More information about the asterisk-commits mailing list