14#define ASTMM_LIBC ASTMM_IGNORE
64#define ADD_LAST(headptr,memptr) if(!headptr){ headptr=(memptr); (headptr##_last)=(memptr);} else {(headptr##_last)->next = (memptr); (headptr##_last) = (memptr);}
104 const char *application,
void *data,
void (*datad)(
void *),
117void ast_log(
int level,
const char *
file,
int line,
const char *function,
const char *fmt, ...);
119void __ast_verbose(
const char *
file,
int line,
const char *func,
int level,
const char *fmt, ...);
130void ast_log(
int level,
const char *
file,
int line,
const char *function,
const char *fmt, ...)
135 printf(
"LOG: lev:%d file:%s line:%d func: %s ",
136 level,
file, line, function);
149 const char *callerid,
159 const char *callerid,
181 printf(
"Executed ast_add_profile();\n");
207 printf(
"Executed ast_cli_register_multiple();\n");
223 const char *application,
void *data,
void (*datad)(
void *),
239 application =
"(null)";
243 printf(
"Executed ast_add_extension2(context=%s, rep=%d, exten=%s, priority=%d, label=%s, callerid=%s, appl=%s, data=%s, FREE, registrar=%s);\n",
286 if( strcmp(label,
"(null)") != 0 )
293 if( strcmp(label,
"(null)") != 0 )
309 printf(
"Executed pbx_builtin_setvar(chan, data=%s);\n", (
char*)data);
326 printf(
"Executed ast_context_create(conts, name=%s, registrar=%s);\n",
name,
registrar);
341 printf(
"Executed ast_context_find_or_create(conts, name=%s, registrar=%s);\n",
name,
registrar);
351 printf(
"Executed ast_context_add_ignorepat2(con, value=%s, registrar=%s);\n",
value,
registrar);
362 printf(
"Executed ast_context_add_include2(con, value=%s, registrar=%s);\n",
value,
registrar);
373 printf(
"Executed ast_context_add_switch2(con, value=%s, data=%s, eval=%d, registrar=%s);\n",
value, data, eval,
registrar);
377 strncpy(x->
name2, data, 99);
392 printf(
"Executed ast_merge_contexts_and_delete();\n");
398 printf(
"Executed ast_context_verify_includes();\n");
404 printf(
"Executed ast_walk_contexts();\n");
411 printf(
"Executed ast_cli_unregister_multiple();\n");
417 printf(
"Executed ast_context_destroy();\n");
453 char *t, *v, *u =
str;
457 if( *u ==
'$' && *(u+1) ==
'[' ) {
459 while( *t ==
'\n' || *t ==
'\r' || *t ==
'\t' || *t ==
' ' ) {
477 if( *t ==
'\n' || *t ==
'\r' ) {
487extern struct module_symbols
mod_data;
497 for(i=1;i<argc;i++) {
498 if( argv[i][0] ==
'-' && argv[i][1] ==
'n' )
500 if( argv[i][0] ==
'-' && argv[i][1] ==
'q' ) {
504 if( argv[i][0] ==
'-' && argv[i][1] ==
'd' )
506 if( argv[i][0] ==
'-' && argv[i][1] ==
'w' )
511 printf(
"\n(If you find progress and other non-error messages irritating, you can use -q to suppress them)\n");
513 printf(
"\n(You can use the -n option if you aren't interested in seeing all the instructions generated by the compiler)\n\n");
515 printf(
"\n(You can use the -d option if you want to use the current working directory as the CONFIG_DIR. I will look in this dir for extensions.ael* and its included files)\n\n");
517 printf(
"\n(You can use the -w option to dump extensions.conf format to extensions.conf.aeldump)\n");
528 strcpy(
var_dir,
"/var/lib/asterisk");
531 dumpfile = fopen(
"extensions.conf.aeldump",
"w");
533 printf(
"\n\nSorry, cannot open extensions.conf.aeldump for writing! Correct the situation and try again!\n\n");
602void ast_mark_lock_acquired(
void *lock_addr)
605void ast_remove_lock_info(
void *lock_addr,
struct ast_bt *bt)
610 int line_num,
const char *func,
const char *lock_name,
void *lock_addr,
struct ast_bt *bt)
625void ast_suspend_lock_info(
void *lock_addr)
628void ast_restore_lock_info(
void *lock_addr)
void ast_context_destroy(void)
void ast_context_verify_includes(void)
int ast_loader_unregister(int(*updater)(void))
Remove a procedure to be run when modules are updated.
int ael_external_load_module(void)
struct ast_sw * ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw)
void filter_leading_space_from_exprs(char *str)
int ast_hashtab_compare_contexts(const void *ah_a, const void *ah_b)
hashtable functions for contexts
void ast_merge_contexts_and_delete(void)
static char config_dir[PATH_MAX]
int ast_loader_register(int(*updater)(void))
Add a procedure to be run when modules have been updated.
struct namelist * create_name(const char *name)
int main(int argc, char **argv)
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
void ast_context_add_ignorepat2(struct ast_context *con, const char *value, const char *registrar)
struct ast_ignorepat * ast_walk_context_ignorepats(struct ast_context *con, struct ast_ignorepat *ip)
struct ast_context * context_list
#define ADD_LAST(headptr, memptr)
struct ast_exten * pbx_find_extension(struct ast_channel *chan, struct ast_context *bypass, struct pbx_find_info *q, const char *context, const char *exten, int priority, const char *label, const char *callerid, enum ext_match_t action)
struct ast_custom_function * ast_custom_function_find(const char *name)
void ast_module_register(const struct ast_module_info *x)
int ast_add_profile(const char *x, uint64_t scale)
support for event profiling
unsigned int ast_hashtab_hash_contexts(const void *obj)
struct module_symbols mod_data
void pbx_builtin_setvar(void *chan, void *data)
static char var_dir[PATH_MAX]
struct ast_context * ast_context_find_or_create(void **extcontexts, void *tab, const char *name, const char *registrar)
const char * ast_config_AST_CONFIG_DIR
struct namelist * globalvars_last
int ast_add_extension2(struct ast_context *con, int replace, const char *extension, int priority, const char *label, const char *callerid, const char *application, void *data, void(*datad)(void *), const char *registrar)
void __ast_verbose(const char *file, int line, const char *func, int level, const char *fmt,...)
Send a verbose message (based on verbose level)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
void ast_context_add_include2(struct ast_context *con, const char *value, const char *registrar)
Add a context include.
char * ast_process_quotes_and_slashes(char *start, char find, char replace_with)
Process a string to find and replace characters.
void filter_newlines(char *str)
struct ast_context * ast_walk_contexts(void)
void ast_cli_unregister_multiple(void)
struct ast_context * last_context
void __ast_cli_register_multiple(void)
const char * ast_config_AST_VAR_DIR
const char * ast_get_context_name(struct ast_context *con)
static int dump_extensions
void ast_context_add_switch2(struct ast_context *con, const char *value, const char *data, int eval, const char *registrar)
Adds a switch (first param is a ast_context)
struct ast_include * ast_walk_context_includes(struct ast_context *con, struct ast_include *inc)
struct ast_app * pbx_findapp(const char *app)
Look up an application.
void destroy_namelist(struct namelist *x)
struct ast_exten * ast_walk_context_extensions(struct ast_context *con, struct ast_exten *exten)
struct ast_context * ast_context_create(void **extcontexts, const char *name, const char *registrar)
void ast_module_unregister(const struct ast_module_info *x)
struct namelist * globalvars
Structures for AEL - the Asterisk extension language.
Asterisk main include file. File version handling, generic pbx functions.
struct ast_vector_string * __ast_bt_get_symbols(void **addresses, size_t num_frames)
int __ast_bt_get_addresses(struct ast_bt *bt)
Asterisk backtrace generation.
General Asterisk PBX channel definitions.
#define AST_MAX_EXTENSION
External configuration handlers (realtime and static configuration)
struct ast_exten * localized_find_extension(struct ast_context *bypass, struct pbx_find_info *q, const char *context, const char *exten, int priority, const char *label, const char *callerid, enum ext_match_t action)
void localized_use_conf_dir(void)
void localized_use_local_dir(void)
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
Generic (perhaps overly so) hashtable implementation Hash Table support in Asterisk.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
Asterisk locking-related definitions:
Asterisk module definitions.
ast_app: A registered application
A structure to hold backtrace information. This structure provides an easy means to store backtrace i...
Main Channel structure associated with a channel.
ast_context: An extension context
struct namelist * includes_last
struct namelist * ignorepats
struct namelist * includes
struct namelist * switches
struct ast_ignorepats ignorepats
struct ast_includes includes
struct namelist * switches_last
struct ast_context * next
struct namelist * eswitches_last
struct namelist * ignorepats_last
struct namelist * eswitches
Data structure associated with a custom dialplan function.
ast_exten: An extension The dialplan is saved as a linked list with each context having it's own link...
ast_ignorepat: Ignore patterns in dial plan
ast_include: include= support in extensions.conf
ast_sw: Switch statement in extensions.conf
String vector definitions.
structure to hold extensions