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) } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
ASTERISK_FILE_VERSION (__FILE__,"$Revision: 419684 $") | |
static void | destroy_callback (void *data) |
Helper function used by datastores to destroy the speech structure upon hangup. More... | |
static struct ast_speech_result * | find_result (struct ast_speech_result *results, char *result_num) |
static struct ast_speech * | find_speech (struct ast_channel *chan) |
Helper function used to find the speech structure attached to a channel. More... | |
static int | load_module (void) |
static int | speech_activate (struct ast_channel *chan, const char *data) |
SpeechActivateGrammar(Grammar Name) Dialplan Application. More... | |
static int | speech_background (struct ast_channel *chan, const char *data) |
SpeechBackground(Sound File,Timeout) Dialplan Application. More... | |
static int | speech_create (struct ast_channel *chan, const char *data) |
SpeechCreate() Dialplan Application. More... | |
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. More... | |
static int | speech_destroy (struct ast_channel *chan, const char *data) |
SpeechDestroy() Dialplan Application. More... | |
static int | speech_engine_write (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
SPEECH_ENGINE() Dialplan Function. More... | |
static int | speech_grammar (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
SPEECH_GRAMMAR() Dialplan Function. More... | |
static int | speech_load (struct ast_channel *chan, const char *vdata) |
SpeechLoadGrammar(Grammar Name,Path) Dialplan Application. More... | |
static int | speech_processing_sound (struct ast_channel *chan, const char *data) |
SpeechProcessingSound(Sound File) Dialplan Application. More... | |
static int | speech_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
SPEECH() Dialplan Function. More... | |
static int | speech_results_type_write (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
SPEECH_RESULTS_TYPE() Dialplan Function. More... | |
static int | speech_score (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
SPEECH_SCORE() Dialplan Function. More... | |
static int | speech_start (struct ast_channel *chan, const char *data) |
SpeechStart() Dialplan Application. More... | |
static int | speech_streamfile (struct ast_channel *chan, const char *filename, const char *preflang) |
Helper function used by speech_background to playback a soundfile. More... | |
static int | speech_text (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
SPEECH_TEXT() Dialplan Function. More... | |
static int | speech_unload (struct ast_channel *chan, const char *data) |
SpeechUnloadGrammar(Grammar Name) Dialplan Application. More... | |
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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .nonoptreq = "res_speech", } |
static struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_app_option | speech_background_options [128] = { [ 'n' ] = { .flag = SB_OPT_NOANSWER }, } |
static 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 |
Speech Recognition Utility Applications.
Definition in file app_speech_utils.c.
anonymous enum |
Enumerator | |
---|---|
SB_OPT_NOANSWER |
Definition at line 680 of file app_speech_utils.c.
|
static |
Definition at line 995 of file app_speech_utils.c.
|
static |
Definition at line 995 of file app_speech_utils.c.
ASTERISK_FILE_VERSION | ( | __FILE__ | , |
"$Revision: 419684 $" | |||
) |
|
static |
Helper function used by datastores to destroy the speech structure upon hangup.
Definition at line 262 of file app_speech_utils.c.
References ast_speech_destroy().
|
static |
Definition at line 333 of file app_speech_utils.c.
References AST_LIST_NEXT, and ast_speech_result::nbest_num.
Referenced by speech_grammar(), speech_score(), and speech_text().
|
static |
Helper function used to find the speech structure attached to a channel.
Definition at line 283 of file app_speech_utils.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, and ast_datastore::data.
Referenced by speech_activate(), speech_background(), speech_deactivate(), speech_engine_write(), speech_grammar(), speech_load(), speech_processing_sound(), speech_read(), speech_results_type_write(), speech_score(), speech_start(), speech_text(), and speech_unload().
|
static |
Definition at line 968 of file app_speech_utils.c.
References ast_custom_function_register, ast_register_application_xml, speech_activate(), speech_background(), speech_create(), speech_deactivate(), speech_destroy(), speech_load(), speech_processing_sound(), speech_start(), and speech_unload().
|
static |
SpeechActivateGrammar(Grammar Name) Dialplan Application.
Definition at line 617 of file app_speech_utils.c.
References ast_speech_grammar_activate(), and find_speech().
Referenced by load_module().
|
static |
SpeechBackground(Sound File,Timeout) Dialplan Application.
Definition at line 689 of file app_speech_utils.c.
References ast_channel::_state, args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_calloc, ast_channel_lock, ast_channel_unlock, ast_clear_flag, AST_CONTROL_HANGUP, AST_DECLARE_APP_ARGS, AST_FORMAT_SLINEAR, AST_FRAME_CONTROL, AST_FRAME_DTMF, AST_FRAME_VOICE, ast_frfree, AST_MAX_EXTENSION, ast_mutex_lock, ast_mutex_unlock, ast_read(), ast_sched_runq(), ast_sched_wait(), ast_set_read_format(), ast_speech_change_state(), ast_speech_dtmf(), AST_SPEECH_QUIET, ast_speech_results_get(), ast_speech_start(), AST_SPEECH_STATE_DONE, AST_SPEECH_STATE_NOT_READY, AST_SPEECH_STATE_READY, AST_SPEECH_STATE_WAIT, ast_speech_write(), AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_stopstream(), ast_strdup, ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_tvdiff_ms(), ast_tvnow(), ast_waitfor(), ast_frame::data, ast_frame::datalen, ast_pbx::dtimeoutms, f, find_speech(), ast_speech::format, ast_frame::frametype, ast_speech_result::grammar, ast_frame_subclass::integer, ast_channel::language, ast_speech::lock, parse(), ast_channel::pbx, pbx_builtin_getvar_helper(), ast_speech::processing_sound, ast_frame::ptr, ast_channel::readformat, ast_speech::results, SB_OPT_NOANSWER, ast_channel::sched, ast_speech_result::score, speech_background_options, speech_datastore_destroy(), speech_streamfile(), ast_speech::state, ast_channel::stream, ast_channel::streamid, strsep(), ast_frame::subclass, ast_speech_result::text, and ast_channel::timingfunc.
Referenced by load_module().
|
static |
SpeechCreate() Dialplan Application.
Definition at line 532 of file app_speech_utils.c.
References ast_channel_datastore_add(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc(), ast_speech_destroy(), ast_speech_new(), ast_datastore::data, ast_channel::nativeformats, and pbx_builtin_setvar_helper().
Referenced by load_module().
|
static |
Definition at line 312 of file app_speech_utils.c.
References ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_lock, ast_channel_unlock, and ast_datastore_free().
Referenced by speech_background(), and speech_destroy().
|
static |
SpeechDeactivateGrammar(Grammar Name) Dialplan Application.
Definition at line 602 of file app_speech_utils.c.
References ast_speech_grammar_deactivate(), and find_speech().
Referenced by load_module().
|
static |
SpeechDestroy() Dialplan Application.
Definition at line 937 of file app_speech_utils.c.
References speech_datastore_destroy().
Referenced by load_module().
|
static |
SPEECH_ENGINE() Dialplan Function.
Definition at line 440 of file app_speech_utils.c.
References ast_speech_change(), and find_speech().
|
static |
SPEECH_GRAMMAR() Dialplan Function.
Definition at line 414 of file app_speech_utils.c.
References ast_copy_string(), find_result(), find_speech(), ast_speech_result::grammar, and ast_speech::results.
|
static |
SpeechLoadGrammar(Grammar Name,Path) Dialplan Application.
Definition at line 561 of file app_speech_utils.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_speech_grammar_load(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_speech::data, and find_speech().
Referenced by load_module().
|
static |
SpeechProcessingSound(Sound File) Dialplan Application.
Definition at line 646 of file app_speech_utils.c.
References ast_free, ast_strdup, find_speech(), and ast_speech::processing_sound.
Referenced by load_module().
|
static |
SPEECH() Dialplan Function.
Definition at line 482 of file app_speech_utils.c.
References ast_copy_string(), AST_LIST_NEXT, AST_SPEECH_SPOKE, ast_test_flag, find_speech(), and ast_speech::results.
|
static |
SPEECH_RESULTS_TYPE() Dialplan Function.
Definition at line 460 of file app_speech_utils.c.
References ast_speech_change_results_type(), AST_SPEECH_RESULTS_TYPE_NBEST, AST_SPEECH_RESULTS_TYPE_NORMAL, and find_speech().
|
static |
SPEECH_SCORE() Dialplan Function.
Definition at line 363 of file app_speech_utils.c.
References ast_copy_string(), find_result(), find_speech(), ast_speech::results, and ast_speech_result::score.
|
static |
SpeechStart() Dialplan Application.
Definition at line 632 of file app_speech_utils.c.
References ast_speech_start(), and find_speech().
Referenced by load_module().
|
static |
Helper function used by speech_background to playback a soundfile.
Definition at line 665 of file app_speech_utils.c.
References ast_applystream(), ast_openstream(), and ast_playstream().
Referenced by speech_background().
|
static |
SPEECH_TEXT() Dialplan Function.
Definition at line 388 of file app_speech_utils.c.
References ast_copy_string(), find_result(), find_speech(), ast_speech::results, and ast_speech_result::text.
|
static |
SpeechUnloadGrammar(Grammar Name) Dialplan Application.
Definition at line 587 of file app_speech_utils.c.
References ast_speech_grammar_unload(), and find_speech().
Referenced by load_module().
|
static |
Definition at line 945 of file app_speech_utils.c.
References ast_custom_function_unregister(), and ast_unregister_application().
|
static |
Definition at line 995 of file app_speech_utils.c.
|
static |
Definition at line 995 of file app_speech_utils.c.
|
static |
Definition at line 686 of file app_speech_utils.c.
Referenced by speech_background().
|
static |
Static structure for datastore information.
Definition at line 277 of file app_speech_utils.c.
|
static |
Definition at line 453 of file app_speech_utils.c.
|
static |
Definition at line 523 of file app_speech_utils.c.
|
static |
Definition at line 433 of file app_speech_utils.c.
|
static |
Definition at line 475 of file app_speech_utils.c.
|
static |
Definition at line 381 of file app_speech_utils.c.
|
static |
Definition at line 407 of file app_speech_utils.c.