Asterisk - The Open Source Telephony Project  21.4.1
Enumerations | Functions | Variables
app_speech_utils.c File Reference

Speech Recognition Utility Applications. More...

#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/app.h"
#include "asterisk/speech.h"

Go to the source code of this file.

Enumerations

enum  { SB_OPT_NOANSWER = (1 << 0), SB_OPT_PARTIALRESULTS = (1 << 1) }
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static void destroy_callback (void *data)
 Helper function used by datastores to destroy the speech structure upon hangup.
 
static struct ast_speech_resultfind_result (struct ast_speech_result *results, char *result_num)
 
static struct ast_speechfind_speech (struct ast_channel *chan)
 Helper function used to find the speech structure attached to a channel.
 
static int load_module (void)
 
static int speech_activate (struct ast_channel *chan, const char *data)
 SpeechActivateGrammar(Grammar Name) Dialplan Application.
 
static int speech_background (struct ast_channel *chan, const char *data)
 SpeechBackground(Sound File,Timeout) Dialplan Application.
 
static int speech_create (struct ast_channel *chan, const char *data)
 SpeechCreate() Dialplan Application.
 
static int speech_datastore_destroy (struct ast_channel *chan)
 
static int speech_deactivate (struct ast_channel *chan, const char *data)
 SpeechDeactivateGrammar(Grammar Name) Dialplan Application.
 
static int speech_destroy (struct ast_channel *chan, const char *data)
 SpeechDestroy() Dialplan Application.
 
static int speech_engine_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_ENGINE() Dialplan Get Function.
 
static int speech_engine_write (struct ast_channel *chan, const char *cmd, char *data, const char *value)
 SPEECH_ENGINE() Dialplan Set Function.
 
static int speech_grammar (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_GRAMMAR() Dialplan Function.
 
static int speech_load (struct ast_channel *chan, const char *vdata)
 SpeechLoadGrammar(Grammar Name,Path) Dialplan Application.
 
static int speech_processing_sound (struct ast_channel *chan, const char *data)
 SpeechProcessingSound(Sound File) Dialplan Application.
 
static int speech_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH() Dialplan Function.
 
static int speech_results_type_write (struct ast_channel *chan, const char *cmd, char *data, const char *value)
 SPEECH_RESULTS_TYPE() Dialplan Function.
 
static int speech_score (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_SCORE() Dialplan Function.
 
static int speech_start (struct ast_channel *chan, const char *data)
 SpeechStart() Dialplan Application.
 
static int speech_streamfile (struct ast_channel *chan, const char *filename, const char *preflang)
 Helper function used by speech_background to playback a soundfile.
 
static int speech_text (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_TEXT() Dialplan Function.
 
static int speech_unload (struct ast_channel *chan, const char *data)
 SpeechUnloadGrammar(Grammar Name) Dialplan Application.
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Dialplan Speech Applications" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "da6642af068ee5e6490c5b1d2cc1d238" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_speech", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static const struct ast_app_option speech_background_options [128] = { [ 'n' ] = { .flag = SB_OPT_NOANSWER }, [ 'p' ] = { .flag = SB_OPT_PARTIALRESULTS }, }
 
static const struct ast_datastore_info speech_datastore
 Static structure for datastore information. More...
 
static struct ast_custom_function speech_engine_function
 
static struct ast_custom_function speech_function
 
static struct ast_custom_function speech_grammar_function
 
static struct ast_custom_function speech_results_type_function
 
static struct ast_custom_function speech_score_function
 
static struct ast_custom_function speech_text_function
 

Detailed Description

Speech Recognition Utility Applications.

Author
Joshua Colp jcolp.nosp@m.@dig.nosp@m.ium.c.nosp@m.om

Definition in file app_speech_utils.c.

Variable Documentation

const struct ast_datastore_info speech_datastore
static
Initial value:
= {
.type = "speech",
.destroy = destroy_callback
}
static void destroy_callback(void *data)
Helper function used by datastores to destroy the speech structure upon hangup.

Static structure for datastore information.

Definition at line 289 of file app_speech_utils.c.

struct ast_custom_function speech_engine_function
static
Initial value:
= {
.name = "SPEECH_ENGINE",
}
static int speech_engine_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_ENGINE() Dialplan Get Function.
static int speech_engine_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
SPEECH_ENGINE() Dialplan Set Function.

Definition at line 477 of file app_speech_utils.c.

struct ast_custom_function speech_function
static
Initial value:
= {
.name = "SPEECH",
.read = speech_read,
.write = NULL,
}
static int speech_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH() Dialplan Function.

Definition at line 547 of file app_speech_utils.c.

struct ast_custom_function speech_grammar_function
static
Initial value:
= {
.name = "SPEECH_GRAMMAR",
.read = speech_grammar,
.write = NULL,
}
static int speech_grammar(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_GRAMMAR() Dialplan Function.

Definition at line 445 of file app_speech_utils.c.

struct ast_custom_function speech_results_type_function
static
Initial value:
= {
.name = "SPEECH_RESULTS_TYPE",
.read = NULL,
}
static int speech_results_type_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
SPEECH_RESULTS_TYPE() Dialplan Function.

Definition at line 499 of file app_speech_utils.c.

struct ast_custom_function speech_score_function
static
Initial value:
= {
.name = "SPEECH_SCORE",
.read = speech_score,
.write = NULL,
}
static int speech_score(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_SCORE() Dialplan Function.

Definition at line 393 of file app_speech_utils.c.

struct ast_custom_function speech_text_function
static
Initial value:
= {
.name = "SPEECH_TEXT",
.read = speech_text,
.write = NULL,
}
static int speech_text(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_TEXT() Dialplan Function.

Definition at line 419 of file app_speech_utils.c.