aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_features.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-18 22:43:45 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-18 22:43:45 +0000
commitab51c0d7fad1957b36454533cd8e786ed66efa61 (patch)
treed49317ce7050cdca6ecef46706a320e879421c61 /channels/chan_features.c
parentcedd5ba68f094ce4082e42b47674c0f1c01d447d (diff)
(issue #10724)
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: http://svn.digium.com/svn/asterisk/trunk@82930 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_features.c')
-rw-r--r--channels/chan_features.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/channels/chan_features.c b/channels/chan_features.c
index aa893de38..719de09ed 100644
--- a/channels/chan_features.c
+++ b/channels/chan_features.c
@@ -509,36 +509,41 @@ static struct ast_channel *features_request(const char *type, int format, void *
return chan;
}
-static int features_show(int fd, int argc, char **argv)
+static char *features_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct feature_pvt *p;
- if (argc != 3)
- return RESULT_SHOWUSAGE;
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "feature show channels";
+ e->usage =
+ "Usage: feature show channels\n"
+ " Provides summary information on feature channels.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != 3)
+ return CLI_SHOWUSAGE;
if (AST_LIST_EMPTY(&features)) {
- ast_cli(fd, "No feature channels in use\n");
- return RESULT_SUCCESS;
+ ast_cli(a->fd, "No feature channels in use\n");
+ return CLI_SUCCESS;
}
AST_LIST_LOCK(&features);
AST_LIST_TRAVERSE(&features, p, list) {
ast_mutex_lock(&p->lock);
- ast_cli(fd, "%s -- %s/%s\n", p->owner ? p->owner->name : "<unowned>", p->tech, p->dest);
+ ast_cli(a->fd, "%s -- %s/%s\n", p->owner ? p->owner->name : "<unowned>", p->tech, p->dest);
ast_mutex_unlock(&p->lock);
}
AST_LIST_UNLOCK(&features);
- return RESULT_SUCCESS;
+ return CLI_SUCCESS;
}
-static const char show_features_usage[] =
-"Usage: feature show channels\n"
-" Provides summary information on feature channels.\n";
-
static struct ast_cli_entry cli_features[] = {
- { { "feature", "show", "channels", NULL },
- features_show, "List status of feature channels",
- show_features_usage },
+ NEW_CLI(features_show, "List status of feature channels"),
};
static int load_module(void)