Asterisk - The Open Source Telephony Project
18.5.0
|
Compile symbolic Asterisk Extension Logic into Asterisk extensions, version 2. More...
#include "asterisk.h"
#include <ctype.h>
#include <regex.h>
#include <sys/stat.h>
#include "asterisk/pbx.h"
#include "asterisk/config.h"
#include "asterisk/module.h"
#include "asterisk/logger.h"
#include "asterisk/cli.h"
#include "asterisk/app.h"
#include "asterisk/callerid.h"
#include "asterisk/hashtab.h"
#include "asterisk/ael_structs.h"
#include "asterisk/pval.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_CONTEXTS (1 << 3) |
#define | DEBUG_MACROS (1 << 2) |
#define | DEBUG_READ (1 << 0) |
#define | DEBUG_TOKENS (1 << 1) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Asterisk Extension Language Compiler" , .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_EXTENDED, .load = load_module, .unload = unload_module, .reload = reload, .requires = "res_ael_share", } |
static int | aeldebug = 0 |
static char * | aelsub = "AELSub" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_cli_entry | cli_ael [] |
static char * | config = "extensions.ael" |
static char * | registrar = "pbx_ael" |
Compile symbolic Asterisk Extension Logic into Asterisk extensions, version 2.
Definition in file pbx_ael.c.
#define DEBUG_CONTEXTS (1 << 3) |
Definition at line 75 of file pbx_ael.c.
Referenced by handle_cli_ael_set_debug().
#define DEBUG_MACROS (1 << 2) |
Definition at line 74 of file pbx_ael.c.
Referenced by handle_cli_ael_set_debug().
#define DEBUG_READ (1 << 0) |
Definition at line 72 of file pbx_ael.c.
Referenced by handle_cli_ael_set_debug().
#define DEBUG_TOKENS (1 << 1) |
Definition at line 73 of file pbx_ael.c.
Referenced by handle_cli_ael_set_debug().
void add_extensions | ( | struct ael_extension * | exten | ) |
Definition at line 4213 of file pval.c.
References AEL_APPCALL, AEL_CONTROL1, AEL_FOR_CONTROL, AEL_IF_CONTROL, AEL_IFTIME_CONTROL, AEL_LABEL, AEL_RAND_CONTROL, AEL_RETURN, ael_priority::app, ael_priority::appargs, ast_add_extension2(), ast_free_ptr(), ast_log, AST_MAX_EXTENSION, ael_extension::cidmatch, ael_extension::context, pval::else_statements, ael_priority::exten, ael_priority::goto_false, ael_priority::goto_true, ael_extension::hints, last, LOG_WARNING, ael_extension::name, ael_priority::next, ael_extension::next_exten, NULL, ael_priority::origin, pbx_substitute_variables_helper(), ael_extension::plist, PRIORITY_HINT, ael_priority::priority_num, PV_IFTIME, PV_SWITCH, registrar, pval::str, strdup, pval::type, ael_priority::type, pval::u1, and pval::u3.
Referenced by ast_compile_ael2().
|
static |
Definition at line 126 of file pbx_ael.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, AST_STANDARD_RAW_ARGS, ast_strdupa, buf, name, pbx_exec(), and pbx_findapp().
Referenced by load_module().
int ast_compile_ael2 | ( | struct ast_context ** | local_contexts, |
struct ast_hashtab * | local_table, | ||
struct pval * | root | ||
) |
Definition at line 4413 of file pval.c.
References add_extensions(), AEL_APPCALL, AEL_LABEL, ael_priority::app, ael_priority::appargs, pval::arglist, ARRAY_LEN, ast_context_add_ignorepat2(), ast_context_add_include2(), ast_context_add_switch2(), ast_context_find_or_create(), ast_custom_function_find(), ast_get_context_name(), attach_exten(), buf, buf2, c, ael_extension::cidmatch, ael_extension::context, context, context_used(), control_statement_count, destroy_extensions(), ael_priority::exten, exten, fix_gotos_in_extensions(), gen_prios(), pval::hints, ael_extension::hints, linkprio(), pval::list, pval::macro_statements, ael_extension::name, new_exten(), new_prio(), pval::next, ael_extension::next_exten, NULL, ael_priority::origin, pbx_builtin_setvar(), ael_extension::plist_last, priority, ael_priority::priority_num, PV_CONTEXT, PV_ESWITCHES, PV_EXTENSION, PV_GLOBALS, PV_IGNOREPAT, PV_INCLUDES, PV_MACRO, PV_SWITCHES, pval::regexten, ael_extension::regexten, registrar, remove_spaces_before_equals(), ael_extension::return_needed, set_priorities(), pval::statements, pval::str, strdup, pval::type, ael_priority::type, pval::u1, pval::u2, pval::u3, pval::u4, and pval::val.
Referenced by pbx_load_module().
void ast_expr_clear_extra_error_info | ( | void | ) |
Definition at line 2483 of file ast_expr2f.c.
void ast_expr_register_extra_error_info | ( | char * | errmsg | ) |
Definition at line 2477 of file ast_expr2f.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 2130 of file pval.c.
References ast_log, pval::endline, pval::filename, LOG_WARNING, pval::next, pval::startline, pval::str, pval::u1, and warns.
Referenced by check_pval_item().
Definition at line 2865 of file pval.c.
References check_pval_item(), and pval::next.
Referenced by ael2_semantic_check(), and check_pval_item().
Definition at line 2357 of file pval.c.
References pval::abstract, app, pval::arglist, ast_expr(), ast_expr_clear_extra_error_info(), ast_expr_register_extra_error_info(), ast_log, check_abstract_reference(), check_app_args(), check_break(), check_continue(), check_day(), check_dow(), check_expr2_input(), check_goto(), check_includes(), check_label(), check_macro_returns(), check_month(), check_pval(), check_switch_expr(), check_timerange(), E_MATCH, pval::else_statements, pval::endcol, pval::endline, errs, expr_output, pval::filename, find_context(), find_macro(), find_pval_gotos(), pval::for_inc, pval::for_init, pval::for_statements, pval::for_test, free(), in_abstract_context, item, pval::list, localized_pbx_load_module(), LOG_ERROR, LOG_WARNING, pval::macro_statements, pval::next, argapp::next, NULL, pbx_find_extension(), PV_APPLICATION_CALL, PV_BREAK, PV_CASE, PV_CATCH, PV_CONTEXT, PV_CONTINUE, PV_DEFAULT, PV_ESWITCHES, PV_EXTENSION, PV_FOR, PV_GLOBALS, PV_GOTO, PV_IF, PV_IFTIME, PV_IGNOREPAT, PV_INCLUDES, PV_LABEL, PV_LOCALVARDEC, PV_MACRO, PV_MACRO_CALL, PV_PATTERN, PV_RANDOM, PV_RETURN, PV_STATEMENTBLOCK, PV_SWITCH, PV_SWITCHES, PV_VARDEC, PV_WHILE, PV_WORD, pbx_find_info::stacklen, pval::startcol, pval::startline, pval::statements, pbx_find_info::status, STATUS_SUCCESS, pval::str, pval::type, pval::u1, pval::u2, pval::u3, pval::u4, pval::val, and warns.
Referenced by check_pval().
Definition at line 2184 of file pval.c.
References a, ast_log, ast_strdupa, c, calloc, pval::endcol, pval::endline, pval::filename, item, LOG_WARNING, pval::next, argapp::next, PV_APPLICATION_CALL, PV_CASE, PV_DEFAULT, PV_PATTERN, PV_STATEMENTBLOCK, pval::startcol, pval::startline, pval::statements, pval::str, strdup, pval::type, pval::u1, pval::u2, and warns.
Referenced by check_pval_item().
void destroy_extensions | ( | struct ael_extension * | exten | ) |
Definition at line 2978 of file pval.c.
References ael_priority::app, ael_priority::appargs, free(), ael_priority::goto_false, ael_priority::goto_true, ael_extension::hints, ael_extension::loop_break, ael_extension::loop_continue, ael_extension::name, ael_priority::next, ael_extension::next_exten, ael_priority::origin, ael_extension::plist, and ael_extension::plist_last.
Referenced by ast_compile_ael2().
void destroy_pval | ( | pval * | item | ) |
Definition at line 4940 of file pval.c.
References destroy_pval_item(), name, and pval::next.
Referenced by destroy_pval_item(), pbx_load_module(), pvalIfTimeSetCondition(), and pvalIncludesAddIncludeWithTimeConstraints().
void destroy_pval_item | ( | pval * | item | ) |
Definition at line 4672 of file pval.c.
References pval::arglist, ast_log, destroy_pval(), pval::else_statements, pval::filename, pval::for_inc, pval::for_init, pval::for_statements, pval::for_test, free(), pval::hints, pval::list, LOG_WARNING, pval::macro_statements, NULL, PV_APPLICATION_CALL, PV_BREAK, PV_CASE, PV_CATCH, PV_CONTEXT, PV_CONTINUE, PV_DEFAULT, PV_ESWITCHES, PV_EXTENSION, PV_FOR, PV_GLOBALS, PV_GOTO, PV_IF, PV_IFTIME, PV_IGNOREPAT, PV_INCLUDES, PV_LABEL, PV_LOCALVARDEC, PV_MACRO, PV_MACRO_CALL, PV_PATTERN, PV_RANDOM, PV_RETURN, PV_STATEMENTBLOCK, PV_SWITCH, PV_SWITCHES, PV_VARDEC, PV_WHILE, PV_WORD, pval::statements, pval::str, pval::type, pval::u1, pval::u2, pval::u3, pval::u4, and pval::val.
Referenced by destroy_pval().
struct pval* find_context | ( | char * | name | ) |
Definition at line 1953 of file pval.c.
References count_labels, match_context, match_exten, match_label, match_pval(), name, and return_on_context_match.
Referenced by check_goto(), check_includes(), check_pval_item(), find_first_label_in_current_context(), find_label_in_current_context(), find_pval_goto_item(), and get_goto_target().
struct pval* find_macro | ( | char * | name | ) |
Definition at line 1943 of file pval.c.
References count_labels, match_context, match_exten, match_label, match_pval(), name, and return_on_context_match.
Referenced by check_pval_item().
|
static |
Definition at line 232 of file pbx_ael.c.
References ast_cli_args::argc, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, pbx_load_module(), and ast_cli_entry::usage.
|
static |
Definition at line 198 of file pbx_ael.c.
References aeldebug, ast_cli_args::argc, ast_cli_entry::args, ast_cli_args::argv, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, DEBUG_CONTEXTS, DEBUG_MACROS, DEBUG_READ, DEBUG_TOKENS, NULL, and ast_cli_entry::usage.
int is_empty | ( | char * | arg | ) |
Definition at line 1981 of file pval.c.
References app, ast_log, ast_strdupa, pval::endline, errs, pval::filename, is_float(), is_int(), LOG_ERROR, LOG_WARNING, argapp::next, pval::startline, pval::str, pval::u1, and warns.
int is_float | ( | char * | arg | ) |
Definition at line 1963 of file pval.c.
Referenced by is_empty().
int is_int | ( | char * | arg | ) |
Definition at line 1972 of file pval.c.
Referenced by is_empty().
|
static |
Definition at line 266 of file pbx_ael.c.
References aelsub, aelsub_exec(), ARRAY_LEN, ast_cli_register_multiple, ast_register_application_xml, and pbx_load_module().
Referenced by reload().
struct ael_extension* new_exten | ( | void | ) |
Definition at line 2930 of file pval.c.
References calloc.
Referenced by ast_compile_ael2(), and gen_prios().
struct ael_priority* new_prio | ( | void | ) |
Definition at line 2924 of file pval.c.
References calloc.
Referenced by ast_compile_ael2(), and gen_prios().
|
static |
Definition at line 146 of file pbx_ael.c.
References ael2_parse(), ael2_semantic_check(), ast_alloca, ast_compile_ael2(), ast_config_AST_CONFIG_DIR, ast_context_verify_includes(), ast_debug, ast_hashtab_compare_contexts(), ast_hashtab_create, ast_hashtab_hash_contexts(), ast_hashtab_newsize_java(), ast_hashtab_resize_java(), ast_log, ast_merge_contexts_and_delete(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_walk_contexts(), config, destroy_pval(), errs, local_contexts, local_table, LOG_ERROR, LOG_NOTICE, NULL, and registrar.
Referenced by handle_cli_ael_reload(), load_module(), and reload().
|
static |
Definition at line 275 of file pbx_ael.c.
References ael_external_load_module(), AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_SUPPORT_EXTENDED, ASTERISK_GPL_KEY, load_module(), pbx_load_module(), and unload_module().
void set_priorities | ( | struct ael_extension * | exten | ) |
Definition at line 4187 of file pval.c.
References ael_extension::is_switch, ael_priority::next, ael_extension::next_exten, ael_priority::origin, ael_extension::plist, ael_priority::priority_num, PV_LABEL, ael_extension::regexten, and pval::type.
Referenced by ast_compile_ael2().
|
static |
Definition at line 256 of file pbx_ael.c.
References aelsub, ARRAY_LEN, ast_cli_unregister_multiple(), ast_context_destroy(), ast_unregister_application(), NULL, and registrar.
Referenced by reload().
|
static |
|
static |
Definition at line 119 of file pbx_ael.c.
Referenced by handle_cli_ael_set_debug().
|
static |
Definition at line 124 of file pbx_ael.c.
Referenced by load_module(), and unload_module().
|
static |
|
static |
|
static |
Definition at line 77 of file pbx_ael.c.
Referenced by pbx_load_module().
|
static |
Definition at line 78 of file pbx_ael.c.
Referenced by __ast_context_create(), ast_add_extension2(), ast_context_add_ignorepat2(), ast_context_add_include2(), ast_context_add_switch2(), ast_get_context_name(), AST_TEST_DEFINE(), parking_lot_cfg_create_extensions(), parking_lot_cfg_remove_extensions(), pbx_load_module(), and unload_module().