提交 81e26f03 authored 作者: Anthony Minessale's avatar Anthony Minessale

add heartbeat apps

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12491 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4212af49
...@@ -2743,7 +2743,7 @@ SWITCH_STANDARD_API(help_function) ...@@ -2743,7 +2743,7 @@ SWITCH_STANDARD_API(help_function)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
#define HEARTBEAT_SYNTAX "<uuid> [sched] <on|off|<seconds>>" #define HEARTBEAT_SYNTAX "<uuid> [sched] [0|<seconds>]"
SWITCH_STANDARD_API(uuid_session_heartbeat_function) SWITCH_STANDARD_API(uuid_session_heartbeat_function)
{ {
char *mycmd = NULL, *argv[3] = { 0 }; char *mycmd = NULL, *argv[3] = { 0 };
......
...@@ -111,6 +111,42 @@ SWITCH_STANDARD_APP(detect_speech_function) ...@@ -111,6 +111,42 @@ SWITCH_STANDARD_APP(detect_speech_function)
} }
} }
#define SCHED_HEARTBEAT_SYNTAX "[0|<seconds>]"
SWITCH_STANDARD_APP(sched_heartbeat_function)
{
int seconds = 0;
if (data) {
seconds = atoi(data);
if (seconds >= 0) {
switch_core_session_sched_heartbeat(session, seconds);
return;
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", SCHED_HEARTBEAT_SYNTAX);
}
#define HEARTBEAT_SYNTAX "[0|<seconds>]"
SWITCH_STANDARD_APP(heartbeat_function)
{
int seconds = 0;
if (data) {
seconds = atoi(data);
if (seconds >= 0) {
switch_core_session_enable_heartbeat(session, seconds);
return;
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", HEARTBEAT_SYNTAX);
}
#define EXE_SYNTAX "<extension> <dialplan> <context>" #define EXE_SYNTAX "<extension> <dialplan> <context>"
SWITCH_STANDARD_APP(exe_function) SWITCH_STANDARD_APP(exe_function)
{ {
...@@ -2605,6 +2641,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) ...@@ -2605,6 +2641,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "sched_transfer", SCHED_TRANSF_DESCR, SCHED_TRANSF_DESCR, sched_transfer_function, SWITCH_ADD_APP(app_interface, "sched_transfer", SCHED_TRANSF_DESCR, SCHED_TRANSF_DESCR, sched_transfer_function,
"[+]<time> <extension> <dialplan> <context>", SAF_SUPPORT_NOMEDIA); "[+]<time> <extension> <dialplan> <context>", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "execute_extension", "Execute an extension", "Execute an extension", exe_function, EXE_SYNTAX, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "execute_extension", "Execute an extension", "Execute an extension", exe_function, EXE_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "sched_heartbeat", "Enable Scheduled Heartbeat", "Enable Scheduled Heartbeat",
sched_heartbeat_function, SCHED_HEARTBEAT_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "enable_heartbeat", "Enable Media Heartbeat", "Enable Media Heartbeat",
heartbeat_function, HEARTBEAT_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "mkdir", "Create a directory", "Create a directory", mkdir_function, MKDIR_SYNTAX, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "mkdir", "Create a directory", "Create a directory", mkdir_function, MKDIR_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "soft_hold", "Put a bridged channel on hold", "Put a bridged channel on hold", soft_hold_function, SOFT_HOLD_SYNTAX, SWITCH_ADD_APP(app_interface, "soft_hold", "Put a bridged channel on hold", "Put a bridged channel on hold", soft_hold_function, SOFT_HOLD_SYNTAX,
SAF_NONE); SAF_NONE);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论