[asterisk-commits] russell: trunk r103171 - in /trunk: apps/ channels/ funcs/ main/ pbx/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 8 15:26:33 CST 2008


Author: russell
Date: Fri Feb  8 15:26:32 2008
New Revision: 103171

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103171
Log:
Merge changes from team/mvanbaak/cli-command-audit
(closes issue #8925)

About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI
commands in Asterisk 1.4 for the next version of their book, they documented
a lot of inconsistencies.  This set of changes addresses all of these issues
and has been reviewed by Leif.

While this does introduce even more changes to the CLI command structure, it
makes everything consistent, which is the most important thing.

Thanks to all that helped with this one!

Modified:
    trunk/apps/app_minivm.c
    trunk/apps/app_playback.c
    trunk/apps/app_rpt.c
    trunk/apps/app_voicemail.c
    trunk/channels/chan_iax2.c
    trunk/channels/chan_mgcp.c
    trunk/channels/chan_sip.c
    trunk/channels/chan_skinny.c
    trunk/channels/chan_usbradio.c
    trunk/funcs/func_devstate.c
    trunk/main/asterisk.c
    trunk/main/cdr.c
    trunk/main/pbx.c
    trunk/main/rtp.c
    trunk/main/udptl.c
    trunk/pbx/pbx_ael.c
    trunk/pbx/pbx_dundi.c
    trunk/res/res_agi.c
    trunk/res/res_jabber.c

Modified: trunk/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_minivm.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/apps/app_minivm.c (original)
+++ trunk/apps/app_minivm.c Fri Feb  8 15:26:32 2008
@@ -2602,7 +2602,7 @@
 		return NULL;
 	}
 
-	if (a->argc != 3)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 
 	AST_LIST_LOCK(&minivm_zones);

Modified: trunk/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_playback.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/apps/app_playback.c (original)
+++ trunk/apps/app_playback.c Fri Feb  8 15:26:32 2008
@@ -374,7 +374,7 @@
 	if (a->argc == 2) {
 		ast_cli(a->fd, "say mode is [%s]\n", old_mode);
 		return CLI_SUCCESS;
-	} else if (a->argc != 3)
+	} else if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	mode = a->argv[2];
 	if (!strcmp(mode, old_mode))

Modified: trunk/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_rpt.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/apps/app_rpt.c (original)
+++ trunk/apps/app_rpt.c Fri Feb  8 15:26:32 2008
@@ -1090,7 +1090,7 @@
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc != 4)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	newlevel = myatoi(a->argv[3]);
 	if ((newlevel < 0) || (newlevel > 7))

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri Feb  8 15:26:32 2008
@@ -7859,7 +7859,7 @@
 		return NULL;
 	}
 
-	if (a->argc != 3)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 
 	AST_LIST_LOCK(&zones);
@@ -7891,7 +7891,7 @@
 		return NULL;
 	}
 
-	if (a->argc != 2)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 
 	ast_cli(a->fd, "Reloading voicemail configuration...\n");	

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Fri Feb  8 15:26:32 2008
@@ -5262,117 +5262,158 @@
 	return CLI_SUCCESS;
 }
 
-static char *handle_cli_iax2_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_iax2_set_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "iax2 set debug";
+		e->command = "iax2 set debug [off]";
 		e->usage =
-			"Usage: iax2 set debug\n"
-			"       Enables dumping of IAX packets for debugging purposes.\n";
+			"Usage: iax2 set debug [off]\n"
+			"       Enables/Disables dumping of IAX packets for debugging purposes.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc < 2 || a->argc > 3)
+	if (a->argc < 3 || a->argc > 4)
 		return CLI_SHOWUSAGE;
-	iaxdebug = 1;
-	ast_cli(a->fd, "IAX2 Debugging Enabled\n");
+	if (a->argc == 3) {
+		iaxdebug = 1;
+		ast_cli(a->fd, "IAX2 Debugging Enabled\n");
+	} else {
+		iaxdebug = 0;
+		ast_cli(a->fd, "IAX2 Debugging Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
-static char *handle_cli_iax2_set_debug_off(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_iax2_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "iax2 set debug off";
+		e->command = "iax2 set debug {on|off}";
 		e->usage =
-			"Usage: iax2 set debug off\n"
-			"       Disables dumping of IAX packets for debugging purposes.\n";
+			"Usage: iax2 set debug {on|off}\n"
+			"       Enables/Disables dumping of IAX packets for debugging purposes.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc < 3 || a->argc > 4)
+
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
-	iaxdebug = 0;
-	ast_cli(a->fd, "IAX2 Debugging Disabled\n");
+
+	if (!strncasecmp(a->argv[e->args -1], "on", 2)) {
+		iaxdebug = 1;
+		ast_cli(a->fd, "IAX2 Debugging Enabled\n");
+	} else {
+		iaxdebug = 0;
+		ast_cli(a->fd, "IAX2 Debugging Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
-static char *handle_cli_iax2_set_debug_trunk(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+
+static char *handle_cli_iax2_set_debug_trunk_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "iax2 set debug trunk";
+		e->command = "iax2 set debug trunk [off]";
 		e->usage =
-			"Usage: iax2 set debug trunk\n"
-			"       Requests current status of IAX trunking\n";
+			"Usage: iax2 set debug trunk [off]\n"
+			"       Enables/Disables debugging of IAX trunking\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc < 3 || a->argc > 4)
+
+	if (a->argc < 4 || a->argc > 5)
 		return CLI_SHOWUSAGE;
-	iaxtrunkdebug = 1;
-	ast_cli(a->fd, "IAX2 Trunk Debugging Requested\n");
+
+	if (a->argc == 4) {
+		iaxtrunkdebug = 1;
+		ast_cli(a->fd, "IAX2 Trunk Debugging Enabled\n");
+	} else {
+		iaxtrunkdebug = 0;
+		ast_cli(a->fd, "IAX2 Trunk Debugging Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
-static char *handle_cli_iax2_set_debug_trunk_off(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_iax2_set_debug_trunk(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "iax2 set debug trunk off";
+		e->command = "iax2 set debug trunk {on|off}";
 		e->usage =
-			"Usage: iax2 set debug trunk off\n"
-			"       Disables debugging of IAX trunking\n";
+			"Usage: iax2 set debug trunk {on|off}\n"
+			"       Enables/Disables debugging of IAX trunking\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc < 4 || a->argc > 5)
+
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
-	iaxtrunkdebug = 0;
-	ast_cli(a->fd, "IAX2 Trunk Debugging Disabled\n");
+
+	if (!strncasecmp(a->argv[e->args - 1], "on", 2)) {
+		iaxtrunkdebug = 1;
+		ast_cli(a->fd, "IAX2 Trunk Debugging Enabled\n");
+	} else {
+		iaxtrunkdebug = 0;
+		ast_cli(a->fd, "IAX2 Trunk Debugging Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
-static char *handle_cli_iax2_set_debug_jb(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_iax2_set_debug_jb_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "iax2 set debug jb";
+		e->command = "iax2 set debug jb [off]";
 		e->usage =
-			"Usage: iax2 set debug jb\n"
-			"       Enables jitterbuffer debugging information\n";
+			"Usage: iax2 set debug jb [off]\n"
+			"       Enables/Disables jitterbuffer debugging information\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc < 3 || a->argc > 4)
+
+	if (a->argc < 4 || a->argc > 5)
 		return CLI_SHOWUSAGE;
-	jb_setoutput(jb_error_output, jb_warning_output, jb_debug_output);
-	ast_cli(a->fd, "IAX2 Jitterbuffer Debugging Enabled\n");
+	
+	if (a->argc == 4) {
+		jb_setoutput(jb_error_output, jb_warning_output, jb_debug_output);
+		ast_cli(a->fd, "IAX2 Jitterbuffer Debugging Enabled\n");
+	} else {
+		jb_setoutput(jb_error_output, jb_warning_output, NULL);
+		ast_cli(a->fd, "IAX2 Jitterbuffer Debugging Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
-static char *handle_cli_iax2_set_debug_jb_off(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_iax2_set_debug_jb(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "iax2 set debug jb off";
+		e->command = "iax2 set debug jb {on|off}";
 		e->usage =
-			"Usage: iax2 set debug jb off\n"
-			"       Disables jitterbuffer debugging information\n";
+			"Usage: iax2 set debug jb {on|off}\n"
+			"       Enables/Disables jitterbuffer debugging information\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc < 4 || a->argc > 5)
+
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
-	jb_setoutput(jb_error_output, jb_warning_output, NULL);
-	ast_cli(a->fd, "IAX2 Jitterbuffer Debugging Disabled\n");
+	
+	if (!strncasecmp(a->argv[e->args -1], "on", 2)) {
+		jb_setoutput(jb_error_output, jb_warning_output, jb_debug_output);
+		ast_cli(a->fd, "IAX2 Jitterbuffer Debugging Enabled\n");
+	} else {
+		jb_setoutput(jb_error_output, jb_warning_output, NULL);
+		ast_cli(a->fd, "IAX2 Jitterbuffer Debugging Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
@@ -11474,17 +11515,18 @@
 #endif
 */
 
+static struct ast_cli_entry cli_iax2_set_debug_deprecated = AST_CLI_DEFINE(handle_cli_iax2_set_debug_deprecated, "Enable/Disable IAX debugging");
+static struct ast_cli_entry cli_iax2_set_debug_trunk_deprecated = AST_CLI_DEFINE(handle_cli_iax2_set_debug_trunk_deprecated, "Enable/Disable IAX debugging");
+static struct ast_cli_entry cli_iax2_set_debug_jb_deprecated = AST_CLI_DEFINE(handle_cli_iax2_set_debug_jb_deprecated, "Enable/Disable IAX debugging");
+
 static struct ast_cli_entry cli_iax2[] = {
 	AST_CLI_DEFINE(handle_cli_iax2_provision,           "Provision an IAX device"),
 	AST_CLI_DEFINE(handle_cli_iax2_prune_realtime,      "Prune a cached realtime lookup"),
 	AST_CLI_DEFINE(handle_cli_iax2_reload,              "Reload IAX configuration"),
 	AST_CLI_DEFINE(handle_cli_iax2_set_mtu,             "Set the IAX systemwide trunking MTU"),
-	AST_CLI_DEFINE(handle_cli_iax2_set_debug,           "Enable IAX debugging"),
-	AST_CLI_DEFINE(handle_cli_iax2_set_debug_trunk,     "Enable IAX trunk debugging"),
-	AST_CLI_DEFINE(handle_cli_iax2_set_debug_jb,        "Enable IAX jitterbuffer debugging"),
-	AST_CLI_DEFINE(handle_cli_iax2_set_debug_off,       "Disable IAX debugging"),
-	AST_CLI_DEFINE(handle_cli_iax2_set_debug_trunk_off, "Disable IAX trunk debugging"),
-	AST_CLI_DEFINE(handle_cli_iax2_set_debug_jb_off,    "Disable IAX jitterbuffer debugging"),
+	AST_CLI_DEFINE(handle_cli_iax2_set_debug,           "Enable/Disable IAX debugging", .deprecate_cmd = &cli_iax2_set_debug_deprecated),
+	AST_CLI_DEFINE(handle_cli_iax2_set_debug_trunk,     "Enable/Disable IAX trunk debugging", .deprecate_cmd = &cli_iax2_set_debug_trunk_deprecated),
+	AST_CLI_DEFINE(handle_cli_iax2_set_debug_jb,        "Enable/Disable IAX jitterbuffer debugging", .deprecate_cmd = &cli_iax2_set_debug_jb_deprecated),
 	AST_CLI_DEFINE(handle_cli_iax2_show_cache,          "Display IAX cached dialplan"),
 	AST_CLI_DEFINE(handle_cli_iax2_show_channels,       "List active IAX channels"),
 	AST_CLI_DEFINE(handle_cli_iax2_show_firmware,       "List available IAX firmware"),

Modified: trunk/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Fri Feb  8 15:26:32 2008
@@ -1139,51 +1139,64 @@
 	return CLI_SUCCESS;
 }
 
-static char *handle_mgcp_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_mgcp_set_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "mgcp set debug";
+		e->command = "mgcp set debug [off]";
 		e->usage =
-			"Usage: mgcp set debug\n"
-			"       Enables dumping of MGCP packets for debugging purposes\n";	
+			"Usage: mgcp set debug [off]\n"
+			"       Enables/Disables dumping of MGCP packets for debugging purposes\n";	
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 3)
+	if (a->argc < 3 || a->argc > 4)
 		return CLI_SHOWUSAGE;
-	mgcpdebug = 1;
-	ast_cli(a->fd, "MGCP Debugging Enabled\n");
+	if (a->argc == 3) {
+		mgcpdebug = 1;
+		ast_cli(a->fd, "MGCP Debugging Enabled\n");
+	} else if (!strncasecmp(a->argv[3], "off", 3)) {
+		mgcpdebug = 0;
+		ast_cli(a->fd, "MGCP Debugging Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
-static char *handle_mgcp_set_debug_off(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_mgcp_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "mgcp set debug off";
+		e->command = "mgcp set debug {on|off}";
 		e->usage =
-			"Usage: mgcp set debug off\n"
-			"       Disables dumping of MGCP packets for debugging purposes\n";
+			"Usage: mgcp set debug {on|off}\n"
+			"       Enables/Disables dumping of MGCP packets for debugging purposes\n";	
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 4)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
-	mgcpdebug = 0;
-	ast_cli(a->fd, "MGCP Debugging Disabled\n");
+
+	if (!strncasecmp(a->argv[e->args - 1], "on", 2)) {
+		mgcpdebug = 1;
+		ast_cli(a->fd, "MGCP Debugging Enabled\n");
+	} else if (!strncasecmp(a->argv[3], "off", 3)) {
+		mgcpdebug = 0;
+		ast_cli(a->fd, "MGCP Debugging Disabled\n");
+	} else {
+		return CLI_SHOWUSAGE;
+	}
 	return CLI_SUCCESS;
 }
 
+static struct ast_cli_entry cli_mgcp_set_debug_deprecated = AST_CLI_DEFINE(handle_mgcp_set_debug_deprecated, "Enable/Disable MGCP debugging");
 static struct ast_cli_entry cli_mgcp[] = {
 	AST_CLI_DEFINE(handle_mgcp_audit_endpoint, "Audit specified MGCP endpoint"),
 	AST_CLI_DEFINE(handle_mgcp_show_endpoints, "List defined MGCP endpoints"),
-	AST_CLI_DEFINE(handle_mgcp_set_debug, "Enable MGCP debugging"),
-	AST_CLI_DEFINE(handle_mgcp_set_debug_off, "Disable MGCP debugging"),
+	AST_CLI_DEFINE(handle_mgcp_set_debug, "Enable/Disable MGCP debugging", .deprecate_cmd = &cli_mgcp_set_debug_deprecated),
 	AST_CLI_DEFINE(mgcp_reload, "Reload MGCP configuration"),
 };
 

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Feb  8 15:26:32 2008
@@ -1853,8 +1853,8 @@
 static char *sip_do_debug_peer(int fd, char *arg);
 static char *sip_do_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
 static char *sip_notify(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
-static char *sip_do_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
-static char *sip_no_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *sip_do_history_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *sip_set_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
 static int sip_dtmfmode(struct ast_channel *chan, void *data);
 static int sip_addheader(struct ast_channel *chan, void *data);
 static int sip_do_reload(enum channelreloadreason reason);
@@ -13243,7 +13243,7 @@
 	if (a->argc != 4)
 		return CLI_SHOWUSAGE;
 	if (!recordhistory)
-		ast_cli(a->fd, "\n***Note: History recording is currently DISABLED.  Use 'sip history' to ENABLE.\n");
+		ast_cli(a->fd, "\n***Note: History recording is currently DISABLED.  Use 'sip set history on' to ENABLE.\n");
 	len = strlen(a->argv[3]);
 	dialoglist_lock();
 	for (cur = dialoglist; cur; cur = cur->next) {
@@ -13652,49 +13652,63 @@
 	return CLI_SUCCESS;
 }
 
-/*! \brief Enable SIP History logging (CLI) */
-static char *sip_do_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+/*! \brief Enable/Disable SIP History logging (CLI) - deprecated. use sip_set_history instead */
+static char *sip_do_history_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "sip history";
+		e->command = "sip history [off]";
 		e->usage =
-			"Usage: sip history\n"
-			"       Enables recording of SIP dialog history for debugging purposes.\n"
+			"Usage: sip history [off]\n"
+			"       Enables/Disables recording of SIP dialog history for debugging purposes.\n"
 			"       Use 'sip show history' to view the history of a call number.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 2) {
+	if (a->argc < 2 || a->argc > 3) {
 		return CLI_SHOWUSAGE;
 	}
-	recordhistory = TRUE;
-	ast_cli(a->fd, "SIP History Recording Enabled (use 'sip show history')\n");
+	if (a->argc == 2) {
+		recordhistory = TRUE;
+		ast_cli(a->fd, "SIP History Recording Enabled (use 'sip show history')\n");
+	} else {
+		if (strncasecmp(a->argv[2], "off", 3))
+			return CLI_SHOWUSAGE;
+		recordhistory = FALSE;
+		ast_cli(a->fd, "SIP History Recording Disabled\n");
+	}
 	return CLI_SUCCESS;
 }
 
-/*! \brief Disable SIP History logging (CLI) */
-static char *sip_no_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
-
+/*! \brief Enable/Disable SIP History logging (CLI) */
+static char *sip_set_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "sip history off";
+		e->command = "sip set history {on|off}";
 		e->usage =
-			"Usage: sip history off\n"
-			"       Disables recording of SIP dialog history for debugging purposes\n";	
+			"Usage: sip history {on|off}\n"
+			"       Enables/Disables recording of SIP dialog history for debugging purposes.\n"
+			"       Use 'sip show history' to view the history of a call number.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 3) {
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
-	}
-	recordhistory = FALSE;
-	ast_cli(a->fd, "SIP History Recording Disabled\n");
+
+	if (!strncasecmp(a->argv[e->args - 1], "on", 2)) {
+		recordhistory = TRUE;
+		ast_cli(a->fd, "SIP History Recording Enabled (use 'sip show history')\n");
+	} else if (!strncasecmp(a->argv[e->args - 1], "off", 3)) {
+		recordhistory = FALSE;
+		ast_cli(a->fd, "SIP History Recording Disabled\n");
+	} else {
+		return CLI_SHOWUSAGE;
+	}
 	return CLI_SUCCESS;
 }
 
@@ -21102,6 +21116,7 @@
 	return 1;
 }
 
+static struct ast_cli_entry cli_sip_do_history_deprecated = AST_CLI_DEFINE(sip_do_history_deprecated, "Enable/Disable SIP history");
 /*! \brief SIP Cli commands definition */
 static struct ast_cli_entry cli_sip[] = {
 	AST_CLI_DEFINE(sip_show_channels, "List active SIP channels/subscriptions"),
@@ -21120,8 +21135,7 @@
 	AST_CLI_DEFINE(sip_show_user, "Show details on specific SIP user"),
 	AST_CLI_DEFINE(sip_prune_realtime, "Prune cached Realtime users/peers"),
 	AST_CLI_DEFINE(sip_do_debug, "Enable/Disable SIP debugging"),
-	AST_CLI_DEFINE(sip_do_history, "Enable SIP history"),
-	AST_CLI_DEFINE(sip_no_history, "Disable SIP history"),
+	AST_CLI_DEFINE(sip_set_history, "Enable/Disable SIP history", .deprecate_cmd = &cli_sip_do_history_deprecated),
 	AST_CLI_DEFINE(sip_reload, "Reload SIP configuration"),
 	AST_CLI_DEFINE(sip_show_tcp, "List TCP Connections")
 };

Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Fri Feb  8 15:26:32 2008
@@ -2371,46 +2371,62 @@
 	.set_rtp_peer = skinny_set_rtp_peer,
 };
 
-static char *handle_skinny_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_skinny_set_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "skinny set debug";
+		e->command = "skinny set debug [off]";
 		e->usage =
-			"Usage: skinny set debug\n"
-			"       Enables dumping of Skinny packets for debugging purposes\n";
+			"Usage: skinny set debug [off]\n"
+			"       Enables/Disables dumping of Skinny packets for debugging purposes\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 	
-	if (a->argc != 3)
+	if (a->argc < 3 || a->argc > 4)
 		return CLI_SHOWUSAGE;
 
-	skinnydebug = 1;
-	ast_cli(a->fd, "Skinny Debugging Enabled\n");
-	return CLI_SUCCESS;
-}
-
-static char *handle_skinny_set_debug_off(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+	if (a->argc == 3) {
+		skinnydebug = 1;
+		ast_cli(a->fd, "Skinny Debugging Enabled\n");
+		return CLI_SUCCESS;
+	} else if (!strncasecmp(a->argv[3], "off", 3)) {
+		skinnydebug = 0;
+		ast_cli(a->fd, "Skinny Debugging Disabled\n");
+		return CLI_SUCCESS;
+	} else {
+		return CLI_SHOWUSAGE;
+	}
+}
+
+static char *handle_skinny_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "skinny set debug off";
+		e->command = "skinny set debug {on|off}";
 		e->usage =
-			"Usage: skinny set debug off\n"
-			"       Disables dumping of Skinny packets for debugging purposes\n";
+			"Usage: skinny set debug {on|off}\n"
+			"       Enables/Disables dumping of Skinny packets for debugging purposes\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-
-	if (a->argc != 4)
+	
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 
-	skinnydebug = 0;
-	ast_cli(a->fd, "Skinny Debugging Disabled\n");
-	return CLI_SUCCESS;
+	if (!strncasecmp(a->argv[e->args - 1], "on", 2)) {
+		skinnydebug = 1;
+		ast_cli(a->fd, "Skinny Debugging Enabled\n");
+		return CLI_SUCCESS;
+	} else if (!strncasecmp(a->argv[e->args - 1], "off", 3)) {
+		skinnydebug = 0;
+		ast_cli(a->fd, "Skinny Debugging Disabled\n");
+		return CLI_SUCCESS;
+	} else {
+		return CLI_SHOWUSAGE;
+	}
 }
 
 static char *complete_skinny_devices(const char *word, int state)
@@ -2841,14 +2857,14 @@
 	return CLI_SUCCESS;
 }
 
+static struct ast_cli_entry cli_skinny_set_debug_deprecated = AST_CLI_DEFINE(handle_skinny_set_debug_deprecated, "Enable/Disable Skinny debugging");
 static struct ast_cli_entry cli_skinny[] = {
 	AST_CLI_DEFINE(handle_skinny_show_devices, "List defined Skinny devices"),
 	AST_CLI_DEFINE(handle_skinny_show_device, "List Skinny device information"),
 	AST_CLI_DEFINE(handle_skinny_show_lines, "List defined Skinny lines per device"),	
 	AST_CLI_DEFINE(handle_skinny_show_line, "List Skinny line information"),
 	AST_CLI_DEFINE(handle_skinny_show_settings, "List global Skinny settings"),
-	AST_CLI_DEFINE(handle_skinny_set_debug, "Enable Skinny debugging"),
-	AST_CLI_DEFINE(handle_skinny_set_debug_off, "Disable Skinny debugging"),
+	AST_CLI_DEFINE(handle_skinny_set_debug, "Enable/Disable Skinny debugging", .deprecate_cmd = &cli_skinny_set_debug_deprecated),
 	AST_CLI_DEFINE(handle_skinny_reset, "Reset Skinny device(s)"),
 };
 

Modified: trunk/channels/chan_usbradio.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_usbradio.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/channels/chan_usbradio.c (original)
+++ trunk/channels/chan_usbradio.c Fri Feb  8 15:26:32 2008
@@ -1622,7 +1622,7 @@
 /*
 	CLI debugging on and off
 */
-static char *handle_cli_radio_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_radio_set_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct chan_usbradio_pvt *o = NULL;
 
@@ -1652,11 +1652,43 @@
 	return CLI_SUCCESS;
 }
 
+static char *handle_cli_radio_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	struct chan_usbradio_pvt *o = NULL;
+
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "radio set debug {on|off}";
+		e->usage =
+			"Usage: radio set debug {on|off}\n"
+			"       Enable/Disable radio debugging.\n";
+	case CLI_GENERATE:
+		return NULL;
+	}
+
+	if (a->argc != e->args)
+		return CLI_SHOWUSAGE;
+
+	o = find_desc(usbradio_active);
+
+	if (!strncasecmp(a->argv[e->args - 1], "on", 2))
+		o->debuglevel = 1;
+	else if (!strncasecmp(a->argv[e->args - 1], "off", 3))
+		o->debuglevel = 0;
+	else
+		return CLI_SHOWUSAGE;
+
+	ast_cli(a->fd, "USB Radio debugging %s.\n", o->debuglevel ? "enabled" : "disabled");
+
+	return CLI_SUCCESS;
+}
+
+static struct ast_cli_entry cli_radio_set_debug_deprecated = AST_CLI_DEFINE(handle_cli_radio_set_debug_deprecated, "Enable/Disable Radio Debugging");
 static struct ast_cli_entry cli_usbradio[] = {
 	AST_CLI_DEFINE(handle_cli_radio_key,       "Simulate Rx Signal Present"),
 	AST_CLI_DEFINE(handle_cli_radio_unkey,     "Simulate Rx Signal Lusb"),
 	AST_CLI_DEFINE(handle_cli_radio_tune,      "Radio Tune"),
-	AST_CLI_DEFINE(handle_cli_radio_set_debug, "Enable/Disable Radio Debugging"),
+	AST_CLI_DEFINE(handle_cli_radio_set_debug, "Enable/Disable Radio Debugging", .deprecate_cmd = &cli_radio_set_debug_deprecated),
 };
 
 /*

Modified: trunk/funcs/func_devstate.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_devstate.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/funcs/func_devstate.c (original)
+++ trunk/funcs/func_devstate.c Fri Feb  8 15:26:32 2008
@@ -127,7 +127,7 @@
 	return ast_devstate_val(buf);
 }
 
-static char *cli_funcdevstate_list(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_funcdevstate_list(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct ast_db_entry *db_entry, *db_tree;
 
@@ -171,8 +171,53 @@
 	return CLI_SUCCESS;
 }
 
+static char *handle_cli_devstate_list(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	struct ast_db_entry *db_entry, *db_tree;
+
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "devstate list";
+		e->usage =
+			"Usage: devstate list\n"
+			"       List all custom device states that have been set by using\n"
+			"       the DEVICE_STATE dialplan function.\n";
+		return NULL;
+	case CLI_GENERATE:
+		return NULL;
+	}
+
+	if (a->argc != e->args)
+		return CLI_SHOWUSAGE;
+
+	ast_cli(a->fd, "\n"
+	        "---------------------------------------------------------------------\n"
+	        "--- Custom Device States --------------------------------------------\n"
+	        "---------------------------------------------------------------------\n"
+	        "---\n");
+
+	db_entry = db_tree = ast_db_gettree(astdb_family, NULL);
+	for (; db_entry; db_entry = db_entry->next) {
+		const char *dev_name = strrchr(db_entry->key, '/') + 1;
+		if (dev_name <= (const char *) 1)
+			continue;
+		ast_cli(a->fd, "--- Name: 'Custom:%s'  State: '%s'\n"
+		               "---\n", dev_name, db_entry->data);
+	}
+	ast_db_freetree(db_tree);
+	db_tree = NULL;
+
+	ast_cli(a->fd,
+	        "---------------------------------------------------------------------\n"
+	        "---------------------------------------------------------------------\n"
+	        "\n");
+
+	return CLI_SUCCESS;
+}
+
+static struct ast_cli_entry cli_funcdevstate_list_deprecated = AST_CLI_DEFINE(handle_cli_funcdevstate_list, "List currently known custom device states");
 static struct ast_cli_entry cli_funcdevstate[] = {
-	AST_CLI_DEFINE(cli_funcdevstate_list, "List currently known custom device states"),
+	AST_CLI_DEFINE(handle_cli_devstate_list, "List currently known custom device states", .deprecate_cmd = &cli_funcdevstate_list_deprecated),
 };
 
 static struct ast_custom_function devstate_function = {

Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Fri Feb  8 15:26:32 2008
@@ -1535,28 +1535,36 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "stop now";
+		e->command = "core stop now";
 		e->usage = 
-			"Usage: stop now\n"
+			"Usage: core stop now\n"
 			"       Shuts down a running Asterisk immediately, hanging up all active calls .\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 2)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	quit_handler(0, 0 /* Not nice */, 1 /* safely */, 0 /* not restart */);
 	return CLI_SUCCESS;
 }
 
+static char *handle_stop_now_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_stop_now(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "stop now";
+	return res;
+}
+
 static char *handle_stop_gracefully(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "stop gracefully";
+		e->command = "core stop gracefully";
 		e->usage = 
-			"Usage: stop gracefully\n"
+			"Usage: core stop gracefully\n"
 			"       Causes Asterisk to not accept new calls, and exit when all\n"
 			"       active calls have terminated normally.\n";
 		return NULL;
@@ -1564,39 +1572,55 @@
 		return NULL;
 	}
 
-	if (a->argc != 2)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	quit_handler(0, 1 /* nicely */, 1 /* safely */, 0 /* no restart */);
 	return CLI_SUCCESS;
 }
 
+static char *handle_stop_gracefully_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_stop_gracefully(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "stop gracefully";
+	return res;
+}
+
 static char *handle_stop_when_convenient(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "stop when convenient";
+		e->command = "core stop when convenient";
 		e->usage = 
-			"Usage: stop when convenient\n"
+			"Usage: core stop when convenient\n"
 			"       Causes Asterisk to perform a shutdown when all active calls have ended.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 3)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	ast_cli(a->fd, "Waiting for inactivity to perform halt\n");
 	quit_handler(0, 2 /* really nicely */, 1 /* safely */, 0 /* don't restart */);
 	return CLI_SUCCESS;
 }
 
+static char *handle_stop_when_convenient_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_stop_when_convenient(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "stop when convenient";
+	return res;
+}
+
 static char *handle_restart_now(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "restart now";
+		e->command = "core restart now";
 		e->usage = 
-			"Usage: restart now\n"
+			"Usage: core restart now\n"
 			"       Causes Asterisk to hangup all calls and exec() itself performing a cold\n"
 			"       restart.\n";
 		return NULL;
@@ -1604,19 +1628,27 @@
 		return NULL;
 	}
 
-	if (a->argc != 2)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	quit_handler(0, 0 /* not nicely */, 1 /* safely */, 1 /* restart */);
 	return CLI_SUCCESS;
 }
 
+static char *handle_restart_now_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_restart_now(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "restart now";
+	return res;
+}
+
 static char *handle_restart_gracefully(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "restart gracefully";
+		e->command = "core restart gracefully";
 		e->usage = 
-			"Usage: restart gracefully\n"
+			"Usage: core restart gracefully\n"
 			"       Causes Asterisk to stop accepting new calls and exec() itself performing a cold\n"
 			"       restart when all active calls have ended.\n";
 		return NULL;
@@ -1624,39 +1656,55 @@
 		return NULL;
 	}
 
-	if (a->argc != 2)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	quit_handler(0, 1 /* nicely */, 1 /* safely */, 1 /* restart */);
 	return CLI_SUCCESS;
 }
 
+static char *handle_restart_gracefully_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_restart_gracefully(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "restart gracefully";
+	return res;
+}
+
 static char *handle_restart_when_convenient(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "restart when convenient";
+		e->command = "core restart when convenient";
 		e->usage = 
-			"Usage: restart when convenient\n"
+			"Usage: core restart when convenient\n"
 			"       Causes Asterisk to perform a cold restart when all active calls have ended.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 3)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	ast_cli(a->fd, "Waiting for inactivity to perform restart\n");
 	quit_handler(0, 2 /* really nicely */, 1 /* safely */, 1 /* restart */);
 	return CLI_SUCCESS;
 }
 
+static char *handle_restart_when_convenient_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_restart_when_convenient(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "restart when convenient";
+	return res;
+}
+
 static char *handle_abort_shutdown(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "abort shutdown";
+		e->command = "core abort shutdown";
 		e->usage = 
-			"Usage: abort shutdown\n"
+			"Usage: core abort shutdown\n"
 			"       Causes Asterisk to abort an executing shutdown or restart, and resume normal\n"
 			"       call operations.\n";
 		return NULL;
@@ -1664,11 +1712,19 @@
 		return NULL;
 	}
 
-	if (a->argc != 2)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	ast_cancel_shutdown();
 	shuttingdown = 0;
 	return CLI_SUCCESS;
+}
+
+static char *handle_abort_shutdown_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_abort_shutdown(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "abort shutdown";
+	return res;
 }
 
 static char *handle_bang(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -1770,14 +1826,24 @@
 
 #define ASTERISK_PROMPT2 "%s*CLI> "
 
+/* deprecated cli entries */
+static struct ast_cli_entry cli_abort_shutdown_deprecated = AST_CLI_DEFINE(handle_abort_shutdown_deprecated, "Cancel a running shutdown.");
+static struct ast_cli_entry cli_stop_now_deprecated = AST_CLI_DEFINE(handle_stop_now_deprecated, "Shut down Asterisk immediately.");
+static struct ast_cli_entry cli_stop_gracefully_deprecated = AST_CLI_DEFINE(handle_stop_gracefully_deprecated, "Gracefully shut down Asterisk.");
+static struct ast_cli_entry cli_stop_when_convenient_deprecated = AST_CLI_DEFINE(handle_stop_when_convenient_deprecated, "Shut down Asterisk at empty call volume.");
+static struct ast_cli_entry cli_restart_now_deprecated = AST_CLI_DEFINE(handle_restart_now_deprecated, "Restart Asterisk immediately.");
+static struct ast_cli_entry cli_restart_gracefully_deprecated = AST_CLI_DEFINE(handle_restart_gracefully_deprecated, "Restart Asterisk gracefully.");
+static struct ast_cli_entry cli_restart_when_convenient_deprecated = AST_CLI_DEFINE(handle_restart_when_convenient_deprecated, "Restart Asterisk at empty call volume.");
+/* end deprecated cli entries */
+
 static struct ast_cli_entry cli_asterisk[] = {
-	AST_CLI_DEFINE(handle_abort_shutdown, "Cancel a running shutdown"),
-	AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately"),
-	AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk"),
-	AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
-	AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"), 
-	AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully"),
-	AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
+	AST_CLI_DEFINE(handle_abort_shutdown, "Cancel a running shutdown", .deprecate_cmd = &cli_abort_shutdown_deprecated),
+	AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately", .deprecate_cmd = &cli_stop_now_deprecated),
+	AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk", .deprecate_cmd = &cli_stop_gracefully_deprecated),
+	AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume", .deprecate_cmd = &cli_stop_when_convenient_deprecated),
+	AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately", .deprecate_cmd = &cli_restart_now_deprecated), 
+	AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully", .deprecate_cmd = &cli_restart_gracefully_deprecated),
+	AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume", .deprecate_cmd = &cli_restart_when_convenient_deprecated),
 	AST_CLI_DEFINE(show_warranty, "Show the warranty (if any) for this copy of Asterisk"),
 	AST_CLI_DEFINE(show_license, "Show the license(s) for this copy of Asterisk"),
 	AST_CLI_DEFINE(handle_version, "Display version info"),

Modified: trunk/main/cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Fri Feb  8 15:26:32 2008
@@ -1236,16 +1236,16 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "cdr status";
+		e->command = "cdr show status";
 		e->usage = 
-			"Usage: cdr status\n"
+			"Usage: cdr show status\n"
 			"	Displays the Call Detail Record engine system status.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc > 2)
+	if (a->argc > 3)
 		return CLI_SHOWUSAGE;
 
 	ast_cli(a->fd, "CDR logging: %s\n", enabled ? "enabled" : "disabled");
@@ -1274,6 +1274,14 @@
 	return CLI_SUCCESS;
 }
 
+static char *handle_cli_status_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	char *res = handle_cli_status(e, cmd, a);
+	if (cmd == CLI_INIT)
+		e->command = "cdr status";
+	return res;
+}
+
 static char *handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	switch (cmd) {
@@ -1296,7 +1304,8 @@
 }
 
 static struct ast_cli_entry cli_submit = AST_CLI_DEFINE(handle_cli_submit, "Posts all pending batched CDR data");
-static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CDR status");
+static struct ast_cli_entry cli_status_deprecated = AST_CLI_DEFINE(handle_cli_status_deprecated, "Display the CDR status");
+static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CDR status", .deprecate_cmd = &cli_status_deprecated);
 
 static int do_reload(int reload)
 {

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=103171&r1=103170&r2=103171
==============================================================================
--- trunk/main/pbx.c (original)

[... 1003 lines stripped ...]



More information about the asterisk-commits mailing list