summaryrefslogtreecommitdiff
path: root/apps/app_speech_utils.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2012-10-01 12:29:04 +0000
committerJoshua Colp <jcolp@digium.com>2012-10-01 12:29:04 +0000
commit0fc114dc656087cd095da88a6572841a41ced193 (patch)
treed73731b4394a478d67405951d74e6c5627e7c5f5 /apps/app_speech_utils.c
parentc3c317433f4a390c9af01d635787f78bfa34e60c (diff)
Add support for retrieving engine specific settings using the speech API and from dialplan.
(closes issue ASTERISK-17136) Reported by: kenner git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_speech_utils.c')
-rw-r--r--apps/app_speech_utils.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 3e071c07a..011d655ea 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -213,7 +213,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$");
</function>
<function name="SPEECH_ENGINE" language="en_US">
<synopsis>
- Change a speech engine specific attribute.
+ Get or change a speech engine specific attribute.
</synopsis>
<syntax>
<parameter name="name" required="true" />
@@ -401,7 +401,7 @@ static struct ast_custom_function speech_grammar_function = {
.write = NULL,
};
-/*! \brief SPEECH_ENGINE() Dialplan Function */
+/*! \brief SPEECH_ENGINE() Dialplan Set Function */
static int speech_engine_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
{
struct ast_speech *speech = find_speech(chan);
@@ -415,9 +415,21 @@ static int speech_engine_write(struct ast_channel *chan, const char *cmd, char *
return 0;
}
+/*! \brief SPEECH_ENGINE() Dialplan Get Function */
+static int speech_engine_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
+{
+ struct ast_speech *speech = find_speech(chan);
+
+ if (!data || !speech) {
+ return -1;
+ }
+
+ return ast_speech_get_setting(speech, data, buf, len);
+}
+
static struct ast_custom_function speech_engine_function = {
.name = "SPEECH_ENGINE",
- .read = NULL,
+ .read = speech_engine_read,
.write = speech_engine_write,
};