[asterisk-commits] tilghman: branch tilghman/config_mtime_cache r79594 - in /team/tilghman/confi...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 15 13:33:37 CDT 2007


Author: tilghman
Date: Wed Aug 15 13:33:36 2007
New Revision: 79594

URL: http://svn.digium.com/view/asterisk?view=rev&rev=79594
Log:
Yet more missing modules

Modified:
    team/tilghman/config_mtime_cache/apps/app_meetme.c
    team/tilghman/config_mtime_cache/apps/app_rpt.c
    team/tilghman/config_mtime_cache/cdr/cdr_radius.c
    team/tilghman/config_mtime_cache/channels/chan_zap.c
    team/tilghman/config_mtime_cache/res/res_config_sqlite.c

Modified: team/tilghman/config_mtime_cache/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/tilghman/config_mtime_cache/apps/app_meetme.c?view=diff&rev=79594&r1=79593&r2=79594
==============================================================================
--- team/tilghman/config_mtime_cache/apps/app_meetme.c (original)
+++ team/tilghman/config_mtime_cache/apps/app_meetme.c Wed Aug 15 13:33:36 2007
@@ -2407,6 +2407,7 @@
 {
 	struct ast_config *cfg;
 	struct ast_variable *var;
+	struct ast_flags config_flags = { 0 };
 	struct ast_conference *cnf;
 	char *parse;
 	AST_DECLARE_APP_ARGS(args,
@@ -2444,7 +2445,7 @@
 			}
 		} else {
 			/* Check the config */
-			cfg = ast_config_load(CONFIG_FILE_NAME);
+			cfg = ast_config_load(CONFIG_FILE_NAME, config_flags);
 			if (!cfg) {
 				ast_log(LOG_WARNING, "No %s file :(\n", CONFIG_FILE_NAME);
 				return NULL;
@@ -2551,7 +2552,7 @@
 	int allowretry = 0;
 	int retrycnt = 0;
 	struct ast_conference *cnf = NULL;
-	struct ast_flags confflags = {0};
+	struct ast_flags confflags = {0}, config_flags = { 0 };
 	int dynamic = 0;
 	int empty = 0, empty_no_pin = 0;
 	int always_prompt = 0;
@@ -2609,7 +2610,7 @@
 
 			/* We only need to load the config file for static and empty_no_pin (otherwise we don't care) */
 			if ((empty_no_pin) || (!dynamic)) {
-				cfg = ast_config_load(CONFIG_FILE_NAME);
+				cfg = ast_config_load(CONFIG_FILE_NAME, config_flags);
 				if (cfg) {
 					var = ast_variable_browse(cfg, "rooms");
 					while (var) {
@@ -3174,11 +3175,12 @@
 static void load_config_meetme(void)
 {
 	struct ast_config *cfg;
+	struct ast_flags config_flags = { 0 };
 	const char *val;
 
 	audio_buffers = DEFAULT_AUDIO_BUFFERS;
 
-	if (!(cfg = ast_config_load(CONFIG_FILE_NAME)))
+	if (!(cfg = ast_config_load(CONFIG_FILE_NAME, config_flags)))
 		return;
 
 	if ((val = ast_variable_retrieve(cfg, "general", "audiobuffers"))) {
@@ -4894,6 +4896,7 @@
 static int sla_load_config(int reload)
 {
 	struct ast_config *cfg;
+	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 	const char *cat = NULL;
 	int res = 0;
 	const char *val;
@@ -4903,8 +4906,10 @@
 		ast_cond_init(&sla.cond, NULL);
 	}
 
-	if (!(cfg = ast_config_load(SLA_CONFIG_FILE)))
+	if (!(cfg = ast_config_load(SLA_CONFIG_FILE, config_flags)))
 		return 0; /* Treat no config as normal */
+	else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+		return 0;
 
 	if ((val = ast_variable_retrieve(cfg, "general", "attemptcallerid")))
 		sla.attempt_callerid = ast_true(val);

Modified: team/tilghman/config_mtime_cache/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/tilghman/config_mtime_cache/apps/app_rpt.c?view=diff&rev=79594&r1=79593&r2=79594
==============================================================================
--- team/tilghman/config_mtime_cache/apps/app_rpt.c (original)
+++ team/tilghman/config_mtime_cache/apps/app_rpt.c Wed Aug 15 13:33:36 2007
@@ -918,6 +918,7 @@
 	int	j;
 	struct ast_variable *vp, *var;
 	struct ast_config *cfg;
+	struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
 #ifdef	__RPT_NOTCH
 	AST_DECLARE_APP_ARGS(strs,
 		AST_APP_ARG(str)[100];
@@ -929,7 +930,7 @@
 	ast_mutex_lock(&rpt_vars[n].lock);
 	if (rpt_vars[n].cfg)
 		ast_config_destroy(rpt_vars[n].cfg);
-	cfg = ast_config_load("rpt.conf");
+	cfg = ast_config_load("rpt.conf", config_flags);
 	if (!cfg) {
 		ast_mutex_unlock(&rpt_vars[n].lock);
 		ast_log(LOG_NOTICE, "Unable to open radio repeater configuration rpt.conf.  Radio Repeater disabled.\n");
@@ -7437,7 +7438,8 @@
 
 static int load_module(void)
 {
-	struct ast_config *cfg = ast_config_load("rpt.conf");
+	struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
+	struct ast_config *cfg = ast_config_load("rpt.conf", config_flags);
 	if (!cfg) {
 		ast_log(LOG_WARNING, "No such configuration file rpt.conf\n");
 		return AST_MODULE_LOAD_DECLINE;

Modified: team/tilghman/config_mtime_cache/cdr/cdr_radius.c
URL: http://svn.digium.com/view/asterisk/team/tilghman/config_mtime_cache/cdr/cdr_radius.c?view=diff&rev=79594&r1=79593&r2=79594
==============================================================================
--- team/tilghman/config_mtime_cache/cdr/cdr_radius.c (original)
+++ team/tilghman/config_mtime_cache/cdr/cdr_radius.c Wed Aug 15 13:33:36 2007
@@ -232,10 +232,11 @@
 static int load_module(void)
 {
 	struct ast_config *cfg;
+	struct ast_flags config_flags = { 0 };
 	int res;
 	const char *tmp;
 
-	if ((cfg = ast_config_load(cdr_config))) {
+	if ((cfg = ast_config_load(cdr_config, config_flags))) {
 		ast_set2_flag(&global_flags, ast_true(ast_variable_retrieve(cfg, "radius", "usegmtime")), RADIUS_FLAG_USEGMTIME);
 		ast_set2_flag(&global_flags, ast_true(ast_variable_retrieve(cfg, "radius", "loguniqueid")), RADIUS_FLAG_LOGUNIQUEID);
 		ast_set2_flag(&global_flags, ast_true(ast_variable_retrieve(cfg, "radius", "loguserfield")), RADIUS_FLAG_LOGUSERFIELD);

Modified: team/tilghman/config_mtime_cache/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/tilghman/config_mtime_cache/channels/chan_zap.c?view=diff&rev=79594&r1=79593&r2=79594
==============================================================================
--- team/tilghman/config_mtime_cache/channels/chan_zap.c (original)
+++ team/tilghman/config_mtime_cache/channels/chan_zap.c Wed Aug 15 13:33:36 2007
@@ -12639,25 +12639,21 @@
 	int dchannels[NUM_DCHANS];
 #endif
 
-	for (x = 0; x < 2; x++) {
+	cfg = ast_config_load(config, config_flags);
+
+	/* Error if we have no config file */
+	if (!cfg) {
+		ast_log(LOG_ERROR, "Unable to load config %s\n", config);
+		return 0;
+	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
+		ucfg = ast_config_load("users.conf", config_flags);
+		if (ucfg == CONFIG_STATUS_FILEUNCHANGED)
+			return 0;
+		ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
 		cfg = ast_config_load(config, config_flags);
-
-		/* Error if we have no config file */
-		if (!cfg) {
-			ast_log(LOG_ERROR, "Unable to load config %s\n", config);
-			return 0;
-		} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
-			ucfg = ast_config_load("users.conf");
-			if (ucfg == CONFIG_STATUS_FILEUNCHANGED)
-				return 0;
-			/* Need to reread both, since users.conf has changed */
-			ast_config_destroy(ucfg);
-			ast_clear_flag(&flags, CONFIG_FLAG_FILEUNCHANGED);
-			continue;
-		} else {
-			ucfg = ast_config_load("users.conf");
-			break;
-		}
+	} else {
+		ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
+		ucfg = ast_config_load("users.conf", config_flags);
 	}
 
 	/* It's a little silly to lock it, but we mind as well just to be sure */

Modified: team/tilghman/config_mtime_cache/res/res_config_sqlite.c
URL: http://svn.digium.com/view/asterisk/team/tilghman/config_mtime_cache/res/res_config_sqlite.c?view=diff&rev=79594&r1=79593&r2=79594
==============================================================================
--- team/tilghman/config_mtime_cache/res/res_config_sqlite.c (original)
+++ team/tilghman/config_mtime_cache/res/res_config_sqlite.c Wed Aug 15 13:33:36 2007
@@ -300,14 +300,14 @@
  * \param table the table to use
  * \param file the file to load from the database
  * \param cfg the struct ast_config object to use when storing variables
- * \param withcomments	Integer. Flag
+ * \param flags Optional flags.  Not used.
  * \retval cfg object
  * \retval NULL if an error occurred
  * \see add_cfg_entry()
  */
 static struct ast_config * config_handler(const char *database,
 	const char *table, const char *file,
-	struct ast_config *cfg, int withcomments);
+	struct ast_config *cfg, struct ast_flags flags);
 
 /*!
  * \brief Helper function to parse a va_list object into 2 dynamic arrays of
@@ -611,8 +611,9 @@
 	struct ast_config *config;
 	struct ast_variable *var;
 	int error;
-
-	config = ast_config_load(RES_SQLITE_CONF_FILE);
+	struct ast_flags config_flags = { 0 };
+
+	config = ast_config_load(RES_SQLITE_CONF_FILE, config_flags);
 
 	if (!config) {
 		ast_log(LOG_ERROR, "Unable to load " RES_SQLITE_CONF_FILE "\n");
@@ -725,7 +726,7 @@
 }
 
 static struct ast_config *config_handler(const char *database, 
-	const char *table, const char *file, struct ast_config *cfg, int withcomments)
+	const char *table, const char *file, struct ast_config *cfg, struct ast_flags flags)
 {
 	struct cfg_entry_args args;
 	char *errormsg;




More information about the asterisk-commits mailing list