mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-06 16:02:23 +00:00
switch_core_asr interfaces for enable_grammar, disable_grammar, and disable_all_grammars
This commit is contained in:
parent
e719ae662b
commit
4cbdfbe481
@ -24,6 +24,7 @@
|
|||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* switch_core.h -- Core Library
|
* switch_core.h -- Core Library
|
||||||
@ -1747,6 +1748,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
|
|||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Enable a grammar from an asr handle
|
||||||
|
\param ah the handle to enable the grammar from
|
||||||
|
\param name the name of the grammar to enable
|
||||||
|
\return SWITCH_STATUS_SUCCESS
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_enable_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Disable a grammar from an asr handle
|
||||||
|
\param ah the handle to disable the grammar from
|
||||||
|
\param name the name of the grammar to disable
|
||||||
|
\return SWITCH_STATUS_SUCCESS
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Disable all grammars from an asr handle
|
||||||
|
\param ah the handle to disable the grammars from
|
||||||
|
\return SWITCH_STATUS_SUCCESS
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_all_grammars(switch_asr_handle_t *ah);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Pause detection on an asr handle
|
\brief Pause detection on an asr handle
|
||||||
\param ah the handle to pause
|
\param ah the handle to pause
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* switch_module_interfaces.h -- Module Interface Definitions
|
* switch_module_interfaces.h -- Module Interface Definitions
|
||||||
@ -393,6 +394,12 @@ struct switch_asr_interface {
|
|||||||
switch_mutex_t *reflock;
|
switch_mutex_t *reflock;
|
||||||
switch_loadable_module_interface_t *parent;
|
switch_loadable_module_interface_t *parent;
|
||||||
struct switch_asr_interface *next;
|
struct switch_asr_interface *next;
|
||||||
|
/*! function to enable a grammar to the asr interface */
|
||||||
|
switch_status_t (*asr_enable_grammar) (switch_asr_handle_t *ah, const char *name);
|
||||||
|
/*! function to disable a grammar to the asr interface */
|
||||||
|
switch_status_t (*asr_disable_grammar) (switch_asr_handle_t *ah, const char *name);
|
||||||
|
/*! function to disable all grammars to the asr interface */
|
||||||
|
switch_status_t (*asr_disable_all_grammars) (switch_asr_handle_t *ah);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! an abstract representation of an asr speech interface. */
|
/*! an abstract representation of an asr speech interface. */
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
* Michael Jerris <mike@jerris.com>
|
* Michael Jerris <mike@jerris.com>
|
||||||
* Paul D. Tinsley <pdt at jackhammer.org>
|
* Paul D. Tinsley <pdt at jackhammer.org>
|
||||||
* Christopher M. Rienzo <chris@rienzo.net>
|
* Christopher M. Rienzo <chris@rienzo.net>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
|
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
|
||||||
@ -160,6 +161,45 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_enable_grammar(switch_asr_handle_t *ah, const char *name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
switch_assert(ah != NULL);
|
||||||
|
|
||||||
|
if (ah->asr_interface->asr_enable_grammar) {
|
||||||
|
status = ah->asr_interface->asr_enable_grammar(ah, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_grammar(switch_asr_handle_t *ah, const char *name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
switch_assert(ah != NULL);
|
||||||
|
|
||||||
|
if (ah->asr_interface->asr_disable_grammar) {
|
||||||
|
status = ah->asr_interface->asr_disable_grammar(ah, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_all_grammars(switch_asr_handle_t *ah)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
switch_assert(ah != NULL);
|
||||||
|
|
||||||
|
if (ah->asr_interface->asr_disable_all_grammars) {
|
||||||
|
status = ah->asr_interface->asr_disable_all_grammars(ah);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_pause(switch_asr_handle_t *ah)
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_pause(switch_asr_handle_t *ah)
|
||||||
{
|
{
|
||||||
switch_assert(ah != NULL);
|
switch_assert(ah != NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user