diff options
author | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-12 06:46:04 +0000 |
---|---|---|
committer | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-12 06:46:04 +0000 |
commit | e005e919bd11efc270b218eb4d43117290bfe7ed (patch) | |
tree | 95cbe393b660ef9b967378388db5bd09c7a890f4 /main/rtp.c | |
parent | d6ee75c629ce205626eb7cd813dc74f709939f42 (diff) |
This commit does two things:
- Add CLI aliases module to asterisk.
- Remove all deprecated CLI commands from the code
Initial work done by file.
Junk-Y and lmadsen did a lot of work and testing to
get the list of deprecated commands into the configuration file.
Deprecated CLI commands are now handled by this new module,
see cli_aliases.conf for more info about that.
ok russellb@ via reviewboard
(closes issue #13735)
Reported by: mvanbaak
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@156120 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 130 |
1 files changed, 4 insertions, 126 deletions
diff --git a/main/rtp.c b/main/rtp.c index 33ea83da5..3da025a2b 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -4439,41 +4439,6 @@ static char *rtcp_do_debug_ip(struct ast_cli_args *a) return CLI_SUCCESS; } -static char *handle_cli_rtp_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) -{ - switch (cmd) { - case CLI_INIT: - e->command = "rtp debug [off|ip]"; - e->usage = - "Usage: rtp debug [off]|[ip host[:port]]\n" - " Enable/Disable dumping of all RTP packets. If 'ip' is\n" - " specified, limit the dumped packets to those to and from\n" - " the specified 'host' with optional port.\n"; - return NULL; - case CLI_GENERATE: - return NULL; - } - - if (a->argc < 2 || a->argc > 4) - return CLI_SHOWUSAGE; - if (a->argc == 2) { - rtpdebug = 1; - memset(&rtpdebugaddr, 0, sizeof(rtpdebugaddr)); - ast_cli(a->fd, "RTP Debugging Enabled\n"); - } else if (a->argc == 3) { - if (strncasecmp(a->argv[2], "off", 3)) - return CLI_SHOWUSAGE; - rtpdebug = 0; - ast_cli(a->fd, "RTP Debugging Disabled\n"); - } else { - if (strncasecmp(a->argv[2], "ip", 2)) - return CLI_SHOWUSAGE; - return rtp_do_debug_ip(a); - } - - return CLI_SUCCESS; -} - static char *handle_cli_rtp_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { switch (cmd) { @@ -4507,41 +4472,6 @@ static char *handle_cli_rtp_set_debug(struct ast_cli_entry *e, int cmd, struct a return CLI_SHOWUSAGE; /* default, failure */ } -static char *handle_cli_rtcp_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) -{ - switch (cmd) { - case CLI_INIT: - e->command = "rtcp debug [off|ip]"; - e->usage = - "Usage: rtcp debug [off]|[ip host[:port]]\n" - " Enable/Disable dumping of all RTCP packets. If 'ip' is\n" - " specified, limit the dumped packets to those to and from\n" - " the specified 'host' with optional port.\n"; - return NULL; - case CLI_GENERATE: - return NULL; - } - - if (a->argc < 2 || a->argc > 4) - return CLI_SHOWUSAGE; - if (a->argc == 2) { - rtcpdebug = 1; - memset(&rtcpdebugaddr, 0, sizeof(rtcpdebugaddr)); - ast_cli(a->fd, "RTCP Debugging Enabled\n"); - } else if (a->argc == 3) { - if (strncasecmp(a->argv[2], "off", 3)) - return CLI_SHOWUSAGE; - rtcpdebug = 0; - ast_cli(a->fd, "RTCP Debugging Disabled\n"); - } else { - if (strncasecmp(a->argv[2], "ip", 2)) - return CLI_SHOWUSAGE; - return rtcp_do_debug_ip(a); - } - - return CLI_SUCCESS; -} - static char *handle_cli_rtcp_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { switch (cmd) { @@ -4575,29 +4505,6 @@ static char *handle_cli_rtcp_set_debug(struct ast_cli_entry *e, int cmd, struct return CLI_SHOWUSAGE; /* default, failure */ } -static char *handle_cli_rtcp_stats_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) -{ - switch (cmd) { - case CLI_INIT: - e->command = "rtcp stats [off]"; - e->usage = - "Usage: rtcp stats [off]\n" - " Enable/Disable dumping of RTCP stats.\n"; - return NULL; - case CLI_GENERATE: - return NULL; - } - - if (a->argc < 2 || a->argc > 3) - return CLI_SHOWUSAGE; - if (a->argc == 3 && strncasecmp(a->argv[2], "off", 3)) - return CLI_SHOWUSAGE; - - rtcpstats = (a->argc == 3) ? 0 : 1; - ast_cli(a->fd, "RTCP Stats %s\n", rtcpstats ? "Enabled" : "Disabled"); - return CLI_SUCCESS; -} - static char *handle_cli_rtcp_set_stats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { switch (cmd) { @@ -4625,30 +4532,6 @@ static char *handle_cli_rtcp_set_stats(struct ast_cli_entry *e, int cmd, struct return CLI_SUCCESS; } -static char *handle_cli_stun_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) -{ - switch (cmd) { - case CLI_INIT: - e->command = "stun debug [off]"; - e->usage = - "Usage: stun debug [off]\n" - " Enable/Disable STUN (Simple Traversal of UDP through NATs)\n" - " debugging\n"; - return NULL; - case CLI_GENERATE: - return NULL; - } - - if (a->argc < 2 || a->argc > 3) - return CLI_SHOWUSAGE; - if (a->argc == 3 && strncasecmp(a->argv[2], "off", 3)) - return CLI_SHOWUSAGE; - - stundebug = (a->argc == 3) ? 0 : 1; - ast_cli(a->fd, "STUN Debugging %s\n", stundebug ? "Enabled" : "Disabled"); - return CLI_SUCCESS; -} - static char *handle_cli_stun_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { switch (cmd) { @@ -4677,16 +4560,11 @@ static char *handle_cli_stun_set_debug(struct ast_cli_entry *e, int cmd, struct return CLI_SUCCESS; } -static struct ast_cli_entry cli_rtp_debug_deprecated = AST_CLI_DEFINE(handle_cli_rtp_debug_deprecated, "Enable/Disable RTP debugging"); -static struct ast_cli_entry cli_rtcp_debug_deprecated = AST_CLI_DEFINE(handle_cli_rtcp_debug_deprecated, "Enable/Disable RTCP debugging"); -static struct ast_cli_entry cli_rtcp_stats_deprecated = AST_CLI_DEFINE(handle_cli_rtcp_stats_deprecated, "Enable/Disable RTCP stats"); -static struct ast_cli_entry cli_stun_debug_deprecated = AST_CLI_DEFINE(handle_cli_stun_debug_deprecated, "Enable/Disable STUN debugging"); - static struct ast_cli_entry cli_rtp[] = { - AST_CLI_DEFINE(handle_cli_rtp_set_debug, "Enable/Disable RTP debugging", .deprecate_cmd = &cli_rtp_debug_deprecated), - AST_CLI_DEFINE(handle_cli_rtcp_set_debug, "Enable/Disable RTCP debugging", .deprecate_cmd = &cli_rtcp_debug_deprecated), - AST_CLI_DEFINE(handle_cli_rtcp_set_stats, "Enable/Disable RTCP stats", .deprecate_cmd = &cli_rtcp_stats_deprecated), - AST_CLI_DEFINE(handle_cli_stun_set_debug, "Enable/Disable STUN debugging", .deprecate_cmd = &cli_stun_debug_deprecated), + AST_CLI_DEFINE(handle_cli_rtp_set_debug, "Enable/Disable RTP debugging"), + AST_CLI_DEFINE(handle_cli_rtcp_set_debug, "Enable/Disable RTCP debugging"), + AST_CLI_DEFINE(handle_cli_rtcp_set_stats, "Enable/Disable RTCP stats"), + AST_CLI_DEFINE(handle_cli_stun_set_debug, "Enable/Disable STUN debugging"), }; static int __ast_rtp_reload(int reload) |