const qualifiers in asr/tts interfaces.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6121 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-11-01 11:55:00 +00:00
parent 622a2733dc
commit 7b6182aa13
5 changed files with 30 additions and 15 deletions

View File

@ -1252,8 +1252,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_close(switch_speech_handle_t
\return SWITCH_STATUS_SUCCESS if the asr handle was opened
*/
SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
char *module_name,
char *codec, int rate, char *dest, switch_asr_flag_t *flags, switch_memory_pool_t *pool);
const char *module_name,
const char *codec,
int rate,
const char *dest,
switch_asr_flag_t *flags,
switch_memory_pool_t *pool);
/*!
\brief Close an asr handle
@ -1297,7 +1301,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_get_results(switch_asr_handle_t
\param path the path to the grammaar file
\return SWITCH_STATUS_SUCCESS
*/
SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t *ah, char *grammar, char *path);
SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t *ah, const char *grammar, const char *path);
/*!
\brief Unload a grammar from an asr handle
@ -1305,7 +1309,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
\param grammar the grammar to unload
\return SWITCH_STATUS_SUCCESS
*/
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, char *grammar);
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *grammar);
/*!
\brief Pause detection on an asr handle

View File

@ -153,7 +153,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
\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);
const char *mod_name,
const char *grammar,
const char *path,
const char *dest, switch_asr_handle_t *ah);
/*!
\brief Stop background Speech detection on a session
@ -191,7 +194,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_cor
\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);
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *grammar);
/*!
\brief Record a session to disk

View File

@ -294,11 +294,11 @@ struct switch_asr_interface {
/*! the name of the interface */
const char *interface_name;
/*! function to open the asr interface */
switch_status_t (*asr_open) (switch_asr_handle_t *ah, char *codec, int rate, char *dest, switch_asr_flag_t *flags);
switch_status_t (*asr_open) (switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags);
/*! function to load a grammar to the asr interface */
switch_status_t (*asr_load_grammar) (switch_asr_handle_t *ah, char *grammar, char *path);
switch_status_t (*asr_load_grammar) (switch_asr_handle_t *ah, const char *grammar, const char *path);
/*! function to unload a grammar to the asr interface */
switch_status_t (*asr_unload_grammar) (switch_asr_handle_t *ah, char *grammar);
switch_status_t (*asr_unload_grammar) (switch_asr_handle_t *ah, const char *grammar);
/*! function to close the asr interface */
switch_status_t (*asr_close) (switch_asr_handle_t *ah, switch_asr_flag_t *flags);
/*! function to feed audio to the ASR */

View File

@ -35,8 +35,12 @@
#include "private/switch_core_pvt.h"
SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
char *module_name,
char *codec, int rate, char *dest, switch_asr_flag_t *flags, switch_memory_pool_t *pool)
const char *module_name,
const char *codec,
int rate,
const char *dest,
switch_asr_flag_t *flags,
switch_memory_pool_t *pool)
{
switch_status_t status;
char buf[256] = "";
@ -77,7 +81,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
return ah->asr_interface->asr_open(ah, codec, rate, dest, flags);
}
SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t *ah, char *grammar, char *path)
SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t *ah, const char *grammar, const char *path)
{
char *epath = NULL;
switch_status_t status;
@ -95,7 +99,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, char *grammar)
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *grammar)
{
switch_status_t status;

View File

@ -1042,7 +1042,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_cor
}
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, char *grammar)
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *grammar)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
@ -1064,7 +1064,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c
}
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)
const char *mod_name,
const char *grammar,
const char *path,
const char *dest,
switch_asr_handle_t *ah)
{
switch_channel_t *channel;
switch_codec_t *read_codec;