add preprocess framework for agc ec etc, ALPHA, needs work

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14960 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-09-23 22:39:00 +00:00
parent f3b33b9521
commit 113c45bf4b
4 changed files with 324 additions and 0 deletions
@@ -1529,6 +1529,29 @@ SWITCH_STANDARD_API(kill_function)
return SWITCH_STATUS_SUCCESS;
}
#define PREPROCESS_SYNTAX "<>"
SWITCH_STANDARD_API(preprocess_function)
{
switch_core_session_t *ksession = NULL;
char *mycmd = NULL;
if (switch_strlen_zero(cmd)) {
stream->write_function(stream, "-USAGE: %s\n", KILL_SYNTAX);
return SWITCH_STATUS_SUCCESS;
}
if (!(ksession = switch_core_session_locate(cmd))) {
stream->write_function(stream, "-ERR No Such Channel!\n");
} else {
switch_ivr_preprocess_session(session, (char *)cmd);
switch_core_session_rwunlock(ksession);
stream->write_function(stream, "+OK\n");
}
switch_safe_free(mycmd);
return SWITCH_STATUS_SUCCESS;
}
#define PARK_SYNTAX "<uuid>"
SWITCH_STANDARD_API(park_function)
{
@@ -3580,6 +3603,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
SWITCH_ADD_API(commands_api_interface, "originate", "Originate a Call", originate_function, ORIGINATE_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "tone_detect", "Start Tone Detection on a channel", tone_detect_session_function, TONE_DETECT_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_kill", "Kill Channel", kill_function, KILL_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_preprocess", "Pre-process Channel", preprocess_function, PREPROCESS_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_park", "Park Channel", park_function, PARK_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "reloadacl", "Reload ACL", reload_acl_function, "[reloadxml]");
switch_console_set_complete("add reloadacl reloadxml");
@@ -2022,6 +2022,11 @@ SWITCH_STANDARD_APP(record_function)
}
}
SWITCH_STANDARD_APP(preprocess_session_function)
{
switch_ivr_preprocess_session(session, (char *)data);
}
SWITCH_STANDARD_APP(record_session_function)
{
char *path = NULL;
@@ -2806,6 +2811,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "record_session", "Record Session", SESS_REC_DESC, record_session_function, "<path> [+<timeout>]", SAF_NONE);
SWITCH_ADD_APP(app_interface, "record", "Record File", "Record a file from the channels input", record_function,
"<path> [<time_limit_secs>] [<silence_thresh>] [<silence_hits>]", SAF_NONE);
SWITCH_ADD_APP(app_interface, "preprocess", "pre-process", "pre-process", preprocess_session_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "stop_displace_session", "Stop Displace File", "Stop Displacing to a file", stop_displace_session_function, "<path>",
SAF_NONE);
SWITCH_ADD_APP(app_interface, "displace_session", "Displace File", DISPLACE_DESC, displace_session_function, "<path> [<flags>] [+time_limit_ms]",