aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_speech_utils.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-18 16:22:26 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-18 16:22:26 +0000
commit1e12d4e1dfa54ea93e7ed217fc18450c154f7855 (patch)
tree4867337433a34db5828536cbd38ff14bd22e6c45 /apps/app_speech_utils.c
parent1dc3bbe40360ddc1de994ea234a10b1dfb05c521 (diff)
Expand speech API so that the developer can interact with the engine more directly and use specific functions of the connector even if a generic API call is not available
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37881 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_speech_utils.c')
-rw-r--r--apps/app_speech_utils.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index c464576f7..a63eee828 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -228,6 +228,29 @@ static struct ast_custom_function speech_grammar_function = {
.write = NULL,
};
+/*! \brief SPEECH_ENGINE() Dialplan Function */
+static int speech_engine_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
+{
+ struct ast_speech *speech = find_speech(chan);
+
+ if (data == NULL || speech == NULL)
+ return -1;
+
+ ast_speech_change(speech, data, value);
+
+ return 0;
+}
+
+static struct ast_custom_function speech_engine_function = {
+ .name = "SPEECH_ENGINE",
+ .synopsis = "Change a speech engine specific attribute.",
+ .syntax = "SPEECH_ENGINE(name)=value",
+ .desc =
+ "Changes a speech engine specific attribute.\n",
+ .read = NULL,
+ .write = speech_engine_write,
+};
+
/*! \brief SPEECH() Dialplan Function */
static int speech_read(struct ast_channel *chan, char *cmd, char *data,
char *buf, size_t len)
@@ -746,6 +769,7 @@ static int unload_module(void *mod)
res |= ast_custom_function_unregister(&speech_score_function);
res |= ast_custom_function_unregister(&speech_text_function);
res |= ast_custom_function_unregister(&speech_grammar_function);
+ res |= ast_custom_function_unregister(&speech_engine_function);
STANDARD_HANGUP_LOCALUSERS;
@@ -769,6 +793,7 @@ static int load_module(void *mod)
res |= ast_custom_function_register(&speech_score_function);
res |= ast_custom_function_register(&speech_text_function);
res |= ast_custom_function_register(&speech_grammar_function);
+ res |= ast_custom_function_register(&speech_engine_function);
return res;
}