Asterisk - The Open Source Telephony Project
18.5.0
|
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) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
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_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
SPEECH_ENGINE() Dialplan Get Function. More... | |
static int | speech_engine_write (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
SPEECH_ENGINE() Dialplan Set 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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_speech", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const struct ast_app_option | speech_background_options [128] = { [ 'n' ] = { .flag = SB_OPT_NOANSWER }, } |
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 |
Speech Recognition Utility Applications.
Definition in file app_speech_utils.c.
anonymous enum |
Enumerator | |
---|---|
SB_OPT_NOANSWER |
Definition at line 691 of file app_speech_utils.c.
|
static |
Definition at line 1007 of file app_speech_utils.c.
|
static |
Definition at line 1007 of file app_speech_utils.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1007 of file app_speech_utils.c.
|
static |
Helper function used by datastores to destroy the speech structure upon hangup.
Definition at line 261 of file app_speech_utils.c.
References ast_speech_destroy(), and NULL.
|
static |
Definition at line 332 of file app_speech_utils.c.
References AST_LIST_NEXT, ast_speech_result::nbest_num, NULL, result, and tmp().
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 282 of file app_speech_utils.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_datastore::data, and NULL.
Referenced by speech_activate(), speech_background(), speech_deactivate(), speech_engine_read(), 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 979 of file app_speech_utils.c.
References ast_custom_function_register, AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_register_application_xml, ASTERISK_GPL_KEY, speech_activate(), speech_background(), speech_create(), speech_deactivate(), speech_destroy(), speech_load(), speech_processing_sound(), speech_start(), speech_unload(), and unload_module().
|
static |
SpeechActivateGrammar(Grammar Name) Dialplan Application.
Definition at line 628 of file app_speech_utils.c.
References ast_speech_grammar_activate(), find_speech(), and NULL.
Referenced by load_module().
|
static |
SpeechBackground(Sound File,Timeout) Dialplan Application.
Definition at line 700 of file app_speech_utils.c.
References ao2_bump, ao2_cleanup, args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_calloc, ast_channel_language(), ast_channel_lock, ast_channel_pbx(), ast_channel_readformat(), ast_channel_sched(), ast_channel_stream(), ast_channel_streamid(), ast_channel_timingfunc(), ast_channel_unlock, ast_clear_flag, AST_CONTROL_HANGUP, AST_DECLARE_APP_ARGS, 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, done, ast_pbx::dtimeoutms, find_speech(), ast_speech::format, ast_frame::frametype, ast_speech_result::grammar, ast_frame_subclass::integer, ast_speech::lock, NULL, parse(), pbx_builtin_getvar_helper(), ast_speech::processing_sound, ast_frame::ptr, RAII_VAR, ast_speech::results, SB_OPT_NOANSWER, ast_speech_result::score, speech_background_options, speech_datastore_destroy(), speech_streamfile(), ast_speech::state, strsep(), ast_frame::subclass, ast_speech_result::text, timeout, and tmp().
Referenced by load_module().
|
static |
SpeechCreate() Dialplan Application.
Definition at line 543 of file app_speech_utils.c.
References ast_channel_datastore_add(), ast_channel_lock, ast_channel_nativeformats(), ast_channel_unlock, ast_datastore_alloc, ast_speech_destroy(), ast_speech_new(), ast_datastore::data, NULL, and pbx_builtin_setvar_helper().
Referenced by load_module().
|
static |
Definition at line 311 of file app_speech_utils.c.
References ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_lock, ast_channel_unlock, ast_datastore_free(), and NULL.
Referenced by speech_background(), and speech_destroy().
|
static |
SpeechDeactivateGrammar(Grammar Name) Dialplan Application.
Definition at line 613 of file app_speech_utils.c.
References ast_speech_grammar_deactivate(), find_speech(), and NULL.
Referenced by load_module().
|
static |
SpeechDestroy() Dialplan Application.
Definition at line 948 of file app_speech_utils.c.
References speech_datastore_destroy().
Referenced by load_module().
|
static |
SPEECH_ENGINE() Dialplan Get Function.
Definition at line 453 of file app_speech_utils.c.
References ast_speech_get_setting(), and find_speech().
|
static |
SPEECH_ENGINE() Dialplan Set Function.
Definition at line 439 of file app_speech_utils.c.
References ast_speech_change(), find_speech(), and NULL.
|
static |
SPEECH_GRAMMAR() Dialplan Function.
Definition at line 413 of file app_speech_utils.c.
References ast_copy_string(), find_result(), find_speech(), ast_speech_result::grammar, NULL, result, and ast_speech::results.
|
static |
SpeechLoadGrammar(Grammar Name,Path) Dialplan Application.
Definition at line 572 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, find_speech(), and NULL.
Referenced by load_module().
|
static |
SpeechProcessingSound(Sound File) Dialplan Application.
Definition at line 657 of file app_speech_utils.c.
References ast_free, ast_strdup, find_speech(), NULL, and ast_speech::processing_sound.
Referenced by load_module().
|
static |
SPEECH() Dialplan Function.
Definition at line 493 of file app_speech_utils.c.
References ast_copy_string(), AST_LIST_NEXT, AST_SPEECH_SPOKE, ast_test_flag, find_speech(), NULL, result, ast_speech::results, and tmp().
|
static |
SPEECH_RESULTS_TYPE() Dialplan Function.
Definition at line 471 of file app_speech_utils.c.
References ast_speech_change_results_type(), AST_SPEECH_RESULTS_TYPE_NBEST, AST_SPEECH_RESULTS_TYPE_NORMAL, find_speech(), and NULL.
|
static |
SPEECH_SCORE() Dialplan Function.
Definition at line 362 of file app_speech_utils.c.
References ast_copy_string(), find_result(), find_speech(), NULL, result, ast_speech::results, ast_speech_result::score, and tmp().
|
static |
SpeechStart() Dialplan Application.
Definition at line 643 of file app_speech_utils.c.
References ast_speech_start(), find_speech(), and NULL.
Referenced by load_module().
|
static |
Helper function used by speech_background to playback a soundfile.
Definition at line 676 of file app_speech_utils.c.
References ast_applystream(), ast_openstream(), ast_playstream(), and NULL.
Referenced by speech_background().
|
static |
SPEECH_TEXT() Dialplan Function.
Definition at line 387 of file app_speech_utils.c.
References ast_copy_string(), find_result(), find_speech(), NULL, result, ast_speech::results, and ast_speech_result::text.
|
static |
SpeechUnloadGrammar(Grammar Name) Dialplan Application.
Definition at line 598 of file app_speech_utils.c.
References ast_speech_grammar_unload(), find_speech(), and NULL.
Referenced by load_module().
|
static |
Definition at line 956 of file app_speech_utils.c.
References ast_custom_function_unregister(), and ast_unregister_application().
Referenced by load_module().
|
static |
Definition at line 1007 of file app_speech_utils.c.
|
static |
Definition at line 1007 of file app_speech_utils.c.
|
static |
Definition at line 697 of file app_speech_utils.c.
Referenced by speech_background().
|
static |
Static structure for datastore information.
Definition at line 276 of file app_speech_utils.c.
|
static |
Definition at line 464 of file app_speech_utils.c.
|
static |
Definition at line 534 of file app_speech_utils.c.
|
static |
Definition at line 432 of file app_speech_utils.c.
|
static |
Definition at line 486 of file app_speech_utils.c.
|
static |
Definition at line 380 of file app_speech_utils.c.
|
static |
Definition at line 406 of file app_speech_utils.c.