| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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_module * | AST_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_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. | |
| 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 = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .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 }, [ 'p' ] = { .flag = SB_OPT_PARTIALRESULTS }, } | 
| static const struct ast_datastore_info | speech_datastore | 
| Static structure for datastore information. | |
| 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 | |
| SB_OPT_PARTIALRESULTS | |
Definition at line 749 of file app_speech_utils.c.
| 
 | static | 
Definition at line 1073 of file app_speech_utils.c.
| 
 | static | 
Definition at line 1073 of file app_speech_utils.c.
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) | 
Definition at line 1073 of file app_speech_utils.c.
| 
 | static | 
Helper function used by datastores to destroy the speech structure upon hangup.
Definition at line 319 of file app_speech_utils.c.
References ast_speech_destroy(), ast_speech::data, and NULL.
| 
 | static | 
Definition at line 390 of file app_speech_utils.c.
References AST_LIST_NEXT, ast_speech_result::nbest_num, NULL, and result.
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 340 of file app_speech_utils.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_datastore::data, NULL, and speech_datastore.
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 1045 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_engine_function, speech_function, speech_grammar_function, speech_load(), speech_processing_sound(), speech_results_type_function, speech_score_function, speech_start(), speech_text_function, and speech_unload().
| 
 | static | 
SpeechActivateGrammar(Grammar Name) Dialplan Application.
Definition at line 686 of file app_speech_utils.c.
References ast_speech_grammar_activate(), ast_speech::data, find_speech(), and NULL.
Referenced by load_module().
| 
 | static | 
SpeechBackground(Sound File,Timeout) Dialplan Application.
Definition at line 760 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_strsep(), AST_STRSEP_STRIP, AST_STRSEP_TRIM, ast_test_flag, ast_tvdiff_ms(), ast_tvnow(), ast_waitfor(), current, 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, options, pbx_builtin_getvar_helper(), ast_speech::processing_sound, ast_frame::ptr, RAII_VAR, ast_speech::results, SB_OPT_NOANSWER, SB_OPT_PARTIALRESULTS, ast_speech_result::score, speech_background_options, speech_datastore_destroy(), speech_streamfile(), ast_speech::state, ast_frame::subclass, and ast_speech_result::text.
Referenced by load_module().
| 
 | static | 
SpeechCreate() Dialplan Application.
Definition at line 601 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, pbx_builtin_setvar_helper(), and speech_datastore.
Referenced by load_module().
| 
 | static | 
Definition at line 369 of file app_speech_utils.c.
References ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_lock, ast_channel_unlock, ast_datastore_free(), NULL, and speech_datastore.
Referenced by speech_background(), and speech_destroy().
| 
 | static | 
SpeechDeactivateGrammar(Grammar Name) Dialplan Application.
Definition at line 671 of file app_speech_utils.c.
References ast_speech_grammar_deactivate(), ast_speech::data, find_speech(), and NULL.
Referenced by load_module().
| 
 | static | 
SpeechDestroy() Dialplan Application.
Definition at line 1014 of file app_speech_utils.c.
References speech_datastore_destroy().
Referenced by load_module().
| 
 | static | 
SPEECH_ENGINE() Dialplan Get Function.
Definition at line 511 of file app_speech_utils.c.
References ast_speech_get_setting(), buf, ast_speech::data, find_speech(), and len().
| 
 | static | 
SPEECH_ENGINE() Dialplan Set Function.
Definition at line 497 of file app_speech_utils.c.
References ast_speech_change(), ast_speech::data, find_speech(), NULL, and value.
| 
 | static | 
SPEECH_GRAMMAR() Dialplan Function.
Definition at line 471 of file app_speech_utils.c.
References ast_copy_string(), buf, ast_speech::data, find_result(), find_speech(), len(), NULL, result, and ast_speech::results.
| 
 | static | 
SpeechLoadGrammar(Grammar Name,Path) Dialplan Application.
Definition at line 630 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 715 of file app_speech_utils.c.
References ast_free, ast_strdup, ast_speech::data, find_speech(), NULL, and ast_speech::processing_sound.
Referenced by load_module().
| 
 | static | 
SPEECH() Dialplan Function.
Definition at line 551 of file app_speech_utils.c.
References ast_copy_string(), AST_LIST_NEXT, AST_SPEECH_SPOKE, ast_test_flag, buf, ast_speech::data, find_speech(), len(), NULL, result, and ast_speech::results.
| 
 | static | 
SPEECH_RESULTS_TYPE() Dialplan Function.
Definition at line 529 of file app_speech_utils.c.
References ast_speech_change_results_type(), AST_SPEECH_RESULTS_TYPE_NBEST, AST_SPEECH_RESULTS_TYPE_NORMAL, ast_speech::data, find_speech(), NULL, and value.
| 
 | static | 
SPEECH_SCORE() Dialplan Function.
Definition at line 420 of file app_speech_utils.c.
References ast_copy_string(), buf, ast_speech::data, find_result(), find_speech(), len(), NULL, result, and ast_speech::results.
| 
 | static | 
SpeechStart() Dialplan Application.
Definition at line 701 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 734 of file app_speech_utils.c.
References ast_applystream(), ast_openstream(), ast_playstream(), ast_filestream::filename, and NULL.
Referenced by speech_background().
| 
 | static | 
SPEECH_TEXT() Dialplan Function.
Definition at line 445 of file app_speech_utils.c.
References ast_copy_string(), buf, ast_speech::data, find_result(), find_speech(), len(), NULL, result, and ast_speech::results.
| 
 | static | 
SpeechUnloadGrammar(Grammar Name) Dialplan Application.
Definition at line 656 of file app_speech_utils.c.
References ast_speech_grammar_unload(), ast_speech::data, find_speech(), and NULL.
Referenced by load_module().
| 
 | static | 
Definition at line 1022 of file app_speech_utils.c.
References ast_custom_function_unregister(), ast_unregister_application(), speech_engine_function, speech_function, speech_grammar_function, speech_results_type_function, speech_score_function, and speech_text_function.
| 
 | static | 
Definition at line 1073 of file app_speech_utils.c.
| 
 | static | 
Definition at line 1073 of file app_speech_utils.c.
| 
 | static | 
Definition at line 757 of file app_speech_utils.c.
Referenced by speech_background().
| 
 | static | 
Static structure for datastore information.
Definition at line 334 of file app_speech_utils.c.
Referenced by find_speech(), speech_create(), and speech_datastore_destroy().
| 
 | static | 
Definition at line 522 of file app_speech_utils.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 592 of file app_speech_utils.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 490 of file app_speech_utils.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 544 of file app_speech_utils.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 438 of file app_speech_utils.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 464 of file app_speech_utils.c.
Referenced by load_module(), and unload_module().