mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
Finalization of speech detect interface and API
This changes the core to have the necessary tools to create a speech detection interface. It also changes the code in javascript (mod_spidermonkey) there are a few api changes in how it handles callbacks It also adds grammars as a system dir to store asr grammars git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3291 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -69,12 +69,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session);
|
||||
\param dtmf_callback code to execute if any dtmf is dialed during the recording
|
||||
\param buf an object to maintain across calls
|
||||
\param buflen the size of buf
|
||||
\param timeout a timeout in milliseconds
|
||||
\return SWITCH_STATUS_SUCCESS to keep the collection moving.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session,
|
||||
switch_input_callback_function_t dtmf_callback,
|
||||
void *buf,
|
||||
unsigned int buflen);
|
||||
switch_input_callback_function_t dtmf_callback,
|
||||
void *buf,
|
||||
unsigned int buflen,
|
||||
unsigned int timeout);
|
||||
|
||||
/*!
|
||||
\brief Wait for specified number of DTMF digits, untile terminator is received or until the channel hangs up.
|
||||
@@ -95,6 +97,61 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
|
||||
char *terminator,
|
||||
unsigned int timeout);
|
||||
|
||||
/*!
|
||||
\brief Engage background Speech detection on a session
|
||||
\param session the session to attach
|
||||
\param mod_name the module name of the ASR library
|
||||
\param grammar the grammar name
|
||||
\param path the path to the grammar file
|
||||
\param dest the destination address
|
||||
\param ah an ASR handle to use (NULL to create one)
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *session,
|
||||
char *mod_name,
|
||||
char *grammar,
|
||||
char *path,
|
||||
char *dest,
|
||||
switch_asr_handle_t *ah);
|
||||
|
||||
/*!
|
||||
\brief Stop background Speech detection on a session
|
||||
\param session The session to stop detection on
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Pause background Speech detection on a session
|
||||
\param session The session to pause detection on
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_pause_detect_speech(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Resume background Speech detection on a session
|
||||
\param session The session to resume detection on
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Load a grammar on a background speech detection handle
|
||||
\param session The session to change the grammar on
|
||||
\param grammar the grammar name
|
||||
\param path the grammar path
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar, char *path);
|
||||
|
||||
/*!
|
||||
\brief Unload a grammar on a background speech detection handle
|
||||
\param session The session to change the grammar on
|
||||
\param grammar the grammar name
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, char *grammar);
|
||||
|
||||
/*!
|
||||
\brief Record a session to disk
|
||||
\param session the session to record
|
||||
|
Reference in New Issue
Block a user