(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:
parent
a08f2af3f7
commit
63abca7cf4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue