47#include "asterisk/argdesc.h" 
   75#define DEBUG_READ   (1 << 0) 
   76#define DEBUG_TOKENS (1 << 1) 
   77#define DEBUG_MACROS (1 << 2) 
   78#define DEBUG_CONTEXTS (1 << 3) 
   80static char *
config = 
"extensions.ael";
 
   93int option_matches_j( 
struct argdesc *should, 
pval *is, 
struct argapp *
app);
 
   94int option_matches( 
struct argdesc *should, 
pval *is, 
struct argapp *
app);
 
   95int ael_is_funcname(
char *
name);
 
  138        snprintf(
buf, 
sizeof(
buf), 
"%s,~~s~~,1(%s)", 
args.name, 
args.args);
 
 
  149    int errs=0, sem_err=0, sem_warn=0, sem_note=0;
 
  154    struct pval *parse_tree;
 
  156    ast_debug(1, 
"Starting AEL load process.\n");
 
  158        rfilename = (
char *)
config;
 
  163    if (access(rfilename,
R_OK) != 0) {
 
  169    ast_debug(1, 
"AEL load process: parsed config file name '%s'.\n", rfilename);
 
  171    if (
errs == 0 && sem_err == 0) {
 
  172        ast_debug(1, 
"AEL load process: checked config file name '%s'.\n", rfilename);
 
  179        ast_debug(1, 
"AEL load process: compiled config file name '%s'.\n", rfilename);
 
  184        ast_debug(1, 
"AEL load process: merged config file name '%s'.\n", rfilename);
 
  187        ast_debug(1, 
"AEL load process: verified config file name '%s'.\n", rfilename);
 
  189        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);
 
 
  203        e->
command = 
"ael set debug {read|tokens|contexts|off}";
 
  205            "Usage: ael set debug {read|tokens|contexts|off}\n" 
  206            "       Enable AEL read, token, or context debugging,\n" 
  207            "       or disable all AEL debugging messages.  Note: this\n" 
  208            "       currently does nothing.\n";
 
  214    if (
a->argc != e->
args)
 
  217    if (!strcasecmp(
a->argv[3], 
"read"))
 
  219    else if (!strcasecmp(
a->argv[3], 
"tokens"))
 
  221    else if (!strcasecmp(
a->argv[3], 
"contexts"))
 
  223    else if (!strcasecmp(
a->argv[3], 
"off"))
 
 
  237            "Usage: ael reload\n" 
  238            "       Reloads AEL configuration.\n";
 
 
  297#define AST_MODULE "ael" 
  311    .
requires = 
"res_ael_share",
 
  315static const char * 
const ael_funclist[] =
 
  352    "QUEUE_MEMBER_COUNT",
 
  374int ael_is_funcname(
char *
name)
 
  377    t = 
sizeof(ael_funclist)/
sizeof(
char*);
 
  379    while ((s < t) && strcasecmp(
name, ael_funclist[s]))
 
void ast_context_destroy(void)
void ast_context_verify_includes(void)
int ael_external_load_module(void)
void ast_merge_contexts_and_delete(void)
struct ast_context * ast_walk_contexts(void)
void ast_cli_unregister_multiple(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.
#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.
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.
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