]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
dont transmit console replies over the logger engine
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 29 Dec 2008 23:38:59 +0000 (23:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 29 Dec 2008 23:38:59 +0000 (23:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10996 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_console.c

index b44d5347555303d546c63752ec6f21b528d90c62..bde9ecc499e8c7909e90ed04467c1a09b4295d06 100644 (file)
@@ -249,10 +249,18 @@ static int switch_console_process(char *cmd, int rec)
 
        SWITCH_STANDARD_STREAM(stream);
        if (stream.data) {
+               FILE *handle = switch_core_get_console();
+
                if (switch_api_execute(cmd, arg, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", (char *) stream.data);
+                       if (handle) {
+                               fprintf(handle, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", (char *) stream.data);
+                               fflush(handle);
+                       }
                } else {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Unknown Command: %s\n", cmd);
+                       if (handle) {
+                               fprintf(handle, "Unknown Command: %s\n", cmd);
+                               fflush(handle);
+                       }
                }
                free(stream.data);
        } else {