mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 20:47:06 +00:00
add wait_for_voice app for MC
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8986 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
d2e4dee2bb
commit
381c31486c
3 files changed
+149
No files matched your search
@@ -2102,6 +2102,31 @@ SWITCH_STANDARD_APP(unhold_function)
|
||||
switch_ivr_unhold_uuid(switch_core_session_get_uuid(session));
|
||||
}
|
||||
|
||||
#define WAIT_FOR_SILENCE_SYNTAX "<tresh> <silence hits> <listen hits> [<file>]"
|
||||
SWITCH_STANDARD_APP(wait_for_silence_function)
|
||||
{
|
||||
char *argv[4] = { 0 };
|
||||
uint32_t thresh, silence_hits, listen_hits;
|
||||
int argc;
|
||||
char *lbuf = NULL;
|
||||
|
||||
if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 3) {
|
||||
thresh = atoi(argv[0]);
|
||||
silence_hits = atoi(argv[1]);
|
||||
listen_hits = atoi(argv[2]);
|
||||
|
||||
if (thresh > 0 && silence_hits > 0 && listen_hits > 0) {
|
||||
switch_ivr_wait_for_silence(session, thresh, silence_hits, listen_hits, argv[3]);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", WAIT_FOR_SILENCE_SYNTAX);
|
||||
|
||||
}
|
||||
|
||||
#define SPEAK_DESC "Speak text to a channel via the tts interface"
|
||||
#define DISPLACE_DESC "Displace audio from a file to the channels input"
|
||||
#define SESS_REC_DESC "Starts a background recording of the entire session"
|
||||
@@ -2226,6 +2251,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
|
||||
SAF_SUPPORT_NOMEDIA);
|
||||
SWITCH_ADD_APP(app_interface, "say", "say", "say", say_function, SAY_SYNTAX, SAF_NONE);
|
||||
|
||||
SWITCH_ADD_APP(app_interface, "wait_for_silence", "wait_for_silence", "wait_for_silence", wait_for_silence_function, WAIT_FOR_SILENCE_SYNTAX, SAF_NONE);
|
||||
|
||||
SWITCH_ADD_DIALPLAN(dp_interface, "inline", inline_dialplan_hunt);
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
|
||||
Reference in new issue
Block a user