mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 17:22:21 +00:00
add ... and shitdown as a fail-safe when no modules are loaded
This commit is contained in:
parent
0bdc156882
commit
3e4986a00a
@ -304,6 +304,7 @@ static int switch_console_process(char *xcmd)
|
|||||||
switch_stream_handle_t stream = { 0 };
|
switch_stream_handle_t stream = { 0 };
|
||||||
switch_status_t status;
|
switch_status_t status;
|
||||||
FILE *handle = switch_core_get_console();
|
FILE *handle = switch_core_get_console();
|
||||||
|
int r = 1;
|
||||||
|
|
||||||
SWITCH_STANDARD_STREAM(stream);
|
SWITCH_STANDARD_STREAM(stream);
|
||||||
switch_assert(stream.data);
|
switch_assert(stream.data);
|
||||||
@ -316,6 +317,9 @@ static int switch_console_process(char *xcmd)
|
|||||||
fflush(handle);
|
fflush(handle);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!strcasecmp(xcmd, "...") || !strcasecmp(xcmd, "shutdown")) {
|
||||||
|
r = 0;
|
||||||
|
}
|
||||||
if (handle) {
|
if (handle) {
|
||||||
fprintf(handle, "Unknown Command: %s\n", xcmd);
|
fprintf(handle, "Unknown Command: %s\n", xcmd);
|
||||||
fflush(handle);
|
fflush(handle);
|
||||||
@ -324,7 +328,7 @@ static int switch_console_process(char *xcmd)
|
|||||||
|
|
||||||
switch_safe_free(stream.data);
|
switch_safe_free(stream.data);
|
||||||
|
|
||||||
return 1;
|
return r;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user