aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index a5683c745..7d3079938 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -156,6 +156,7 @@ int daemon(int, int); /* defined in libresolv of all places */
/*! @{ */
struct ast_flags ast_options = { AST_DEFAULT_OPTIONS };
+struct ast_flags ast_compat = { 7 };
int option_verbose; /*!< Verbosity level */
int option_debug; /*!< Debug level */
@@ -2774,6 +2775,20 @@ static void ast_readconfig(void)
#endif
}
}
+ for (v = ast_variable_browse(cfg, "compat"); v; v = v->next) {
+ float version;
+ if (sscanf(v->value, "%f", &version) != 1) {
+ ast_log(LOG_WARNING, "Compatibility version for option '%s' is not a number: '%s'\n", v->name, v->value);
+ continue;
+ }
+ if (!strcasecmp(v->name, "app_set")) {
+ ast_set2_flag(&ast_compat, version < 1.5 ? 1 : 0, AST_COMPAT_APP_SET);
+ } else if (!strcasecmp(v->name, "res_agi")) {
+ ast_set2_flag(&ast_compat, version < 1.5 ? 1 : 0, AST_COMPAT_DELIM_RES_AGI);
+ } else if (!strcasecmp(v->name, "pbx_realtime")) {
+ ast_set2_flag(&ast_compat, version < 1.5 ? 1 : 0, AST_COMPAT_DELIM_PBX_REALTIME);
+ }
+ }
ast_config_destroy(cfg);
}