dect
/
asterisk
Archived
13
0
Fork 0

(closes issue #10695)

Reported by: junky
Patches:
      count_showconn.diff uploaded by junky (license 177)
Provide a count of connected users to manager.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82232 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
file 2007-09-11 13:15:37 +00:00
parent a08f2af3f7
commit 63abca7cf4
1 changed files with 6 additions and 1 deletions

View File

@ -625,14 +625,19 @@ static int handle_showmanconn(int fd, int argc, char *argv[])
{
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;
}