From 3fcad05e85659cafbf71fb4f6a7d77f130225d3a Mon Sep 17 00:00:00 2001 From: tilghman Date: Tue, 3 Jun 2008 22:08:56 +0000 Subject: Merged revisions 120171 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r120171 | tilghman | 2008-06-03 17:05:16 -0500 (Tue, 03 Jun 2008) | 5 lines Move compatibility options into asterisk.conf, default them to on for upgrades, and off for new installations. This includes the translation from pipes to commas for pbx_realtime and the EXEC command for AGI, as well as the change to the Set application not to support multiple variables at once. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@120172 f38db490-d61c-443f-a65b-d21fe96a405b --- main/asterisk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'main/asterisk.c') diff --git a/main/asterisk.c b/main/asterisk.c index 1c76558f5..d67d7f0da 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -155,6 +155,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 */ @@ -2760,6 +2761,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); } -- cgit v1.2.3