]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Re-enable old deprecated commands
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 13 Nov 2006 19:11:15 +0000 (19:11 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 13 Nov 2006 19:11:15 +0000 (19:11 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47573 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
main/cli.c

index 452802892ec794de0f86b34eacdd9b992e8cda3c..716a10fec815653a99370c4f31b09a43d55d046c 100644 (file)
@@ -10708,7 +10708,7 @@ static int sip_do_debug_peer(int fd, int argc, char *argv[])
 static int sip_do_debug(int fd, int argc, char *argv[])
 {
        int oldsipdebug = sipdebug_console;
-       if (argc != 4) {
+       if (argc != 3) {
                if (argc != 5) 
                        return RESULT_SHOWUSAGE;
                else if (strcmp(argv[3], "ip") == 0)
@@ -10724,6 +10724,30 @@ static int sip_do_debug(int fd, int argc, char *argv[])
        return RESULT_SUCCESS;
 }
 
+static int sip_do_debug_deprecated(int fd, int argc, char *argv[])
+{
+       int oldsipdebug = sipdebug_console;
+       char *newargv[6] = { "sip", "set", "debug", NULL };
+       if (argc != 2) {
+               if (argc != 4) 
+                       return RESULT_SHOWUSAGE;
+               else if (strcmp(argv[2], "ip") == 0) {
+                       newargv[3] = argv[2];
+                       newargv[4] = argv[3];
+                       return sip_do_debug_ip(fd, argc + 1, newargv);
+               } else if (strcmp(argv[2], "peer") == 0) {
+                       newargv[3] = argv[2];
+                       newargv[4] = argv[3];
+                       return sip_do_debug_peer(fd, argc + 1, newargv);
+               } else
+                       return RESULT_SHOWUSAGE;
+       }
+       ast_set_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONSOLE);
+       memset(&debugaddr, 0, sizeof(debugaddr));
+       ast_cli(fd, "SIP Debugging %senabled\n", oldsipdebug ? "re-" : "");
+       return RESULT_SUCCESS;
+}
+
 /*! \brief Cli command to send SIP notify to peer */
 static int sip_notify(int fd, int argc, char *argv[])
 {
@@ -10790,6 +10814,15 @@ static int sip_no_debug(int fd, int argc, char *argv[])
        return RESULT_SUCCESS;
 }
 
+static int sip_no_debug_deprecated(int fd, int argc, char *argv[])
+{
+       if (argc != 3)
+               return RESULT_SHOWUSAGE;
+       ast_clear_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONSOLE);
+       ast_cli(fd, "SIP Debugging Disabled\n");
+       return RESULT_SUCCESS;
+}
+
 /*! \brief Enable SIP History logging (CLI) */
 static int sip_do_history(int fd, int argc, char *argv[])
 {
@@ -11056,16 +11089,16 @@ static char show_reg_usage[] =
 "       Lists all registration requests and status.\n";
 
 static char debug_usage[] = 
-"Usage: sip debug\n"
+"Usage: sip set debug\n"
 "       Enables dumping of SIP packets for debugging purposes\n\n"
-"       sip debug ip <host[:PORT]>\n"
+"       sip set debug ip <host[:PORT]>\n"
 "       Enables dumping of SIP packets to and from host.\n\n"
-"       sip debug peer <peername>\n"
+"       sip set debug peer <peername>\n"
 "       Enables dumping of SIP packets to and from host.\n"
 "       Require peer to be registered.\n";
 
 static char no_debug_usage[] = 
-"Usage: sip debug off\n"
+"Usage: sip set debug off\n"
 "       Disables dumping of SIP packets for debugging purposes\n";
 
 static char no_history_usage[] = 
@@ -16838,6 +16871,16 @@ static int reload(void)
        return sip_reload(0, 0, NULL);
 }
 
+static struct ast_cli_entry cli_sip_debug_deprecated =
+       { { "sip", "debug", NULL },
+       sip_do_debug_deprecated, "Enable SIP debugging",
+       debug_usage };
+
+static struct ast_cli_entry cli_sip_no_debug_deprecated =
+       { { "sip", "no", "debug", NULL },
+       sip_no_debug_deprecated, "Disable SIP debugging",
+       debug_usage };
+
 static struct ast_cli_entry cli_sip[] = {
        { { "sip", "show", "channels", NULL },
        sip_show_channels, "List active SIP channels",
@@ -16909,7 +16952,7 @@ static struct ast_cli_entry cli_sip[] = {
 
        { { "sip", "set", "debug", NULL },
        sip_do_debug, "Enable SIP debugging",
-       debug_usage },
+       debug_usage, NULL, &cli_sip_debug_deprecated },
 
        { { "sip", "set", "debug", "ip", NULL },
        sip_do_debug, "Enable SIP debugging on IP",
@@ -16921,7 +16964,7 @@ static struct ast_cli_entry cli_sip[] = {
 
        { { "sip", "set", "debug", "off", NULL },
        sip_no_debug, "Disable SIP debugging",
-       no_debug_usage },
+       no_debug_usage, NULL, &cli_sip_no_debug_deprecated },
 
        { { "sip", "history", NULL },
        sip_do_history, "Enable SIP history",
index 3b6b3dc298cea2923983c942d151146b53f6a7ba..b9afbd89bebf9714fe711e58cd5b2fcc9fef7c87 100644 (file)
@@ -481,7 +481,7 @@ static int modlist_modentry(const char *module, const char *description, int use
 }
 
 static char modlist_help[] =
-"Usage: core show modules [like keyword]\n"
+"Usage: module show [like <keyword>]\n"
 "       Shows Asterisk modules currently in use, and usage statistics.\n";
 
 static char uptime_help[] =