MERGE: expose ASR start_input_timers to dialplan via IVR and mod_dptools
This commit is contained in:
commit
92a9bacc44
|
@ -224,6 +224,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_all_grammars(sw
|
|||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val);
|
||||
|
||||
/*!
|
||||
\brief Start input timers on a background speech detection handle
|
||||
\param session The session to start the timers on
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Record a session to disk
|
||||
\param session the session to record
|
||||
|
|
|
@ -96,7 +96,7 @@ SWITCH_STANDARD_DIALPLAN(inline_dialplan_hunt)
|
|||
return extension;
|
||||
}
|
||||
|
||||
#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR grammaron/grammaroff <gram_name> OR grammarsalloff OR pause OR resume OR stop OR param <name> <value>"
|
||||
#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR grammaron/grammaroff <gram_name> OR grammarsalloff OR pause OR resume OR start_input_timers OR stop OR param <name> <value>"
|
||||
SWITCH_STANDARD_APP(detect_speech_function)
|
||||
{
|
||||
char *argv[4];
|
||||
|
@ -123,6 +123,8 @@ SWITCH_STANDARD_APP(detect_speech_function)
|
|||
switch_ivr_stop_detect_speech(session);
|
||||
} else if (!strcasecmp(argv[0], "param")) {
|
||||
switch_ivr_set_param_detect_speech(session, argv[1], argv[2]);
|
||||
} else if (!strcasecmp(argv[0], "start_input_timers")) {
|
||||
switch_ivr_detect_speech_start_input_timers(session);
|
||||
} else if (argc >= 3) {
|
||||
switch_ivr_detect_speech(session, argv[0], argv[1], argv[2], argv[3], NULL);
|
||||
}
|
||||
|
|
|
@ -2729,6 +2729,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_s
|
|||
return status;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||
|
||||
if (sth) {
|
||||
switch_core_asr_start_input_timers(sth->ah);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
|
Loading…
Reference in New Issue