aboutsummaryrefslogtreecommitdiffstats
path: root/main/manager.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-02 23:21:33 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-02 23:21:33 +0000
commitc6f0d3482ea1bd5cf95b941a555db03aaeb18ad6 (patch)
tree49b361fc00c9abec7db74dd6472b13a8d8b54e59 /main/manager.c
parentcdc296ee61353dd2f088e1694d0240f9395554ca (diff)
Reverting commit number 173028 as there are some
potential issues git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173047 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/main/manager.c b/main/manager.c
index d5119bc04..20590126a 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -209,8 +209,6 @@ static AST_RWLIST_HEAD_STATIC(actions, manager_action);
/*! \brief list of hooks registered */
static AST_RWLIST_HEAD_STATIC(manager_hooks, manager_custom_hook);
-static void free_session(struct mansession *s);
-
/*! \brief Add a custom hook to be called when an event is fired */
void ast_manager_register_hook(struct manager_custom_hook *hook)
{
@@ -648,74 +646,6 @@ static char *handle_showmanagers(struct ast_cli_entry *e, int cmd, struct ast_cl
return CLI_SUCCESS;
}
-/*! \brief Implement CLI command 'manager logout <user>' */
-static char *handle_managerlogout(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- struct mansession *s = NULL;
- char *ret = NULL;
- size_t l;
- int which = 0;
- /*
- char *choice[] = { "from", NULL };
- */
-
- switch (cmd) {
- case CLI_INIT:
- e->command = "manager logout";
- e->usage =
- "Usage: manager logout <user> [from <ipaddress>]\n"
- " Logout a connected manager user.\n";
- return NULL;
- case CLI_GENERATE:
- /*
- if (a->pos == 3) {
- return ast_cli_complete(a->word, choice, a->n);
- }
- */
- if (a->pos == 2) {
- l = strlen(a->word);
- AST_LIST_LOCK(&sessions);
- AST_LIST_TRAVERSE(&sessions, s, list) {
- if (!strncasecmp(a->word, s->username, l) && ++which > a->n ) {
- ret = ast_strdup(s->username);
- break;
- }
- }
- AST_LIST_UNLOCK(&sessions);
- }
- return ret;
- }
-
- if (a->argc != 3 && a->argc != 5) {
- return CLI_SHOWUSAGE;
- } else if (a->argc == 5 && strcasecmp(a->argv[3], "from")) {
- return CLI_SHOWUSAGE;
- }
-
- AST_LIST_LOCK(&sessions);
- AST_LIST_TRAVERSE_SAFE_BEGIN(&sessions, s, list) {
- if (!strcasecmp(s->username, a->argv[2])) {
- if (a->argc == 5) {
- /* compare ip address. */
- if (strcmp(ast_inet_ntoa(s->sin.sin_addr), a->argv[4])) {
- continue;
- }
- }
- AST_LIST_REMOVE_CURRENT(list);
- ast_mutex_lock(&s->__lock);
- if (s->waiting_thread != AST_PTHREADT_NULL) {
- pthread_kill(s->waiting_thread, SIGURG);
- }
- ast_mutex_unlock(&s->__lock);
- ast_atomic_fetchadd_int(&num_sessions, -1);
- free_session(s);
- }
- }
- AST_LIST_TRAVERSE_SAFE_END;
- AST_LIST_UNLOCK(&sessions);
-
- return CLI_SUCCESS;
-}
/*! \brief CLI command manager list commands */
static char *handle_showmancmds(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -832,7 +762,6 @@ static struct ast_cli_entry cli_manager[] = {
AST_CLI_DEFINE(handle_showmanconn, "List connected manager interface users"),
AST_CLI_DEFINE(handle_showmaneventq, "List manager interface queued events"),
AST_CLI_DEFINE(handle_showmanagers, "List configured manager users"),
- AST_CLI_DEFINE(handle_managerlogout, "Logout a manager user"),
AST_CLI_DEFINE(handle_showmanager, "Display information on a specific manager user"),
AST_CLI_DEFINE(handle_mandebug, "Show, enable, disable debugging of the manager code"),
AST_CLI_DEFINE(handle_manager_reload, "Reload manager configurations"),