[svn-commits] oej: branch group/multiparking r104057 - /team/group/multiparking/main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Feb 23 10:49:15 CST 2008


Author: oej
Date: Sat Feb 23 10:49:14 2008
New Revision: 104057

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104057
Log:
Fix cli command too

Modified:
    team/group/multiparking/main/features.c

Modified: team/group/multiparking/main/features.c
URL: http://svn.digium.com/view/asterisk/team/group/multiparking/main/features.c?view=diff&rev=104057&r1=104056&r2=104057
==============================================================================
--- team/group/multiparking/main/features.c (original)
+++ team/group/multiparking/main/features.c Sat Feb 23 10:49:14 2008
@@ -3372,16 +3372,31 @@
 	ast_cli(a->fd, "%4s %25s (%-15s %-12s %-4s) %-6s \n", "Num", "Channel"
 		, "Context", "Extension", "Pri", "Timeout");
 
-	AST_LIST_LOCK(&parkings);
-	AST_LIST_TRAVERSE(&parkings, cur, list) {
-		ast_cli(a->fd, "%-10.10s %25s (%-15s %-12s %-4d) %6lds\n"
-			,cur->parkingexten, cur->chan->name, cur->context, cur->exten
-			,cur->priority, cur->start.tv_sec + (cur->parkingtime/1000) - time(NULL));
-
-		numparked++;
-	}
-	AST_LIST_UNLOCK(&parkings);
-	ast_cli(a->fd, "%d parked call%s.\n", numparked, ESS(numparked));
+	ASTOBJ_CONTAINER_TRAVERSE(&parkinglots, 1, do {
+		int lotparked = 0;
+		ASTOBJ_RDLOCK(iterator);
+		cur = iterator->occupiedlots;
+		if (cur) {
+			ast_cli(fd, "*** Parking lot: %s\n", iterator->name);
+	
+			AST_LIST_LOCK(&iterator->parkings);
+			AST_LIST_TRAVERSE(&iterator->parkings, cur, list) {
+				ast_cli(a->fd, "%-10.10s %25s (%-15s %-12s %-4d) %6lds\n"
+					,cur->parkingexten, cur->chan->name, cur->context, cur->exten
+					,cur->priority, cur->start.tv_sec + (cur->parkingtime/1000) - time(NULL));
+				numparked++;
+				numparked += lotparked;
+			}
+			AST_LIST_UNLOCK(&iterator->parkings);
+		}
+		if (lotparked)
+			ast_cli(fd, "   %d parked call%s in parking lot %s\n", lotparked, ESS(lotparked), iterator->name);
+
+		ASTOBJ_UNLOCK(iterator);
+	} while (0) );
+	ast_cli(fd, "---\n%d parked call%s in total.\n", numparked, ESS(numparked));
+	ast_mutex_unlock(&parking_lock);
+	}
 
 
 	return CLI_SUCCESS;




More information about the svn-commits mailing list