From acd56d2fe2a0458801010cc6b03c524023cbc597 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 22 Aug 2010 18:00:40 -0500 Subject: [PATCH] expose ASR start_input_timers on the IVR abstraction level --- src/include/switch_ivr.h | 8 ++++++++ src/switch_ivr_async.c | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h index 40ba1dc16f..692ad8d61b 100644 --- a/src/include/switch_ivr.h +++ b/src/include/switch_ivr.h @@ -26,6 +26,7 @@ * Anthony Minessale II * Neal Horman * Bret McDanel + * Luke Dashjr (OpenMethods, LLC) * * switch_ivr.h -- IVR Library * @@ -200,6 +201,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c 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 diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 4fe5732f82..ae23d0a9f4 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -26,6 +26,7 @@ * Anthony Minessale II * Michael Jerris * Bret McDanel + * Luke Dashjr (OpenMethods, LLC) * * switch_ivr_async.c -- IVR Library (async operations) * @@ -2728,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);