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) 77 static char *
config =
"extensions.ael";
90 int option_matches_j(
struct argdesc *should,
pval *is,
struct argapp *
app);
91 int option_matches(
struct argdesc *should,
pval *is,
struct argapp *
app);
92 int ael_is_funcname(
char *
name);
137 snprintf(buf,
sizeof(buf),
"%s,~~s~~,1(%s)",
args.name,
args.args);
148 int errs=0, sem_err=0, sem_warn=0, sem_note=0;
153 struct pval *parse_tree;
155 ast_debug(1,
"Starting AEL load process.\n");
157 rfilename = (
char *)
config;
162 if (access(rfilename,R_OK) != 0) {
168 ast_debug(1,
"AEL load process: parsed config file name '%s'.\n", rfilename);
170 if (errs == 0 && sem_err == 0) {
171 ast_debug(1,
"AEL load process: checked config file name '%s'.\n", rfilename);
178 ast_debug(1,
"AEL load process: compiled config file name '%s'.\n", rfilename);
182 local_contexts =
NULL;
183 ast_debug(1,
"AEL load process: merged config file name '%s'.\n", rfilename);
186 ast_debug(1,
"AEL load process: verified config file name '%s'.\n", rfilename);
188 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);
202 e->
command =
"ael set debug {read|tokens|macros|contexts|off}";
204 "Usage: ael set debug {read|tokens|macros|contexts|off}\n" 205 " Enable AEL read, token, macro, or context debugging,\n" 206 " or disable all AEL debugging messages. Note: this\n" 207 " currently does nothing.\n";
216 if (!strcasecmp(a->
argv[3],
"read"))
218 else if (!strcasecmp(a->
argv[3],
"tokens"))
220 else if (!strcasecmp(a->
argv[3],
"macros"))
222 else if (!strcasecmp(a->
argv[3],
"contexts"))
224 else if (!strcasecmp(a->
argv[3],
"off"))
238 "Usage: ael reload\n" 239 " Reloads AEL configuration.\n";
281 #define AST_MODULE "ael" 295 .requires =
"res_ael_share",
299 static const char *
const ael_funclist[] =
336 "QUEUE_MEMBER_COUNT",
358 int ael_is_funcname(
char *
name)
361 t =
sizeof(ael_funclist)/
sizeof(
char*);
363 while ((s < t) && strcasecmp(name, ael_funclist[s]))
struct ael_priority * new_prio(void)
int ast_hashtab_compare_contexts(const void *ah_a, const void *ah_b)
hashtable functions for contexts
void set_priorities(struct ael_extension *exten)
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
#define AST_CLI_DEFINE(fn, txt,...)
Asterisk main include file. File version handling, generic pbx functions.
int ast_hashtab_newsize_java(struct ast_hashtab *tab)
Create a prime number roughly 2x the current table size.
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Registered applications container.
descriptor for a cli entry.
Generic (perhaps overly so) hashtable implementation Hash Table support in Asterisk.
struct ast_context * ast_walk_contexts(struct ast_context *con)
#define AST_STANDARD_RAW_ARGS(args, parse)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static struct aco_type item
struct ast_context * local_contexts
int ael_external_load_module(void)
struct pval * find_macro(char *name)
int ast_unregister_application(const char *app)
Unregister an application.
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...
int args
This gets set in ast_cli_register()
Configuration File Parser.
#define ast_debug(level,...)
Log a DEBUG message.
int check_app_args(pval *appcall, pval *arglist, struct argapp *app)
static char * handle_cli_ael_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
#define ast_strdupa(s)
duplicate a string in memory from the stack
Core PBX routines and definitions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
struct pval * find_context(char *name)
void destroy_pval_item(pval *item)
int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *local_table, struct pval *root)
const char * ast_config_AST_CONFIG_DIR
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 check_pval_item(pval *item, struct argapp *apps, int in_globals)
void destroy_extensions(struct ael_extension *exten)
static struct ast_hashtab * local_table
unsigned int ast_hashtab_hash_contexts(const void *obj)
void destroy_pval(pval *item)
Structures for AEL - the Asterisk extension language.
void check_pval(pval *item, struct argapp *apps, int in_globals)
Module has failed to load, may be in an inconsistent state.
struct ael_extension * new_exten(void)
static char * handle_cli_ael_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
void ast_expr_clear_extra_error_info(void)
Support for logging to various files, console and syslog Configuration in file logger.conf.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
void ast_expr_register_extra_error_info(char *errmsg)
Standard Command Line Interface.
ast_app: A registered application
void ast_context_destroy(struct ast_context *con, const char *registrar)
Destroy a context (matches the specified context or ANY context if NULL)
struct pval * ael2_parse(char *fname, int *errs)
void ael2_semantic_check(pval *item, int *errs, int *warns, int *notes)
#define ast_hashtab_create(initial_buckets, compare, resize, newsize, hash, do_locking)
int ast_context_verify_includes(struct ast_context *con)
Verifies includes in an ast_contect structure.
static int unload_module(void)
void check_switch_expr(pval *item, struct argapp *apps)
struct ast_app * pbx_findapp(const char *app)
Look up an application.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int aelsub_exec(struct ast_channel *chan, const char *vdata)
static int load_module(void)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
ast_context: An extension context - must remain in sync with fake_context
void add_extensions(struct ael_extension *exten)
static struct ast_cli_entry cli_ael[]
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.
static int pbx_load_module(void)