[asterisk-commits] file: trunk r82232 - /trunk/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 11 08:15:38 CDT 2007


Author: file
Date: Tue Sep 11 08:15:37 2007
New Revision: 82232

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82232
Log:
(closes issue #10695)
Reported by: junky
Patches:
      count_showconn.diff uploaded by junky (license 177)
Provide a count of connected users to manager.

Modified:
    trunk/main/manager.c

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=82232&r1=82231&r2=82232
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Tue Sep 11 08:15:37 2007
@@ -625,13 +625,18 @@
 {
 	struct mansession *s;
 	char *format = "  %-15.15s  %-15.15s\n";
+	int count = 0;
 
 	ast_cli(fd, format, "Username", "IP Address");
 
 	AST_LIST_LOCK(&sessions);
-	AST_LIST_TRAVERSE(&sessions, s, list)
+	AST_LIST_TRAVERSE(&sessions, s, list) {
 		ast_cli(fd, format,s->username, ast_inet_ntoa(s->sin.sin_addr));
+		count++;
+	}
 	AST_LIST_UNLOCK(&sessions);
+
+	ast_cli(fd, "%d users connected.\n", count);
 
 	return RESULT_SUCCESS;
 }




More information about the asterisk-commits mailing list