forked from Mirrors/freeswitch
Add fsctl shutdown_check to see if we're currently shutting down
This commit is contained in:
parent
13a5f4eee0
commit
6bd82d1fb4
@ -1539,7 +1539,8 @@ typedef enum {
|
|||||||
SCSC_SAVE_HISTORY,
|
SCSC_SAVE_HISTORY,
|
||||||
SCSC_CRASH,
|
SCSC_CRASH,
|
||||||
SCSC_MIN_IDLE_CPU,
|
SCSC_MIN_IDLE_CPU,
|
||||||
SCSC_VERBOSE_EVENTS
|
SCSC_VERBOSE_EVENTS,
|
||||||
|
SCSC_SHUTDOWN_CHECK
|
||||||
} switch_session_ctl_t;
|
} switch_session_ctl_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -1563,6 +1563,9 @@ SWITCH_STANDARD_API(ctl_function)
|
|||||||
} else if (!strcasecmp(argv[0], "save_history")) {
|
} else if (!strcasecmp(argv[0], "save_history")) {
|
||||||
switch_core_session_ctl(SCSC_SAVE_HISTORY, NULL);
|
switch_core_session_ctl(SCSC_SAVE_HISTORY, NULL);
|
||||||
stream->write_function(stream, "+OK\n");
|
stream->write_function(stream, "+OK\n");
|
||||||
|
} else if (!strcasecmp(argv[0], "shutdown_check")) {
|
||||||
|
switch_core_session_ctl(SCSC_SHUTDOWN_CHECK, &arg);
|
||||||
|
stream->write_function(stream, arg ? "true" : "false");
|
||||||
} else if (!strcasecmp(argv[0], "shutdown")) {
|
} else if (!strcasecmp(argv[0], "shutdown")) {
|
||||||
switch_session_ctl_t command = SCSC_SHUTDOWN;
|
switch_session_ctl_t command = SCSC_SHUTDOWN;
|
||||||
int x = 0;
|
int x = 0;
|
||||||
|
@ -1772,6 +1772,9 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SCSC_SHUTDOWN_CHECK:
|
||||||
|
newintval = !!switch_test_flag((&runtime), SCF_SHUTDOWN_REQUESTED);
|
||||||
|
break;
|
||||||
case SCSC_SHUTDOWN:
|
case SCSC_SHUTDOWN:
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
Loading…
Reference in New Issue
Block a user