From: Anthony Minessale Date: Fri, 2 Apr 2010 18:52:16 +0000 (-0500) Subject: add ... and shitdown as a fail-safe when no modules are loaded X-Git-Tag: v1.0.6~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e4986a00a2671465e4035db9abfa5e89b6c8d77;p=thirdparty%2Ffreeswitch.git add ... and shitdown as a fail-safe when no modules are loaded --- diff --git a/src/switch_console.c b/src/switch_console.c index 68f7df3575..a5e78f28d8 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -304,6 +304,7 @@ static int switch_console_process(char *xcmd) switch_stream_handle_t stream = { 0 }; switch_status_t status; FILE *handle = switch_core_get_console(); + int r = 1; SWITCH_STANDARD_STREAM(stream); switch_assert(stream.data); @@ -316,6 +317,9 @@ static int switch_console_process(char *xcmd) fflush(handle); } } else { + if (!strcasecmp(xcmd, "...") || !strcasecmp(xcmd, "shutdown")) { + r = 0; + } if (handle) { fprintf(handle, "Unknown Command: %s\n", xcmd); fflush(handle); @@ -324,7 +328,7 @@ static int switch_console_process(char *xcmd) switch_safe_free(stream.data); - return 1; + return r; }