Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Macros | Functions | Variables
res_speech_aeap.c File Reference

Asterisk External Application Speech Engine. More...

#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/config.h"
#include "asterisk/format.h"
#include "asterisk/format_cap.h"
#include "asterisk/json.h"
#include "asterisk/module.h"
#include "asterisk/speech.h"
#include "asterisk/sorcery.h"
#include "asterisk/res_aeap.h"
#include "asterisk/res_aeap_message.h"

Go to the source code of this file.

Data Structures

struct  speech_param
 
struct  speech_setting
 

Macros

#define CONNECTION_TIMEOUT   2000
 
#define log_error(obj, fmt, ...)   ast_log(LOG_ERROR, "AEAP speech (%p): " fmt "\n", obj, ##__VA_ARGS__)
 
#define SPEECH_AEAP_VERSION   "0.1.0"
 
#define SPEECH_PROTOCOL   "speech_to_text"
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
static void ast_aeap_speech_on_error (struct ast_aeap *aeap)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static struct ast_jsoncustom_fields_to_params (const struct ast_variable *variables)
 
static int handle_request_set (struct ast_aeap *aeap, struct ast_aeap_message *message, void *data)
 
static int handle_response_get (struct ast_aeap *aeap, struct ast_aeap_message *message, void *data)
 
static int handle_response_set (struct ast_aeap *aeap, struct ast_aeap_message *message, void *data)
 
static int handle_response_setup (struct ast_aeap *aeap, struct ast_aeap_message *message, void *data)
 
static int handle_results (struct ast_aeap *aeap, struct ast_json_iter *iter, struct ast_speech_result **speech_results)
 
static int handle_setting (struct ast_aeap *aeap, struct ast_json_iter *iter, struct speech_setting *setting)
 
static int load_engine (void *obj, void *arg, int flags)
 
static int load_module (void)
 
static int matches_engine (void *obj, void *arg, int flags)
 
static int should_unregister (const struct ast_speech_engine *engine, void *data)
 
static int speech_aeap_engine_change (struct ast_speech *speech, const char *name, const char *value)
 
static int speech_aeap_engine_change_results_type (struct ast_speech *speech, enum ast_speech_results_type results_type)
 
static int speech_aeap_engine_create (struct ast_speech *speech, struct ast_format *format)
 
static int speech_aeap_engine_destroy (struct ast_speech *speech)
 
static int speech_aeap_engine_dtmf (struct ast_speech *speech, const char *dtmf)
 
static struct ast_speech_resultspeech_aeap_engine_get (struct ast_speech *speech)
 
static int speech_aeap_engine_get_setting (struct ast_speech *speech, const char *name, char *buf, size_t len)
 
static int speech_aeap_engine_start (struct ast_speech *speech)
 
static int speech_aeap_engine_write (struct ast_speech *speech, void *data, int len)
 
static int speech_aeap_get (struct ast_speech *speech, const char *param, void *data)
 
static int speech_aeap_send_request (struct ast_aeap *aeap, const char *name, struct ast_json *json, void *data)
 
static int speech_aeap_set (struct ast_speech *speech, const char *name, const char *value)
 
static struct ast_speech_enginespeech_engine_alloc (const char *name)
 
static void speech_engine_alloc_and_register (const char *name, const struct ast_format_cap *formats)
 
static void speech_engine_destroy (void *obj)
 
static void speech_observer_loaded (const char *object_type)
 
static int unload_engine (void *obj, void *arg, int flags)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Asterisk External Application Speech Engine" , .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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, .requires = "res_speech,res_aeap", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static const struct ast_aeap_message_handler request_handlers []
 
static const struct ast_aeap_message_handler response_handlers []
 
static struct ast_aeap_params speech_aeap_params
 
static const struct ast_sorcery_observer speech_observer
 Observer for AEAP reloads. More...
 

Detailed Description

Asterisk External Application Speech Engine.

Definition in file res_speech_aeap.c.

Variable Documentation

const struct ast_aeap_message_handler request_handlers[]
static
Initial value:
= {
{ "set", handle_request_set },
}

Definition at line 349 of file res_speech_aeap.c.

const struct ast_aeap_message_handler response_handlers[]
static
Initial value:
= {
{ "setup", handle_response_setup },
{ "get", handle_response_get },
{ "set", handle_response_set },
}

Definition at line 307 of file res_speech_aeap.c.

const struct ast_sorcery_observer speech_observer
static
Initial value:
= {
.loaded = speech_observer_loaded,
}

Observer for AEAP reloads.

Definition at line 706 of file res_speech_aeap.c.