Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/module.h"
#include "asterisk/sorcery.h"
#include "asterisk/cli.h"
#include "asterisk/format.h"
#include "asterisk/format_cap.h"
#include "asterisk/res_aeap.h"
#include "res_aeap/general.h"
Go to the source code of this file.
Data Structures | |
struct | ast_aeap_client_config |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | aeap_cli_show (void *obj, void *arg, int flags) |
static struct ast_aeap * | aeap_create (const char *id, const struct ast_aeap_params *params, int connect, int timeout) |
static char * | aeap_tab_complete_name (const char *word, struct ao2_container *container) |
const struct ast_format_cap * | ast_aeap_client_config_codecs (const struct ast_aeap_client_config *cfg) |
Retrieve codec capabilities from the configuration. More... | |
int | ast_aeap_client_config_has_protocol (const struct ast_aeap_client_config *cfg, const char *protocol) |
Check a given protocol against that in an Asterisk external application configuration. More... | |
struct ao2_container * | ast_aeap_client_configs_get (const char *protocol) |
Retrieve a listing of all client configuration objects by protocol. More... | |
struct ast_aeap * | ast_aeap_create_and_connect_by_id (const char *id, const struct ast_aeap_params *params, int timeout) |
Create and connect to an Asterisk external application by sorcery id. More... | |
struct ast_aeap * | ast_aeap_create_by_id (const char *id, const struct ast_aeap_params *params) |
Create an Asterisk external application object by sorcery id. More... | |
struct ast_variable * | ast_aeap_custom_fields_get (const char *id) |
Retrieve a list of custom configuration fields. More... | |
struct ast_sorcery * | ast_aeap_sorcery (void) |
Retrieve the AEAP sorcery object. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void * | client_config_alloc (const char *name) |
static int | client_config_apply (const struct ast_sorcery *sorcery, void *obj) |
static void | client_config_destructor (void *obj) |
static struct ast_aeap_client_config * | client_config_get (const char *id) |
static char * | client_config_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | client_config_show_all (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | load_module (void) |
static int | reload_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Asterisk External Application Protocol Module for Asterisk" , .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, .reload = reload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, .requires = "res_http_websocket", } |
static struct ast_cli_entry | aeap_cli [] |
static struct ast_sorcery * | aeap_sorcery |
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static |
Definition at line 404 of file res_aeap.c.
|
static |
Definition at line 404 of file res_aeap.c.
|
static |
Definition at line 187 of file res_aeap.c.
References a, aeap_sorcery, ast_cli(), ast_sorcery_object_get_id(), ast_sorcery_object_get_type(), ast_sorcery_objectset_create, ast_variable_list_sort(), ast_variables_destroy(), ast_variable::name, ast_variable::next, options, and ast_variable::value.
Referenced by client_config_show(), and client_config_show_all().
|
static |
Definition at line 284 of file res_aeap.c.
References ao2_cleanup, ast_aeap_create(), ast_aeap_create_and_connect(), ast_begins_with(), ast_log, client_config_get(), id, LOG_ERROR, NULL, ast_aeap::params, ast_aeap_client_config::protocol, ast_aeap_client_config::url, and url.
Referenced by ast_aeap_create_and_connect_by_id(), and ast_aeap_create_by_id().
|
static |
Definition at line 162 of file res_aeap.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_cli_completion_add(), ast_sorcery_object_get_id(), ast_strdup, container, and NULL.
Referenced by client_config_show().
const struct ast_format_cap * ast_aeap_client_config_codecs | ( | const struct ast_aeap_client_config * | cfg | ) |
Retrieve codec capabilities from the configuration.
cfg | A configuration object |
Definition at line 131 of file res_aeap.c.
References ast_aeap_client_config::codecs.
Referenced by load_engine().
int ast_aeap_client_config_has_protocol | ( | const struct ast_aeap_client_config * | cfg, |
const char * | protocol | ||
) |
Check a given protocol against that in an Asterisk external application configuration.
cfg | A configuration object |
protocol | The protocol to check |
Definition at line 136 of file res_aeap.c.
References ast_aeap_client_config::protocol.
Referenced by load_engine(), and unload_engine().
struct ao2_container * ast_aeap_client_configs_get | ( | const char * | protocol | ) |
Retrieve a listing of all client configuration objects by protocol.
protocol | An optional protocol to filter on (if NULL returns all client configs) |
Definition at line 142 of file res_aeap.c.
References AEAP_CONFIG_CLIENT, aeap_sorcery, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), ast_variable_new, ast_variables_destroy(), container, NULL, and var.
Referenced by client_config_show(), client_config_show_all(), load_module(), speech_observer_loaded(), and unload_module().
struct ast_aeap * ast_aeap_create_and_connect_by_id | ( | const char * | id, |
const struct ast_aeap_params * | params, | ||
int | timeout | ||
) |
Create and connect to an Asterisk external application by sorcery id.
id | The sorcery id to lookup |
params | Callbacks and other parameters to use |
timeout | How long (in milliseconds) to attempt to connect (-1 equals infinite) |
Definition at line 322 of file res_aeap.c.
References aeap_create(), and ast_aeap::params.
Referenced by speech_aeap_engine_create().
struct ast_aeap * ast_aeap_create_by_id | ( | const char * | id, |
const struct ast_aeap_params * | params | ||
) |
Create an Asterisk external application object by sorcery id.
id | The sorcery id to lookup |
params | Callbacks and other parameters to use |
Definition at line 317 of file res_aeap.c.
References aeap_create(), and ast_aeap::params.
struct ast_variable * ast_aeap_custom_fields_get | ( | const char * | id | ) |
Retrieve a list of custom configuration fields.
id | configuration id/sorcery lookup key |
Definition at line 328 of file res_aeap.c.
References aeap_sorcery, ao2_ref, ast_log, ast_sorcery_objectset_create, client_config_get(), LOG_WARNING, and NULL.
Referenced by speech_aeap_engine_create().
struct ast_sorcery * ast_aeap_sorcery | ( | void | ) |
Retrieve the AEAP sorcery object.
Definition at line 67 of file res_aeap.c.
References aeap_sorcery.
Referenced by load_module(), and unload_module().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 404 of file res_aeap.c.
|
static |
Definition at line 92 of file res_aeap.c.
References ao2_ref, ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, ast_sorcery_generic_alloc(), ast_string_field_init, client_config_destructor(), ast_aeap_client_config::codecs, and NULL.
Referenced by load_module().
|
static |
Definition at line 114 of file res_aeap.c.
References ast_begins_with(), ast_log, ast_sorcery_object_get_id(), ast_strlen_zero(), LOG_ERROR, and ast_aeap_client_config::url.
Referenced by load_module().
|
static |
Definition at line 84 of file res_aeap.c.
References ao2_cleanup, ast_string_field_free_memory, and ast_aeap_client_config::codecs.
Referenced by client_config_alloc().
|
static |
Definition at line 157 of file res_aeap.c.
References AEAP_CONFIG_CLIENT, aeap_sorcery, and ast_sorcery_retrieve_by_id().
Referenced by aeap_create(), ast_aeap_custom_fields_get(), and client_config_show().
|
static |
Definition at line 217 of file res_aeap.c.
References a, aeap_cli_show(), aeap_tab_complete_name(), ao2_cleanup, ast_aeap_client_configs_get(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, client_config_get(), ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 247 of file res_aeap.c.
References a, aeap_cli_show(), ao2_callback, ao2_cleanup, ao2_container_count(), ao2_ref, ast_aeap_client_configs_get(), ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, container, NULL, OBJ_NODATA, and ast_cli_entry::usage.
|
static |
Definition at line 364 of file res_aeap.c.
References aeap_cli, AEAP_CONFIG_CLIENT, aeap_general_initialize(), aeap_sorcery, ARRAY_LEN, ast_cli_register_multiple, ast_log, AST_MODULE_LOAD_DECLINE, ast_sorcery_apply_default, ast_sorcery_load(), ast_sorcery_object_field_register, ast_sorcery_object_register, ast_sorcery_open, client_config_alloc(), client_config_apply(), codecs, FLDSET, LOG_ERROR, NULL, OPT_CODEC_T, OPT_NOOP_T, OPT_STRINGFIELD_T, STRFLDSET, and url.
|
static |
Definition at line 345 of file res_aeap.c.
References aeap_sorcery, and ast_sorcery_reload().
|
static |
Definition at line 352 of file res_aeap.c.
References aeap_cli, aeap_general_finalize(), aeap_sorcery, ARRAY_LEN, ast_cli_unregister_multiple(), ast_sorcery_unref, and NULL.
|
static |
Definition at line 404 of file res_aeap.c.
|
static |
Definition at line 279 of file res_aeap.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 65 of file res_aeap.c.
Referenced by aeap_cli_show(), ast_aeap_client_configs_get(), ast_aeap_custom_fields_get(), ast_aeap_sorcery(), client_config_get(), load_module(), reload_module(), and unload_module().
|
static |
Definition at line 404 of file res_aeap.c.