Reported by: eliel
Patches:
      res_features.c.patch uploaded by eliel (license 64)
      res_agi.c.patch uploaded by seanbright (license 71)
      res_musiconhold.c.patch uploaded by seanbright (license 71)
      pbx.c.patch uploaded by moy (license 222)
      logger.c.patch uploaded by moy (license 222)
      frame.c.patch uploaded by moy (license 222)
      manager.c.patch uploaded by moy (license 222)
      http.c.patch uploaded by moy (license 222)
      dnsmgr.c.patch uploaded by moy (license 222)
      res_realtime.c.patch uploaded by eliel (license 64)
      res_odbc.c.patch uploaded by seanbright (license 71)
      res_jabber.c.patch uploaded by eliel (license 64)
      chan_local.c.patch uploaded by eliel (license 64)
      chan_agent.c.patch uploaded by eliel (license 64)
      chan_alsa.c.patch uploaded by eliel (license 64)
      chan_features.c.patch uploaded by eliel (license 64)
      chan_sip.c.patch uploaded by eliel (license 64)
      RollUp.1.patch (includes all of the above patches) uploaded by seanbright (license 71)

Convert many CLI commands to the NEW_CLI format.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jason Parker
2007-09-18 22:43:45 +00:00
parent 0c8381a1f5
commit c7a9ec1691
17 changed files with 1748 additions and 1487 deletions

View File

@@ -670,35 +670,40 @@ static struct ast_channel *local_request(const char *type, int format, void *dat
}
/*! \brief CLI command "local show channels" */
static int locals_show(int fd, int argc, char **argv)
static char *locals_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct local_pvt *p = NULL;
if (argc != 3)
return RESULT_SHOWUSAGE;
switch (cmd) {
case CLI_INIT:
e->command = "local show channels";
e->usage =
"Usage: local show channels\n"
" Provides summary information on active local proxy channels.\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
if (a->argc != 3)
return CLI_SHOWUSAGE;
AST_LIST_LOCK(&locals);
if (!AST_LIST_EMPTY(&locals)) {
AST_LIST_TRAVERSE(&locals, p, list) {
ast_mutex_lock(&p->lock);
ast_cli(fd, "%s -- %s@%s\n", p->owner ? p->owner->name : "<unowned>", p->exten, p->context);
ast_cli(a->fd, "%s -- %s@%s\n", p->owner ? p->owner->name : "<unowned>", p->exten, p->context);
ast_mutex_unlock(&p->lock);
}
} else
ast_cli(fd, "No local channels in use\n");
ast_cli(a->fd, "No local channels in use\n");
AST_LIST_UNLOCK(&locals);
return RESULT_SUCCESS;
return CLI_SUCCESS;
}
static const char show_locals_usage[] =
"Usage: local show channels\n"
" Provides summary information on active local proxy channels.\n";
static struct ast_cli_entry cli_local[] = {
{ { "local", "show", "channels", NULL },
locals_show, "List status of local channels",
show_locals_usage },
NEW_CLI(locals_show, "List status of local channels"),
};
/*! \brief Load module into PBX, register channel */