36#define AST_MODULE "extconfig"
63#define MAX_NESTED_COMMENTS 128
64#define COMMENT_START ";--"
65#define COMMENT_END "--;"
66#define COMMENT_META ';'
67#define COMMENT_TAG '-'
74#define MIN_VARIABLE_FNAME_SPACE 40
82 const char *
match,
char sep);
122 return *
str ? 0 : -1;
180 unsigned int tmp =
total;
218#define MAX_INCLUDE_LEVEL 10
317 int name_len = strlen(
name) + 1;
318 int val_len = strlen(
value) + 1;
319 int fn_len = strlen(filename) + 1;
326 variable =
__ast_calloc(1, fn_len + name_len + val_len +
sizeof(*variable),
329 char *dst = variable->
stuff;
332 variable->
file = strcpy(dst, filename);
361static void make_fn(
char *fn,
size_t fn_size,
const char *
file,
const char *configfile);
378 snprintf(real_included_file_name, real_included_file_name_size,
"%s~~%d", included_file, inc->
inclusion_count);
379 }
while (stat(real_included_file_name, &statbuf) == 0);
380 ast_log(
LOG_WARNING,
"'%s', line %d: Same File included more than once! This data will be saved in %s if saved back to disk.\n", from_file, from_lineno, real_included_file_name);
382 *real_included_file_name = 0;
409 inc_file =
ast_calloc(1,
sizeof(*inc_file) + strlen(fn) + 1);
414 strcpy(inc_file->
path, fn);
428 for (i = 0; i < globbuf.gl_pathc; i++) {
429 char *matched_path = globbuf.gl_pathv[i];
431 if (access(matched_path, F_OK) != 0) {
436 inc_file =
ast_calloc(1,
sizeof(*inc_file) + strlen(matched_path) + 1);
442 strcpy(inc_file->
path, matched_path);
459 if (
conf->includes_root &&
conf->includes_last) {
460 conf->includes_last->next = inc;
462 conf->includes_root = inc;
464 conf->includes_last = inc;
475 int from_len = strlen(from_file);
476 int to_len = strlen(to_file);
478 if (strcmp(from_file, to_file) == 0)
490 for (incl =
conf->includes_root; incl; incl = incl->
next) {
492 if (from_len >= to_len)
504 for (cat =
conf->root; cat; cat = cat->
next) {
509 if (strcmp(cat->
file, from_file) == 0) {
510 if (from_len >= to_len)
511 strcpy(cat->
file, to_file);
522 if (strcmp(v->
file, from_file)) {
534 strcpy(
str, to_file);
549 if (cat->
last == v) {
564 for (x =
conf->includes_root; x; x = x->
next) {
579 category->
root = variable;
580 category->
last = variable;
591 if (!variable || sscanf(line,
"%30d", &insertline) != 1) {
596 category->
root = variable;
605 cur->
next = variable;
640 while ((
var =
var->next)) {
657 if (!var1 || !var1->
next) {
690 if (
config->last_browse && (
config->last_browse->name == category)) {
691 cat =
config->last_browse;
711 memset(&top, 0,
sizeof(top));
744 for (curr = sh; curr->
next; curr = curr->
next);
748 for (curr = newvar; curr->
next; curr = curr->
next);
757 for (v = *head; v; prev = &v->
next, v = v->
next) {
758 if (!strcmp(v->
name, replacement->
name)) {
774 for (v = *head; v; prev = &v->
next, v = v->
next) {
787 const char *name_value_separator,
const char *quote_char,
struct ast_str **
str)
803 var->value,
S_OR(quote_char,
""),
var->next ? item_separator :
"");
813 const char *name_value_separator,
const char *quote_str)
830 nv_sep =
ast_strlen_zero(name_value_separator) ?
'=' : name_value_separator[0];
854 const char *name_value_separator)
883 if (!strcasecmp(variable, v->
name)) {
890 for (cat =
config->root; cat; cat = cat->
next) {
891 for (v = cat->
root; v; v = v->
next) {
892 if (!strcasecmp(variable, v->
name)) {
903 const char *category,
const char *variable,
const char *
filter)
927 for (v = list; v; v = v->
next) {
928 if (!strcasecmp(variable_name, v->
name)) {
943 if (!(left && right)) {
947 op = strrchr(right->
name,
' ');
965 if (!(left && right)) {
969 for (field = right; field; field = field->
next) {
970 char *space = strrchr(field->
name,
' ');
988 if (!old || strcmp(old->
value, field->
value)) {
1001 for (field = left; field; field = field->
next) {
1005 if (right_count != left_count) {
1017 for (v = list; v; v = v->
next) {
1018 if (!strcasecmp(variable, v->
name)) {
1028 const char *found =
NULL;
1030 for (v = list; v; v = v->
next) {
1031 if (!strcasecmp(variable, v->
name)) {
1043 new->lineno = old->
lineno;
1044 new->object = old->
object;
1065 const char *
match,
char sep)
1069 int match_found = 0, match_expressions = 0;
1070 int template_ok = 0;
1087 char *match_value =
NULL;
1090 regex_t r_name, r_value;
1092 match_expressions++;
1098 if (match_value ==
NULL) {
1102 if (!strcmp(
"TEMPLATES", match_name)) {
1103 if (!strcasecmp(
"include", match_value)) {
1108 }
else if (!strcasecmp(
"restrict", match_value)) {
1119 if ((rc = regcomp(&r_name, match_name, REG_EXTENDED | REG_NOSUB))) {
1121 regerror(rc, &r_name, regerr, 128);
1123 match_name, regerr);
1127 if ((rc = regcomp(&r_value, match_value, REG_EXTENDED | REG_NOSUB))) {
1129 regerror(rc, &r_value, regerr, 128);
1131 match_value, regerr);
1137 for (v = cat->
root; v; v = v->
next) {
1138 if (!regexec(&r_name, v->
name, 0,
NULL, 0)
1139 && !regexec(&r_value, v->
value, 0,
NULL, 0)) {
1147 if (match_found == match_expressions && (!cat->
ignored || template_ok)) {
1163 if (!category->
file) {
1184 const char *category_name,
const char *
filter,
char sep,
char pointer_match_possible)
1188 if (pointer_match_possible) {
1189 for (cat =
config->root; cat; cat = cat->
next) {
1196 for (cat =
config->root; cat; cat = cat->
next) {
1206 const char *category_name,
const char *
filter)
1213 return category->
name;
1253 config->last->next = category;
1263 config->current = category;
1277 config->root->prev = cat;
1282 for (cur_category =
config->root->next; cur_category; cur_category = cur_category->
next) {
1283 if (!strcasecmp(cur_category->
name,
match)) {
1287 cat->
next = cur_category;
1288 cur_category->
prev = cat;
1343 for (incl = incls; incl; incl = inclnext) {
1344 inclnext = incl->
next;
1368 return category->
root;
1404 int nmerges, psize, qsize, i;
1430 for (i = 0; i < insize; i++) {
1442 while (psize > 0 || (qsize > 0 && q)) {
1449 }
else if (qsize == 0 || !q) {
1451 e = p; p = p->
next; psize--;
1452 }
else if ((comparator(p, q) * descending) <= 0) {
1497 }
else if (
config->last_browse && (
config->last_browse->name == prev_name)) {
1499 cat =
config->last_browse->next;
1507 for (cat =
config->root; cat; cat = cat->
next) {
1508 if (cat->
name == prev_name) {
1519 for (cat =
config->root; cat; cat = cat->
next) {
1520 if (!strcasecmp(cat->
name, prev_name)) {
1532 config->last_browse = cat;
1610 if (sscanf(line,
"%30d", &req_item) != 1
1618 cur = category->
root;
1622 if ((0 <= req_item && num_item == req_item)
1623 || (req_item < 0 && !strcasecmp(cur->
name, variable)
1627 if (cur == category->
last)
1631 if (cur == category->
last)
1646 const char *
value,
const char *
match,
unsigned int object)
1654 for (cur = category->
root; cur;
prev = cur, cur = cur->
next) {
1678 newer->object = newer->object || object;
1681 newer->next = cur->
next;
1685 category->
root = newer;
1687 if (category->
last == cur) {
1688 category->
last = newer;
1700 if (!
config || !category) {
1704 if (category->
prev) {
1710 if (category->
next) {
1718 if (
config->last_browse == category) {
1785 sizeof(*cfmtime) + strlen(filename) + 1 + strlen(who_asked) + 1);
1790 strcpy(dst, filename);
1791 dst += strlen(dst) + 1;
1792 cfmtime->
who_asked = strcpy(dst, who_asked);
1812#if defined(HAVE_STRUCT_STAT_ST_MTIM)
1814#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
1816#elif defined(HAVE_STRUCT_STAT_ST_MTIMESPEC)
1888 if (!strcmp(cfmtime->
filename, filename)
1889 && !strcmp(cfmtime->
who_asked, who_asked)) {
1907 if (!strcmp(cfmtime->
filename, configfile) && !strcmp(cfmtime->
who_asked, who_asked))
1923 if (!strcmp(cfinclude->
include, filename)) {
1928 cfinclude =
ast_calloc(1,
sizeof(*cfinclude) + strlen(filename) + 1);
1933 strcpy(cfinclude->
include, filename);
1962 struct stat output_file_info;
1965 if (snprintf(
buf,
sizeof(
buf),
"%s 2>&1 > %s", command, output_file) >=
sizeof(
buf)) {
1966 ast_log(
LOG_ERROR,
"Failed to construct command string to execute %s.\n", command);
1974 fp = popen(
buf,
"r");
1983 while (fgets(
buf,
sizeof(
buf), fp)) {
1985 if (strlen(
buf) ==
sizeof(
buf) - 1 &&
buf[
sizeof(
buf) - 2] !=
'\n') {
1991 while (fgets(
buf,
sizeof(
buf), fp)) {
1992 if (strlen(
buf) !=
sizeof(
buf) - 1 ||
buf[
sizeof(
buf) - 2] ==
'\n') {
2023 if (stat(output_file, &output_file_info) == -1) {
2024 ast_log(
LOG_ERROR,
"#exec <%s>: Unable to stat() temporary file `%s': %s\n",
2028 }
else if (output_file_info.st_size == 0) {
2047 const char *suggested_include_file,
2051 const char *who_asked)
2056 char exec_file[512];
2059 if (cur[0] ==
'[') {
2071 c = strchr(cur,
']');
2098 if (!(cur = strchr(
c,
')'))) {
2104 while ((cur =
strsep(&
c,
","))) {
2105 if (!strcasecmp(cur,
"!")) {
2106 (*cat)->ignored = 1;
2107 }
else if (cur[0] ==
'+') {
2110 if (cur[1] !=
',') {
2118 ast_log(
LOG_WARNING,
"Category addition requested, but category '%s' does not exist, line %d of %s\n", catname,
lineno, configfile);
2123 (*cat)->ignored |= newcat->
ignored;
2136 ast_log(
LOG_WARNING,
"Inheritance requested, but category '%s' does not exist, line %d of %s\n", cur,
lineno, configfile);
2163 }
else if (cur[0] ==
'#') {
2165 char real_inclusion_name[256];
2172 while (*
c && (*
c > 32)) {
2186 if (!strcasecmp(cur,
"include")) {
2188 }
else if (!strcasecmp(cur,
"tryinclude")) {
2190 }
else if (!strcasecmp(cur,
"exec")) {
2192 ast_log(
LOG_WARNING,
"Cannot perform #exec unless execincludes option is enabled in asterisk.conf (options section)!\n");
2213 if ((*
c ==
'"') || (*
c ==
'<')) {
2214 char quote_char = *
c;
2215 if (quote_char ==
'<') {
2219 if (*(
c + strlen(
c) - 1) == quote_char) {
2221 *(
c + strlen(
c) - 1) =
'\0';
2233 snprintf(exec_file,
sizeof(exec_file),
"/var/tmp/exec.%d%d.%ld", (
int)now.tv_sec, (
int)now.tv_usec, (
long)pthread_self());
2241 exec_file[0] =
'\0';
2258 ast_log(
LOG_ERROR,
"The file '%s' was listed as a #include but it does not exist.\n", cur);
2272 *last_inc = newinclude;
2280 "parse error: No category context for line %d of %s\n",
lineno, configfile);
2284 is_escaped = cur[0] ==
'\\';
2293 c = strchr(cur + is_escaped,
'=');
2295 if (
c &&
c > cur + is_escaped && (*(
c - 1) ==
'+')) {
2309 if (!strcmp(
var->name, cur)) {
2316 goto set_new_variable;
2363#if defined(LOW_MEMORY)
2368 char *new_buf, *comment_p, *process_buf;
2374 struct stat statbuf;
2390 if (filename[0] ==
'/') {
2408 globbuf.gl_offs = 0;
2410 if (glob_ret == GLOB_NOSPACE) {
2412 "Glob Expansion of pattern '%s' failed: Not enough memory\n", fn);
2415 "Glob Expansion of pattern '%s' failed: Read error\n", fn);
2420 if (!cfg && (globbuf.gl_pathc != 1 || strcmp(fn, globbuf.gl_pathv[0]))) {
2433 for (i = 0; i < globbuf.gl_pathc; i++) {
2442 if (stat(fn, &statbuf)) {
2449 if (!S_ISREG(statbuf.st_mode)) {
2485 NULL, flags,
"", who_asked)) {
2518 if (!(f = fopen(fn,
"r"))) {
2519 ast_debug(1,
"No file to parse: %s\n", fn);
2520 ast_verb(2,
"Parsing '%s': Not found (%s)\n", fn, strerror(
errno));
2529 if (fgets(
buf,
sizeof(
buf), f)) {
2531 if (strlen(
buf) ==
sizeof(
buf) - 1 &&
buf[
sizeof(
buf) - 2] !=
'\n') {
2533 while (fgets(
buf,
sizeof(
buf), f)) {
2534 if (strlen(
buf) !=
sizeof(
buf) - 1 ||
buf[
sizeof(
buf) - 2] ==
'\n') {
2543#define UTF8_BOM "\xEF\xBB\xBF"
2544 size_t line_bytes = strlen(
buf);
2545 size_t bom_bytes =
sizeof(
UTF8_BOM) - 1;
2546 if (line_bytes >= bom_bytes
2548 memmove(
buf, &
buf[bom_bytes], line_bytes - bom_bytes + 1);
2575 if ((comment_p > new_buf) && (*(comment_p - 1) ==
'\\')) {
2577 new_buf = comment_p;
2579 memmove(comment_p - 1, comment_p, strlen(comment_p) + 1);
2584 new_buf = comment_p + 3;
2590 }
else if ((comment_p >= new_buf + 2) &&
2595 new_buf = comment_p + 1;
2602 oldptr = process_buf + strlen(process_buf);
2608 memmove(oldptr, new_buf, strlen(new_buf) + 1);
2611 process_buf = new_buf;
2618 while ((comment_p > new_buf) && isspace(*(comment_p - 1))) {
2623 if ((comment_p != new_buf) && (*comment_p ==
' ') && (*(comment_p + 1) ==
' ')) {
2634 new_buf = comment_p;
2636 new_buf = comment_p + 1;
2650 suggested_include_file, &last_cat, &last_var, &last_inc,
2668 }
else if (last_var) {
2676 }
else if (last_inc) {
2736static void gen_header(FILE *f1,
const char *configfile,
const char *fn,
const char *generator)
2744 fprintf(f1,
";!\n");
2745 fprintf(f1,
";! Automatically generated configuration file\n");
2746 if (strcmp(configfile, fn))
2747 fprintf(f1,
";! Filename: %s (%s)\n", configfile, fn);
2749 fprintf(f1,
";! Filename: %s\n", configfile);
2750 fprintf(f1,
";! Generator: %s\n", generator);
2751 fprintf(f1,
";! Creation Date: %s", date);
2752 fprintf(f1,
";!\n");
2762static void make_fn(
char *fn,
size_t fn_size,
const char *
file,
const char *configfile)
2765 if (configfile[0] ==
'/') {
2770 }
else if (
file[0] ==
'/') {
2834 int precomment_lines;
2850 }
else if (
lineno == 0) {
2853 }
else if (
lineno - precomment_lines - fi->
lineno < 5) {
2856 for (i = fi->
lineno; i <
lineno - precomment_lines; i++) {
2875 if (access(fn, F_OK)) {
2878 if (access(dn, R_OK | W_OK)) {
2883 if (access(fn, R_OK | W_OK)) {
2897 const char *line = cmt->
cmt;
2900 while ((nl = strchr(line,
'\n')) !=
NULL) {
2902 if (line[0] !=
';' || line[1] !=
'!') {
2904 fprintf(f,
"%s\n", line);
2922 fprintf(f,
"#exec \"%s\"\n", incl->
exec_file);
2970 make_fn(fn,
sizeof(fn), 0, configfile);
2992 fi =
set_fn(fn,
sizeof(fn), included_file->
path, configfile, fileset);
2995 ast_verb(2,
"Saving tryinclude '%s'\n", fn);
3009 fi =
set_fn(fn,
sizeof(fn), 0, configfile, fileset);
3012 (f = fopen(fn,
"w+"))
3014 (f = fopen(fn,
"w"))
3030 fi =
set_fn(fn,
sizeof(fn), cat->
file, configfile, fileset);
3060 fprintf(f,
"[%s]", cat->
name);
3072 fprintf(f,
"%s",x->
name);
3081 fprintf(f,
"%s", cmt->
cmt);
3105 if (!strcasecmp(
var->name, v->
name) && !strcmp(
var->value, v->
value)) {
3110 if (
var->inherited) {
3114 if (!strcasecmp(
var->name, v->
name) && !strcmp(
var->value, v->
value)) {
3129 fi =
set_fn(fn,
sizeof(fn),
var->file, configfile, fileset);
3132 ast_debug(1,
"Unable to open for writing: %s\n", fn);
3133 ast_verb(2,
"Unable to write %s (%s)\n", fn, strerror(
errno));
3160 int escaped_len = 2 * strlen(
var->value) + 1;
3161 char escaped[escaped_len];
3165 if (
var->sameline) {
3166 fprintf(f,
"%s %s %s %s",
var->name, (
var->object ?
"=>" :
"="),
3167 escaped,
var->sameline->cmt);
3169 fprintf(f,
"%s %s %s\n",
var->name, (
var->object ?
"=>" :
"="),
3176 if (
var->blanklines) {
3177 blanklines =
var->blanklines;
3178 while (blanklines--)
3201 ast_debug(1,
"Unable to open for writing: %s\n", fn);
3202 ast_verb(2,
"Unable to write %s (%s)\n", fn, strerror(
errno));
3227 ast_verb(2,
"Saving '%s': saved\n", fn);
3229 ast_debug(1,
"Unable to open for writing: %s\n", fn);
3230 ast_verb(2,
"Unable to write '%s' (%s)\n", fn, strerror(
errno));
3257#ifdef TEST_FRAMEWORK
3267 length =
sizeof(*map);
3268 length += strlen(
name) + 1;
3269 length += strlen(driver) + 1;
3270 length += strlen(database) + 1;
3272 length += strlen(
table) + 1;
3279 dst += strlen(dst) + 1;
3280 map->
driver = strcpy(dst, driver);
3281 dst += strlen(dst) + 1;
3282 map->
database = strcpy(dst, database);
3284 dst += strlen(dst) + 1;
3300 char *driver, *
table, *database, *textpri, *stringp, *tmp;
3324 driver =
strsep(&stringp,
",");
3329 if ((tmp = strchr(stringp,
'\"')))
3333 if (*stringp ==
'"') {
3335 database =
strsep(&stringp,
"\"");
3339 database =
strsep(&stringp,
",");
3343 textpri =
strsep(&stringp,
",");
3344 if (!textpri || !(pri = atoi(textpri))) {
3353 if (!strcmp(v->
name,
"asterisk.conf")) {
3358 if (!strcmp(v->
name,
"logger.conf")) {
3363 if (!driver || !database)
3365 if (!strcasecmp(v->
name,
"iaxfriends")) {
3366 ast_log(
LOG_WARNING,
"The 'iaxfriends' table is obsolete, update your config to use iaxusers and iaxpeers, though they can point to the same table.\n");
3419 if (!strcasecmp(family, map->
name)) {
3423 ast_debug(5,
"Failed to find a realtime mapping for %s\n", family);
3449 if (!strcasecmp(eng->name, map->
driver))
3475 for (cat_iter = old->
root; cat_iter; cat_iter = cat_iter->
next) {
3482 if (cat_iter->
root) {
3484 if (!new_cat->
root) {
3557#define realtime_arguments_to_fields(ap, result) realtime_arguments_to_fields2(ap, 0, result)
3575 const char *newparam;
3611 newparam = va_arg(ap,
const char *);
3612 newval = va_arg(ap,
const char *);
3613 while ((newparam = va_arg(ap,
const char *))) {
3614 newval = va_arg(ap,
const char *);
3619 newparam = va_arg(ap,
const char *);
3624 newval = va_arg(ap,
const char *);
3631 while ((newparam = va_arg(ap,
const char *))) {
3634 newval = va_arg(ap,
const char *);
3642 field->
next = fields;
3661 for (i = 1; ; i++) {
3680 va_start(ap, family);
3713 if (cur->
value[0] ==
' ' && cur->
value[1] ==
'\0') {
3714 char *vptr = (
char *) cur->
value;
3732 va_start(ap, family);
3777 va_start(ap, family);
3778 for (i = 1; ; i++) {
3803 for (i = 1; ; i++) {
3824 for (i = 1; ; i++) {
3847 va_start(ap, family);
3865 for (i = 1; ; i++) {
3884 va_start(ap, lookup);
3902 for (i = 1; ; i++) {
3921 va_start(ap, family);
3928 va_start(ap, family);
3932 if (!lookup_fields || !update_fields) {
3946 for (i = 1; ; i++) {
3965 va_start(ap, family);
3983 for (i = 1; ; i++) {
4002 va_start(ap, lookup);
4018 for (; *chunk; chunk++) {
4019 if (*chunk ==
'^' && strchr(
"0123456789ABCDEFabcdef", chunk[1]) && strchr(
"0123456789ABCDEFabcdef", chunk[2])) {
4020 sscanf(chunk + 1,
"%02hhX", (
unsigned char *)chunk);
4021 memmove(chunk + 1, chunk + 3, strlen(chunk + 3) + 1);
4029 if (!strchr(chunk,
';') && !strchr(chunk,
'^')) {
4033 for (; *chunk; chunk++) {
4034 if (strchr(
";^", *chunk)) {
4048 void *p_result, ...)
4053 va_start(ap, p_result);
4058 int32_t *
result = p_result;
4060 char *endptr =
NULL;
4064 def = va_arg(ap, int32_t);
4067 low = va_arg(ap, int32_t);
4068 high = va_arg(ap, int32_t);
4075 x = strtol(arg, &endptr, 0);
4081 error = (x < low) || (x > high);
4085 }
else if (x > high) {
4097 ast_debug(3,
"extract int from [%s] in [%d, %d] gives [%ld](%d)\n",
4104 unsigned long int x = 0;
4105 uint32_t *
result = p_result;
4107 char *endptr =
NULL;
4111 def = va_arg(ap, uint32_t);
4115 low = va_arg(ap, uint32_t);
4116 high = va_arg(ap, uint32_t);
4130 x = strtoul(arg, &endptr, 0);
4135 error = (x < low) || (x > high);
4139 }
else if (x > high) {
4150 ast_debug(3,
"extract uint from [%s] in [%u, %u] gives [%lu](%d)\n",
4167 def = va_arg(ap,
int);
4170 low = va_arg(ap,
int);
4171 high = va_arg(ap,
int);
4178 if (
error || x < INT_MIN || x > INT_MAX) {
4183 error = (x < low) || (x > high);
4187 }
else if (x > high) {
4199 ast_debug(3,
"extract timelen from [%s] in [%d, %d] gives [%d](%d)\n",
4206 double *
result = p_result;
4207 double x = 0, def =
result ? *
result : 0, low = -HUGE_VAL, high = HUGE_VAL;
4208 char *endptr =
NULL;
4212 def = va_arg(ap,
double);
4216 low = va_arg(ap,
double);
4217 high = va_arg(ap,
double);
4224 x = strtod(arg, &endptr);
4225 if (*endptr ||
errno == ERANGE) {
4229 error = (x < low) || (x > high);
4237 ast_debug(3,
"extract double from [%s] in [%f, %f] gives [%f](%d)\n",
4249 ast_debug(3,
"extract addr from %s gives %s(%d)\n",
4257 struct sockaddr_in _sa_buf;
4258 struct sockaddr_in *sa = p_result ?
4259 (
struct sockaddr_in *)p_result : &_sa_buf;
4262 va_arg(ap,
struct sockaddr_in *) : sa;
4265 memset(&_sa_buf,
'\0',
sizeof(_sa_buf));
4269 sa->sin_family = AF_INET;
4278 sa->sin_port = def->sin_port;
4280 sa->sin_port = def->sin_port;
4282 sa->sin_port = htons(strtol(port,
NULL, 0));
4284 sa->sin_port = def->sin_port;
4291 sa->sin_addr = def->sin_addr;
4293 struct sockaddr_in tmp;
4295 sa->sin_addr = tmp.sin_addr;
4298 "extract inaddr from [%s] gives [%s:%d](%d)\n",
4300 ntohs(sa->sin_port),
error);
4315 e->
command =
"core show config mappings";
4317 "Usage: core show config mappings\n"
4318 " Shows the filenames to config engines.\n";
4328 ast_cli(
a->fd,
"No config mappings found.\n");
4355 "Usage: config reload <filename.conf>\n"
4356 " Reloads all modules that reference <filename.conf>\n";
4363 wordlen = strlen(
a->word);
4377 if (!strncmp(cfmtime->
filename,
a->word, wordlen)) {
4397 if (!strcmp(cfmtime->
filename,
a->argv[2])) {
4416 "Usage: config list\n"
4417 " Show all modules that have loaded a configuration file\n";
4512 if (!strcasecmp(hook->
filename, filename) &&
4513 !strcasecmp(hook->
module, module)) {
4523 const char *filename,
4559 ast_verb(0,
"[ Initializing Custom Configuration Options ]\n");
struct sla_ringing_trunk * first
struct sla_ringing_trunk * last
static int copy(char *infile, char *outfile)
Utility function to copy a file.
static int input(yyscan_t yyscanner)
char * strsep(char **str, const char *delims)
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
void ast_free_ptr(void *ptr)
free() wrapper
void * __ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func) attribute_malloc
#define ast_calloc(num, len)
A wrapper for calloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ao2_alloc(data_size, destructor_fn)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
static int match(struct ast_sockaddr *addr, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
static const char config[]
General Asterisk PBX channel definitions.
#define AST_MAX_USER_FIELD
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,...)
int ast_cli_completion_add(char *value)
Add a result to a request for completion options.
void ast_cli(int fd, const char *fmt,...)
ast_cli_command
calling arguments for new-style handlers.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static char * lline_buffer
static char * comment_buffer
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
static int quote(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int filter(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
int ast_app_parse_timelen(const char *timestr, int *result, enum ast_timelen defunit)
Common routine to parse time lengths, with optional time unit specifier.
void ast_replace_sigchld(void)
Replace the SIGCHLD handler.
void ast_unreplace_sigchld(void)
Restore the SIGCHLD handler.
Configuration File Parser.
@ CONFIG_FLAG_WITHCOMMENTS
@ CONFIG_FLAG_FILEUNCHANGED
#define ast_variable_new(name, value, filename)
#define ast_variable_list_append(head, new_var)
#define CONFIG_STATUS_FILEUNCHANGED
@ CONFIG_SAVE_FLAG_PRESERVE_EFFECTIVE_CONTEXT
#define CONFIG_STATUS_FILEINVALID
ast_parse_flags
Support code to parse config file arguments.
int(* config_hook_cb)(struct ast_config *cfg)
Callback when configuration is updated.
config_hook_flags
Flags that affect the behaviour of config hooks.
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_verb(level,...)
#define AST_LIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a list of specified type, statically initialized.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_INSERT_SORTALPHA(head, elm, field, sortfield)
Inserts a list entry into a alphabetically sorted list.
#define AST_LIST_LAST(head)
Returns the last entry contained in a list.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_LIST_LOCK(head)
Locks a list.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Asterisk locking-related definitions:
#define SCOPED_MUTEX(varname, lock)
scoped lock specialization for mutexes
#define AST_MUTEX_DEFINE_STATIC(mutex)
void ast_include_rename(struct ast_config *conf, const char *from_file, const char *to_file)
static void config_cache_flush_includes(struct cache_file_mtime *cfmtime)
struct ast_variable * ast_variable_list_from_quoted_string(const char *input, const char *item_separator, const char *name_value_separator, const char *quote_str)
Parse a string into an ast_variable list. The reverse of ast_variable_list_join.
static struct ast_cli_entry cli_config[]
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
#define MAX_NESTED_COMMENTS
const char * ast_category_get_name(const struct ast_category *category)
Return the name of the category.
void ast_variable_append(struct ast_category *category, struct ast_variable *variable)
struct ast_category * ast_category_new_template(const char *name, const char *in_file, int lineno)
Create a category making it a template.
struct ast_variable * ast_category_detach_variables(struct ast_category *cat)
static void config_shutdown(void)
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
static void ast_includes_destroy(struct ast_config_include *incls)
int ast_store_realtime(const char *family,...)
Create realtime configuration.
static int cfmstat_cmp(struct cache_file_mtime *cfmtime, struct stat *statbuf)
int ast_variables_match(const struct ast_variable *left, const struct ast_variable *right)
Tests 2 variable values to see if they match.
int ast_store_realtime_fields(const char *family, const struct ast_variable *fields)
Create realtime configuration.
#define MIN_VARIABLE_FNAME_SPACE
int ast_config_hook_register(const char *name, const char *filename, const char *module, enum config_hook_flags flags, config_hook_cb hook_cb)
Register a config hook for a particular file and module.
int ast_config_text_file_save(const char *configfile, const struct ast_config *cfg, const char *generator)
Save a config text file preserving the pre 13.2 behavior.
void ast_category_rename(struct ast_category *cat, const char *name)
void ast_config_sort_categories(struct ast_config *config, int descending, int(*comparator)(struct ast_category *p, struct ast_category *q))
Sorts categories in a config in the order of a numerical value contained within them.
static void config_cache_attribute(const char *configfile, enum config_cache_attribute_enum attrtype, const char *filename, const char *who_asked)
int ast_update_realtime(const char *family, const char *keyfield, const char *lookup,...)
Update realtime configuration.
int ast_destroy_realtime_fields(const char *family, const char *keyfield, const char *lookup, const struct ast_variable *fields)
Destroy realtime configuration.
const char * ast_variable_find_last_in_list(const struct ast_variable *list, const char *variable)
Gets the value of the LAST occurrence of a variable from a variable list.
int ast_variable_delete(struct ast_category *category, const char *variable, const char *match, const char *line)
int ast_realtime_require_field(const char *family,...)
Inform realtime what fields that may be stored.
struct ast_config * ast_config_copy(const struct ast_config *old)
Copies the contents of one ast_config into another.
void ast_config_hook_unregister(const char *name)
Unregister a config hook.
int ast_category_insert(struct ast_config *config, struct ast_category *cat, const char *match)
Inserts new category.
static void config_included_files_destroy(struct ast_config_include *incl)
struct ast_category * ast_category_delete(struct ast_config *config, struct ast_category *category)
Delete a category.
char * ast_realtime_encode_chunk(struct ast_str **dest, ssize_t maxlen, const char *chunk)
Encodes a chunk of data for realtime.
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
static void config_cache_remove(const char *filename, const char *who_asked)
struct ast_variable * ast_variable_list_from_string(const char *input, const char *item_separator, const char *name_value_separator)
Parse a string into an ast_variable list. The reverse of ast_variable_list_join.
static int count_linefeeds_in_comments(struct ast_comment *x)
include_statement_type
Types used for ast_include_new() include_type.
@ CONFIG_STATEMENT_TRYINCLUDE
@ CONFIG_STATEMENT_INCLUDE
static ast_mutex_t config_lock
static int hook_hash(const void *obj, const int flags)
static char * handle_cli_config_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
struct ast_config * ast_config_new(void)
Create a new base configuration structure.
static struct ast_category * category_get_sep(const struct ast_config *config, const char *category_name, const char *filter, char sep, char pointer_match_possible)
static void ast_variable_destroy(struct ast_variable *doomed)
#define realtime_arguments_to_fields(ap, result)
int ast_variable_update(struct ast_category *category, const char *variable, const char *value, const char *match, unsigned int object)
Update variable value within a config.
struct ast_variable * ast_variables_reverse(struct ast_variable *var)
Reverse a variable list.
int ast_realtime_enabled(void)
Check if there's any realtime engines loaded.
static int init_appendbuf(void *data)
const char * ast_variable_find_in_list(const struct ast_variable *list, const char *variable)
Gets the value of a variable from a variable list by name.
int ast_unload_realtime(const char *family)
Release any resources cached for a realtime family.
static struct ast_config * config_text_file_load(const char *database, const char *table, const char *filename, struct ast_config *cfg, struct ast_flags flags, const char *suggested_include_file, const char *who_asked)
static int process_text_line(struct ast_config *cfg, struct ast_category **cat, char *buf, int lineno, const char *configfile, struct ast_flags flags, struct ast_str *comment_buffer, struct ast_str *lline_buffer, const char *suggested_include_file, struct ast_category **last_cat, struct ast_variable **last_var, struct ast_config_include **last_inc, const char *who_asked)
parse one line in the configuration.
static void insert_leading_blank_lines(FILE *fp, struct inclfile *fi, struct ast_comment *precomments, int lineno)
static int hashtab_compare_strings(void *a, void *b, int flags)
static struct ast_category * next_available_category(struct ast_category *cat, const char *name, const char *filter)
config_cache_attribute_enum
struct ast_str * ast_category_get_templates(const struct ast_category *category)
Return the template names this category inherits from.
int ast_config_engine_deregister(struct ast_config_engine *del)
Deregister config engine.
struct ast_config * ast_config_internal_load(const char *filename, struct ast_config *cfg, struct ast_flags flags, const char *suggested_include_file, const char *who_asked)
static int realtime_arguments_to_fields2(va_list ap, int skip, struct ast_variable **result)
struct ast_variable * ast_load_realtime_all(const char *family,...)
struct ast_config_include * ast_include_new(struct ast_config *conf, const char *from_file, const char *included_file, int include_type, const char *exec_file, int from_lineno, char *real_included_file_name, int real_included_file_name_size)
void ast_config_set_current_category(struct ast_config *cfg, const struct ast_category *cat)
Set the category within the configuration as being current.
struct ast_category * ast_category_new(const char *name, const char *in_file, int lineno)
Create a category.
struct ast_variable * ast_load_realtime(const char *family,...)
static struct ast_config_engine * find_engine(const char *family, int priority, char *database, int dbsiz, char *table, int tabsiz)
Find realtime engine for realtime family.
static int reload_module(void)
int ast_update2_realtime(const char *family,...)
Update realtime configuration.
int ast_realtime_is_mapping_defined(const char *family)
Determine if a mapping exists for a given family.
int ast_config_engine_register(struct ast_config_engine *new)
Register config engine.
struct ast_category * ast_config_get_current_category(const struct ast_config *cfg)
Retrieve the current category name being built.
static void move_variables(struct ast_category *old, struct ast_category *new)
struct ast_config * ast_load_realtime_multientry(const char *family,...)
Retrieve realtime configuration.
static int count_linefeeds(char *str)
char * ast_realtime_decode_chunk(char *chunk)
Remove standard encoding from realtime values, which ensures that a semicolon embedded within a singl...
static void gen_header(FILE *f1, const char *configfile, const char *fn, const char *generator)
static void ast_destroy_template_list(struct ast_category *cat)
void ast_category_append(struct ast_config *config, struct ast_category *category)
Appends a category to a config.
int ast_parse_arg(const char *arg, enum ast_parse_flags flags, void *p_result,...)
Helper function to parse arguments See documentation in config.h.
int ast_check_realtime(const char *family)
Check if realtime engine is configured for family.
struct ast_variable * ast_variable_list_append_hint(struct ast_variable **head, struct ast_variable *search_hint, struct ast_variable *newvar)
Appends a variable list to the end of another list.
struct ast_variable * ast_load_realtime_all_fields(const char *family, const struct ast_variable *fields)
static char * handle_cli_core_show_config_mappings(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
struct ast_variable * ast_variables_dup(struct ast_variable *var)
Duplicate variable list.
struct ast_variable * ast_category_root(struct ast_config *config, char *cat)
returns the root ast_variable of a config
static void clear_config_maps(void)
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category)
static void print_include(FILE *f, struct ast_config_include *incl)
static struct ast_threadstorage appendbuf
static void ast_variable_move(struct ast_variable *dst_var, struct ast_variable *src_var)
static void CB_RESET(struct ast_str *cb, struct ast_str *llb)
static void ast_comment_destroy(struct ast_comment **comment)
int ast_category_empty(struct ast_category *category)
Removes and destroys all variables in a category.
static struct ast_variable * variable_clone(const struct ast_variable *old)
int ast_category_is_template(const struct ast_category *category)
Check if category is a template.
static void config_cache_destroy_entry(struct cache_file_mtime *cfmtime)
struct ast_str * ast_variable_list_join(const struct ast_variable *head, const char *item_separator, const char *name_value_separator, const char *quote_char, struct ast_str **str)
Join an ast_variable list with specified separators and quoted values.
static struct ast_config_map * config_maps
static int hash_string(const void *obj, const int flags)
static struct ao2_container * cfg_hooks
#define MAX_INCLUDE_LEVEL
struct ast_variable * ast_load_realtime_fields(const char *family, const struct ast_variable *fields)
Retrieve realtime configuration.
int ast_variable_list_replace(struct ast_variable **head, struct ast_variable *replacement)
Replace a variable in the given list with a new value.
static int handle_include_exec(const char *command, const char *output_file)
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
int ast_destroy_realtime(const char *family, const char *keyfield, const char *lookup,...)
Destroy realtime configuration.
const char * ast_variable_retrieve_filtered(struct ast_config *config, const char *category, const char *variable, const char *filter)
Gets a variable by context and variable names.
int ast_update_realtime_fields(const char *family, const char *keyfield, const char *lookup, const struct ast_variable *fields)
Update realtime configuration.
static void hook_destroy(void *obj)
static int hook_cmp(void *obj, void *arg, int flags)
static void ast_include_destroy(struct ast_config_include *incl)
void ast_category_destroy(struct ast_category *cat)
struct ast_variable * ast_category_first(struct ast_category *cat)
given a pointer to a category, return the root variable.
static struct inclfile * set_fn(char *fn, size_t fn_size, const char *file, const char *configfile, struct ao2_container *fileset)
int ast_config_text_file_save2(const char *configfile, const struct ast_config *cfg, const char *generator, uint32_t flags)
Save a config text file.
const char * ast_config_option(struct ast_config *cfg, const char *cat, const char *var)
Retrieve a configuration variable within the configuration set.
static void cfmstat_save(struct cache_file_mtime *cfmtime, struct stat *statbuf)
static int load_module(void)
int ast_category_exist(const struct ast_config *config, const char *category_name, const char *filter)
Check for category duplicates.
struct ast_variable * ast_variable_list_sort(struct ast_variable *start)
Performs an in-place sort on the variable list by ascending name.
static void CB_ADD_LEN(struct ast_str **cb, const char *str, int len)
static void print_comment(FILE *f, struct ast_comment *comment)
static int is_writable(const char *fn)
static int unload_module(void)
static void make_fn(char *fn, size_t fn_size, const char *file, const char *configfile)
void ast_variable_insert(struct ast_category *category, struct ast_variable *variable, const char *line)
int ast_variable_list_replace_variable(struct ast_variable **head, struct ast_variable *old, struct ast_variable *new)
Replace a variable in the given list with a new variable.
int ast_variable_lists_match(const struct ast_variable *left, const struct ast_variable *right, int exact_match)
Tests 2 variable lists to see if they match.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
static char * extconfig_conf
struct ast_config_include * ast_include_find(struct ast_config *conf, const char *included_file)
struct ast_variable * _ast_variable_new(const char *name, const char *value, const char *filename, const char *file, const char *func, int lineno)
static char * handle_cli_config_list(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static struct cache_file_mtime * cfmtime_new(const char *filename, const char *who_asked)
static int does_category_match(struct ast_category *cat, const char *category_name, const char *match, char sep)
Returns true if ALL of the regex expressions and category name match. Both can be NULL (I....
struct ast_config * ast_load_realtime_multientry_fields(const char *family, const struct ast_variable *fields)
Retrieve realtime configuration.
static struct ast_category * new_category(const char *name, const char *in_file, int lineno, int template)
static struct ast_config_engine * config_engine_list
const struct ast_variable * ast_variable_find_variable_in_list(const struct ast_variable *list, const char *variable_name)
Gets a variable from a variable list by name.
static int ast_realtime_append_mapping(const char *name, const char *driver, const char *database, const char *table, int priority)
int ast_update2_realtime_fields(const char *family, const struct ast_variable *lookup_fields, const struct ast_variable *update_fields)
Update realtime configuration.
static void inclfile_destroy(void *obj)
int ast_category_inherit(struct ast_category *new, const struct ast_category *base)
Applies base (template) to category.
const char * ast_variable_find(const struct ast_category *category, const char *variable)
Gets a variable value from a specific category structure by name.
struct ast_category * ast_category_get(const struct ast_config *config, const char *category_name, const char *filter)
Retrieve a category if it exists.
static struct ast_comment * ALLOC_COMMENT(struct ast_str *buffer)
static void config_hook_exec(const char *filename, const char *module, const struct ast_config *cfg)
static struct ast_config_engine text_file_engine
static void CB_ADD(struct ast_str **cb, const char *str)
static struct ast_variable * variable_list_switch(struct ast_variable *l1, struct ast_variable *l2)
int register_config_cli(void)
Exposed initialization method for core process.
struct ast_category * ast_category_browse_filtered(struct ast_config *config, const char *category_name, struct ast_category *prev, const char *filter)
Browse categories with filters.
#define WEXITSTATUS(status)
#define WIFEXITED(status)
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_FAILURE
Module could not be loaded properly.
@ AST_MODULE_LOAD_SUCCESS
int ast_sockaddr_resolve_first_af(struct ast_sockaddr *addr, const char *name, int flag, int family)
Return the first entry from ast_sockaddr_resolve filtered by address family.
static char * ast_sockaddr_stringify(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() with default format.
#define ast_sockaddr_to_sin(addr, sin)
Converts a struct ast_sockaddr to a struct sockaddr_in.
int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags)
Parse an IPv4 or IPv6 address string.
Wrapper for network related headers, masking differences between various operating systems....
const char * ast_inet_ntoa(struct in_addr ia)
thread-safe replacement for inet_ntoa().
#define ast_opt_exec_includes
Asterisk file paths, configured in asterisk.conf.
const char * ast_config_AST_CONFIG_DIR
String manipulation functions.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
char * ast_strsep_quoted(char **s, const char sep, const char quote, uint32_t flags)
Like ast_strsep() except you can specify a specific quote character.
void ast_str_trim_blanks(struct ast_str *buf)
Trims trailing whitespace characters from an ast_str string.
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
int ast_strings_match(const char *left, const char *op, const char *right)
Compares 2 strings using realtime-style operators.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
char * ast_strsep(char **s, const char sep, uint32_t flags)
Act like strsep but ignore separators inside quotes.
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
struct ast_category_template_instance * next
const struct ast_category * inst
struct ast_comment * precomments
struct ast_category::template_instance_list template_instances
struct ast_category * next
struct ast_variable * last
struct ast_comment * trailing
struct ast_variable * root
struct ast_comment * sameline
struct ast_category * prev
char * file
The file name from whence this declaration was read.
descriptor for a cli entry.
Configuration engine structure, used to define realtime drivers.
realtime_var_get * realtime_func
struct ast_config_engine * next
realtime_destroy * destroy_func
realtime_unload * unload_func
realtime_store * store_func
realtime_multi_get * realtime_multi_func
config_load_func * load_func
realtime_update * update_func
realtime_update2 * update2_func
realtime_require * require_func
char * include_location_file
file name in which the include occurs
char * exec_file
if it's an exec, you'll have both the /var/tmp to read, and the original script
char * included_file
file name included
struct ast_config_include::included_files_list included_files
struct ast_comment * sameline
struct ast_config_include * next
struct ast_comment * precomments
enum include_statement_type include_type
struct ast_comment * trailing
int include_location_lineno
struct ast_config_map * next
struct ast_config_include * includes_root
struct ast_config_include * includes_last
struct ast_category * current
struct ast_category * last
struct ast_category * root
struct ast_category * last_browse
Structure used to handle boolean flags.
Socket address structure.
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
char stuff[0]
Contents of file, name, and value in that order stuffed here.
struct ast_comment * precomments
struct ast_comment * trailing
struct ast_comment * sameline
struct ast_variable * next
Hold the mtime for config files, so if we don't need to reread our config, don't.
struct cache_file_include::@337 list
struct cache_file_mtime::@338 list
struct cache_file_mtime::includes includes
unsigned long stat_mtime_nsec
All configuration options for http media cache.
struct config_included_file * next
struct sla_ringing_trunk * next
static int hook_cb(struct ast_config *cfg)
static struct aco_type item
#define AST_THREADSTORAGE_CUSTOM(a, b, c)
Define a thread storage variable, with custom initialization and cleanup.
void * ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size)
Retrieve thread storage.
Time-related functions and macros.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
int error(const char *format,...)
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ast_clear_flag(p, flag)
char * ast_escape_semicolons(const char *string, char *outbuf, int buflen)
Escape semicolons found in a string.