提交 46fee25d authored 作者: Anthony Minessale's avatar Anthony Minessale

add fsctl sql start/stop for standby controls

上级 cc480157
......@@ -2149,6 +2149,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_chat_send(const char *dest_proto, sw
SWITCH_DECLARE(switch_status_t) switch_core_chat_deliver(const char *dest_proto, switch_event_t **message_event);
SWITCH_DECLARE(switch_status_t) switch_ivr_preprocess_session(switch_core_session_t *session, const char *cmds);
SWITCH_DECLARE(void) switch_core_sqldb_stop_thread(void);
SWITCH_DECLARE(void) switch_core_sqldb_start_thread(void);
///\}
......
......@@ -1775,6 +1775,7 @@ typedef enum {
SCSC_THREADED_SYSTEM_EXEC,
SCSC_SYNC_CLOCK_WHEN_IDLE,
SCSC_DEBUG_SQL,
SCSC_SQL,
} switch_session_ctl_t;
typedef enum {
......
......@@ -1915,6 +1915,16 @@ SWITCH_STANDARD_API(ctl_function)
switch_core_session_ctl(SCSC_DEBUG_SQL, &x);
stream->write_function(stream, "+OK SQL DEBUG [%s]\n", x ? "on" : "off");
} else if (!strcasecmp(argv[0], "sql")) {
if (argv[1]) {
int x = 0;
if (!strcasecmp(argv[1], "start")) {
x = 1;
}
switch_core_session_ctl(SCSC_SQL, &x);
stream->write_function(stream, "+OK\n");
}
} else if (!strcasecmp(argv[0], "reclaim_mem")) {
switch_core_session_ctl(SCSC_RECLAIM, &arg);
stream->write_function(stream, "+OK\n");
......
......@@ -2125,6 +2125,13 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
case SCSC_SYNC_CLOCK_WHEN_IDLE:
newintval = switch_core_session_sync_clock();
break;
case SCSC_SQL:
if (oldintval) {
switch_core_sqldb_start_thread();
} else {
switch_core_sqldb_stop_thread();
}
break;
case SCSC_PAUSE_ALL:
if (oldintval) {
switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论