]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
set session loglevel as well in fs_cli when doing 'console loglevel info' also now...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 2 Apr 2012 16:58:00 +0000 (11:58 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 2 Apr 2012 16:58:00 +0000 (11:58 -0500)
libs/esl/fs_cli.c

index 36651e49d8e8ce85d9051813f36c28a9e545318a..875b359ec3f7cd51b2ea57137badb16a0527f10f 100644 (file)
@@ -747,6 +747,8 @@ static const char *cli_usage =
 static int process_command(esl_handle_t *handle, const char *cmd)
 {
        while (*cmd == ' ') cmd++;
+
+
        if ((*cmd == '/' && cmd++) || !strncasecmp(cmd, "...", 3)) {
                if (!strcasecmp(cmd, "help")) {
                        output_printf("%s", cli_usage);
@@ -793,6 +795,13 @@ static int process_command(esl_handle_t *handle, const char *cmd)
        } else {
                char cmd_str[1024] = "";
                const char *err = NULL;
+
+               if (!strncasecmp(cmd, "console loglevel ", 17)) { 
+                       snprintf(cmd_str, sizeof(cmd_str), "log %s", cmd + 17);
+                       esl_send_recv(handle, cmd_str);
+                       printf("%s\n", handle->last_sr_reply);
+               }
+
                snprintf(cmd_str, sizeof(cmd_str), "api %s\nconsole_execute: true\n\n", cmd);
                if (esl_send_recv(handle, cmd_str)) {
                        output_printf("Socket interrupted, bye!\n");