47#include "asterisk/argdesc.h"
72#define DEBUG_READ (1 << 0)
73#define DEBUG_TOKENS (1 << 1)
74#define DEBUG_MACROS (1 << 2)
75#define DEBUG_CONTEXTS (1 << 3)
77static char *
config =
"extensions.ael";
90int option_matches_j(
struct argdesc *should,
pval *is,
struct argapp *
app);
91int option_matches(
struct argdesc *should,
pval *is,
struct argapp *
app);
92int ael_is_funcname(
char *
name);
135 snprintf(
buf,
sizeof(
buf),
"%s,~~s~~,1(%s)",
args.name,
args.args);
146 int errs=0, sem_err=0, sem_warn=0, sem_note=0;
151 struct pval *parse_tree;
153 ast_debug(1,
"Starting AEL load process.\n");
155 rfilename = (
char *)
config;
160 if (access(rfilename,R_OK) != 0) {
166 ast_debug(1,
"AEL load process: parsed config file name '%s'.\n", rfilename);
168 if (
errs == 0 && sem_err == 0) {
169 ast_debug(1,
"AEL load process: checked config file name '%s'.\n", rfilename);
176 ast_debug(1,
"AEL load process: compiled config file name '%s'.\n", rfilename);
181 ast_debug(1,
"AEL load process: merged config file name '%s'.\n", rfilename);
184 ast_debug(1,
"AEL load process: verified config file name '%s'.\n", rfilename);
186 ast_log(
LOG_ERROR,
"Sorry, but %d syntax errors and %d semantic errors were detected. It doesn't make sense to compile.\n",
errs, sem_err);
200 e->
command =
"ael set debug {read|tokens|contexts|off}";
202 "Usage: ael set debug {read|tokens|contexts|off}\n"
203 " Enable AEL read, token, or context debugging,\n"
204 " or disable all AEL debugging messages. Note: this\n"
205 " currently does nothing.\n";
211 if (
a->argc != e->
args)
214 if (!strcasecmp(
a->argv[3],
"read"))
216 else if (!strcasecmp(
a->argv[3],
"tokens"))
218 else if (!strcasecmp(
a->argv[3],
"contexts"))
220 else if (!strcasecmp(
a->argv[3],
"off"))
234 "Usage: ael reload\n"
235 " Reloads AEL configuration.\n";
284#define AST_MODULE "ael"
298 .
requires =
"res_ael_share",
302static const char *
const ael_funclist[] =
339 "QUEUE_MEMBER_COUNT",
361int ael_is_funcname(
char *
name)
364 t =
sizeof(ael_funclist)/
sizeof(
char*);
366 while ((s < t) && strcasecmp(
name, ael_funclist[s]))
int ael_external_load_module(void)
Structures for AEL - the Asterisk extension language.
struct pval * ael2_parse(char *fname, int *errs)
void ael2_semantic_check(pval *item, int *errs, int *warns, int *notes)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_strdupa(s)
duplicate a string in memory from the stack
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
Standard Command Line Interface.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
#define AST_CLI_DEFINE(fn, txt,...)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Generic (perhaps overly so) hashtable implementation Hash Table support in Asterisk.
int ast_hashtab_newsize_java(struct ast_hashtab *tab)
Create a prime number roughly 2x the current table size.
#define ast_hashtab_create(initial_buckets, compare, resize, newsize, hash, do_locking)
Create the hashtable list.
int ast_hashtab_resize_java(struct ast_hashtab *tab)
Determines if a table resize should occur using the Java algorithm (if the table load factor is 75% o...
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_STANDARD_RAW_ARGS(args, parse)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Configuration File Parser.
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_debug(level,...)
Log a DEBUG message.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_EXTENDED
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_RELOAD_SUCCESS
int ast_unregister_application(const char *app)
Unregister an application.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
enum ast_module_reload_result ast_module_reload(const char *name)
Reload asterisk modules.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
const char * ast_config_AST_CONFIG_DIR
Core PBX routines and definitions.
struct ast_context * ast_walk_contexts(struct ast_context *con)
int ast_hashtab_compare_contexts(const void *ah_a, const void *ah_b)
hashtable functions for contexts
unsigned int ast_hashtab_hash_contexts(const void *obj)
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_hashtab *exttable, const char *registrar)
Merge the temporary contexts into a global contexts list and delete from the global list the ones tha...
void ast_context_destroy(struct ast_context *con, const char *registrar)
Destroy a context (matches the specified context or ANY context if NULL)
int ast_context_verify_includes(struct ast_context *con)
Verifies includes in an ast_contect structure.
struct ast_app * pbx_findapp(const char *app)
Look up an application.
int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *local_table, struct pval *root)
void check_switch_expr(pval *item, struct argapp *apps)
struct ael_priority * new_prio(void)
void destroy_pval_item(pval *item)
void check_pval_item(pval *item, struct argapp *apps, int in_globals)
int check_app_args(pval *appcall, pval *arglist, struct argapp *app)
static int pbx_load_module(void)
static struct ast_cli_entry cli_ael[]
void set_priorities(struct ael_extension *exten)
void ast_expr_clear_extra_error_info(void)
static int aelsub_exec(struct ast_channel *chan, const char *vdata)
void check_pval(pval *item, struct argapp *apps, int in_globals)
struct ael_extension * new_exten(void)
struct pval * find_context(char *name)
void destroy_pval(pval *item)
void destroy_extensions(struct ael_extension *exten)
static char * handle_cli_ael_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int load_module(void)
void add_extensions(struct ael_extension *exten)
static int unload_module(void)
static char * handle_cli_ael_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
void ast_expr_register_extra_error_info(char *errmsg)
static struct ast_context * local_contexts
static struct ast_hashtab * local_table
Registered applications container.
ast_app: A registered application
Main Channel structure associated with a channel.
descriptor for a cli entry.
int args
This gets set in ast_cli_register()
ast_context: An extension context
static struct aco_type item