[Asterisk-cvs] asterisk/pbx pbx_config.c, 1.53, 1.54 pbx_dundi.c, 1.26, 1.27 pbx_realtime.c, 1.8, 1.9

markster at lists.digium.com markster at lists.digium.com
Tue Jan 25 00:08:02 CST 2005


Update of /usr/cvsroot/asterisk/pbx
In directory mongoose.digium.com:/tmp/cvs-serv27198/pbx

Modified Files:
	pbx_config.c pbx_dundi.c pbx_realtime.c 
Log Message:
Merge config updates (bug #3406)


Index: pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- pbx_config.c	21 Jan 2005 07:06:25 -0000	1.53
+++ pbx_config.c	25 Jan 2005 06:10:20 -0000	1.54
@@ -972,13 +972,13 @@
 		snprintf(filename, sizeof(filename), "%s/%s",
 			(char *)ast_config_AST_CONFIG_DIR, config);
 
-	cfg = ast_load("extensions.conf");
+	cfg = ast_config_load("extensions.conf");
 
 	/* try to lock contexts list */
 	if (ast_lock_contexts()) {
 		ast_cli(fd, "Failed to lock contexts list\n");
 		ast_mutex_unlock(&save_dialplan_lock);
-		ast_destroy(cfg);
+		ast_config_destroy(cfg);
 		return RESULT_FAILURE;
 	}
 
@@ -988,7 +988,7 @@
 			filename);
 		ast_unlock_contexts();
 		ast_mutex_unlock(&save_dialplan_lock);
-		ast_destroy(cfg);
+		ast_config_destroy(cfg);
 		return RESULT_FAILURE;
 	}
 
@@ -1006,7 +1006,7 @@
 		fprintf(output, "\n");
 	}
 
-	ast_destroy(cfg);
+	ast_config_destroy(cfg);
 	
 	/* walk all contexts */
 	c = ast_walk_contexts(NULL);
@@ -1623,7 +1623,7 @@
 	char realvalue[256];
 	int lastpri = -2;
 
-	cfg = ast_load(config);
+	cfg = ast_config_load(config);
 	if (cfg) {
 		/* Use existing config to populate the PBX table */
 		static_config = ast_true(ast_variable_retrieve(cfg, "general",
@@ -1775,7 +1775,7 @@
 			}
 			cxt = ast_category_browse(cfg, cxt);
 		}
-		ast_destroy(cfg);
+		ast_config_destroy(cfg);
 	}
 	ast_merge_contexts_and_delete(&local_contexts,registrar);
 

Index: pbx_dundi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_dundi.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- pbx_dundi.c	21 Jan 2005 07:06:25 -0000	1.26
+++ pbx_dundi.c	25 Jan 2005 06:10:20 -0000	1.27
@@ -4446,7 +4446,7 @@
 	dundi_eid testeid;
 
 	dundi_ttl = DUNDI_DEFAULT_TTL;
-	cfg = ast_load(config_file);
+	cfg = ast_config_load(config_file);
 	
 	
 	if (!cfg) {
@@ -4569,7 +4569,7 @@
 		cat = ast_category_browse(cfg, cat);
 	}
 	prune_peers();
-	ast_destroy(cfg);
+	ast_config_destroy(cfg);
 	load_password();
 	if (globalpcmodel & DUNDI_MODEL_OUTBOUND)
 		dundi_precache_full();

Index: pbx_realtime.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_realtime.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pbx_realtime.c	21 Jan 2005 07:06:25 -0000	1.8
+++ pbx_realtime.c	25 Jan 2005 06:10:20 -0000	1.9
@@ -13,7 +13,6 @@
 #include <asterisk/logger.h>
 #include <asterisk/channel.h>
 #include <asterisk/config.h>
-#include <asterisk/config_pvt.h>
 #include <asterisk/options.h>
 #include <asterisk/pbx.h>
 #include <asterisk/module.h>
@@ -92,7 +91,6 @@
 {
 	struct ast_variable *var;
 	struct ast_config *cfg;
-	struct ast_category *cat;
 	char pri[20];
 	char *ematch;
 	char rexten[AST_MAX_EXTENSION + 20]="";
@@ -116,27 +114,27 @@
 	if (!var) {
 		cfg = ast_load_realtime_multientry(table, "exten LIKE", "\\_%", "context", context, "priority", pri, NULL);	
 		if (cfg) {
-			cat = cfg->root;
+			char *cat = ast_category_browse(cfg, NULL);
+
 			while(cat) {
 				switch(mode) {
 				case MODE_MATCHMORE:
-					match = ast_extension_close(cat->name, exten, 1);
+					match = ast_extension_close(cat, exten, 1);
 					break;
 				case MODE_CANMATCH:
-					match = ast_extension_close(cat->name, exten, 0);
+					match = ast_extension_close(cat, exten, 0);
 					break;
 				case MODE_MATCH:
 				default:
-					match = ast_extension_match(cat->name, exten);
+					match = ast_extension_match(cat, exten);
 				}
 				if (match) {
-					var = cat->root;
-					cat->root = NULL;
+					var = ast_category_detach_variables(ast_category_get(cfg, cat));
 					break;
 				}
-				cat = cat->next;
+				cat = ast_category_browse(cfg, cat);
 			}
-			ast_destroy(cfg);
+			ast_config_destroy(cfg);
 		}
 	}
 	return var;
@@ -145,7 +143,7 @@
 static int realtime_exists(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
 {
 	REALTIME_COMMON(MODE_MATCH);
-	if (var) ast_destroy_realtime(var);
+	if (var) ast_variables_destroy(var);
 	if (var)
 		res = 1;
 	return res > 0 ? res : 0;
@@ -154,7 +152,7 @@
 static int realtime_canmatch(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
 {
 	REALTIME_COMMON(MODE_CANMATCH);
-	if (var) ast_destroy_realtime(var);
+	if (var) ast_variables_destroy(var);
 	if (var)
 		res = 1;
 	return res > 0 ? res : 0;
@@ -180,7 +178,7 @@
 				tmp = ast_strdupa(v->value);
 			v = v->next;
 		}
-		ast_destroy_realtime(var);
+		ast_variables_destroy(var);
 		if (!ast_strlen_zero(app)) {
 			a = pbx_findapp(app);
 			if (a) {
@@ -212,7 +210,7 @@
 static int realtime_matchmore(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
 {
 	REALTIME_COMMON(MODE_MATCHMORE);
-	if (var) ast_destroy_realtime(var);
+	if (var) ast_variables_destroy(var);
 	if (var)
 		res = 1;
 	return res > 0 ? res : 0;




More information about the svn-commits mailing list