diff --git a/src/include/switch_types.h b/src/include/switch_types.h index d7f5bc747e..e90abe2dd3 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1994,6 +1994,7 @@ typedef enum { SCSC_DEBUG_LEVEL, SCSC_FLUSH_DB_HANDLES, SCSC_SHUTDOWN_NOW, + SCSC_REINCARNATE_NOW, SCSC_CALIBRATE_CLOCK, SCSC_SAVE_HISTORY, SCSC_CRASH, diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 0d826f3c2a..e418b1b297 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -2268,6 +2268,10 @@ SWITCH_STANDARD_API(ctl_function) command = SCSC_SHUTDOWN_NOW; } else if (!strcasecmp(argv[x], "asap")) { command = SCSC_SHUTDOWN_ASAP; + } else if (!strcasecmp(argv[x], "reincarnate") + && (x+1 < argc) && argv[x+1] && !strcasecmp(argv[x+1], "now")) { + ++x; + command = SCSC_REINCARNATE_NOW; } else if (!strcasecmp(argv[x], "restart")) { arg = 1; } @@ -6746,6 +6750,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) switch_console_set_complete("add fsctl shutdown cancel"); switch_console_set_complete("add fsctl shutdown elegant"); switch_console_set_complete("add fsctl shutdown elegant restart"); + switch_console_set_complete("add fsctl shutdown reincarnate now"); switch_console_set_complete("add fsctl shutdown restart"); switch_console_set_complete("add fsctl shutdown restart asap"); switch_console_set_complete("add fsctl shutdown restart elegant"); diff --git a/src/switch_core.c b/src/switch_core.c index 9a72a5a78d..321bd0dd75 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -2421,6 +2421,10 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void * switch_console_save_history(); exit(0); break; + case SCSC_REINCARNATE_NOW: + switch_console_save_history(); + exit(SWITCH_STATUS_RESTART); + break; case SCSC_SHUTDOWN_ELEGANT: case SCSC_SHUTDOWN_ASAP: {