Discussion of these CLI changes resulted in more consistency (Bug 8236)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2006-11-10 16:51:55 +00:00
parent cb2930ecb4
commit f11ea0549d
6 changed files with 256 additions and 155 deletions

View File

@@ -2533,17 +2533,17 @@ static int restart_monitor(void)
static int h323_do_trace(int fd, int argc, char *argv[])
{
if (argc != 3) {
if (argc != 4) {
return RESULT_SHOWUSAGE;
}
h323_debug(1, atoi(argv[2]));
h323_debug(1, atoi(argv[3]));
ast_cli(fd, "H.323 trace set to level %s\n", argv[2]);
return RESULT_SUCCESS;
}
static int h323_no_trace(int fd, int argc, char *argv[])
{
if (argc != 3) {
if (argc < 3 || argc > 4) {
return RESULT_SHOWUSAGE;
}
h323_debug(0,0);
@@ -2553,7 +2553,7 @@ static int h323_no_trace(int fd, int argc, char *argv[])
static int h323_do_debug(int fd, int argc, char *argv[])
{
if (argc != 2) {
if (argc < 2 || argc > 3) {
return RESULT_SHOWUSAGE;
}
h323debug = 1;
@@ -2563,7 +2563,7 @@ static int h323_do_debug(int fd, int argc, char *argv[])
static int h323_no_debug(int fd, int argc, char *argv[])
{
if (argc != 3) {
if (argc < 3 || argc > 4) {
return RESULT_SHOWUSAGE;
}
h323debug = 0;
@@ -2642,43 +2642,58 @@ static char h323_reload_usage[] =
" Reloads H.323 configuration from h323.conf\n";
static struct ast_cli_entry cli_h323_no_trace_deprecated = {
{ { "h.323", "no", "trace", NULL },
{ "h.323", "no", "trace", NULL },
h323_no_trace, "Disable H.323 Stack Tracing",
no_trace_usage };
};
static struct ast_cli_entry cli_h323_no_debug_deprecated = {
{ { "h.323", "no", "debug", NULL },
{ "h.323", "no", "debug", NULL },
h323_no_debug, "Disable H.323 debug",
no_debug_usage };
};
static struct ast_cli_entry cli_h323[] = {
{ { "h.323", "trace", NULL },
h323_do_trace, "Enable H.323 Stack Tracing",
trace_usage },
static struct ast_cli_entry cli_h323_debug_deprecated = {
{ "h.323", "debug", NULL },
h323_do_debug, "Enable H.323 debug",
debug_usage };
{ { "h.323", "trace", "off", NULL },
static struct ast_cli_entry cli_h323_trace_deprecated = {
{ "h.323", "trace", NULL },
h323_do_trace, "Enable H.323 Stack Tracing",
trace_usage };
static struct ast_cli_entry cli_h323_gk_cycle_deprecated = {
{ "h323", "cycle", "gk", NULL },
h323_gk_cycle, "Manually re-register with the Gatekeper",
show_cycle_usage };
static struct ast_cli_entry cli_h323[] = {
{ { "h323", "set", "trace", NULL },
h323_do_trace, "Enable H.323 Stack Tracing",
trace_usage, NULL, cli_h323_trace_deprecated },
{ { "h323", "set", "trace", "off", NULL },
h323_no_trace, "Disable H.323 Stack Tracing",
no_trace_usage, NULL, cli_h323_no_trace_deprecated },
{ { "h.323", "debug", NULL },
{ { "h323", "set", "debug", NULL },
h323_do_debug, "Enable H.323 debug",
debug_usage },
debug_usage, NULL, cli_h323_debug_deprecated },
{ { "h.323", "debug", "off", NULL },
{ { "h323", "set", "debug", "off", NULL },
h323_no_debug, "Disable H.323 debug",
no_debug_usage, NULL, cli_h323_no_debug_deprecated },
{ { "h.323", "gk", "cycle", NULL },
{ { "h323", "cycle", "gk", NULL },
h323_gk_cycle, "Manually re-register with the Gatekeper",
show_cycle_usage },
show_cycle_usage, NULL, cli_h323_gk_cycle_deprecated },
{ { "h.323", "hangup", NULL },
{ { "h323", "hangup", NULL },
h323_ep_hangup, "Manually try to hang up a call",
show_hangup_usage },
{ { "h.323", "show", "tokens", NULL },
{ { "h323", "show", "tokens", NULL },
h323_tokens_show, "Show all active call tokens",
show_tokens_usage },
};