[Asterisk-cvs] asterisk/pbx pbx_dundi.c,1.14,1.15

markster at lists.digium.com markster at lists.digium.com
Fri Oct 29 18:28:31 CDT 2004


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

Modified Files:
	pbx_dundi.c 
Log Message:
Oopsies...


Index: pbx_dundi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_dundi.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- pbx_dundi.c	29 Oct 2004 21:47:42 -0000	1.14
+++ pbx_dundi.c	29 Oct 2004 22:31:36 -0000	1.15
@@ -3605,8 +3605,8 @@
 	};
 	if (!qe) {
 		len = sizeof(struct dundi_precache_queue);
-		len += strlen(number + 1);
-		len += strlen(context + 1);
+		len += strlen(number) + 1;
+		len += strlen(context) + 1;
 		qe = malloc(len);
 		if (qe) {
 			memset(qe, 0, len);
@@ -4110,7 +4110,7 @@
 }
 
 
-static void build_peer(dundi_eid *eid, struct ast_variable *v)
+static void build_peer(dundi_eid *eid, struct ast_variable *v, int *globalpcmode)
 {
 	struct dundi_peer *peer;
 	struct ast_hostent he;
@@ -4237,6 +4237,7 @@
 			}
 			v = v->next;
 		}
+		(*globalpcmode) |= peer->pcmodel;
 		if (!peer->model && !peer->pcmodel) {
 			ast_log(LOG_WARNING, "Peer '%s' lacks a model or pcmodel, discarding!\n", 
 				dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid));
@@ -4393,6 +4394,7 @@
 	struct hostent *hp;
 	struct sockaddr_in sin2;
 	static int last_port = 0;
+	int globalpcmodel = 0;
 	dundi_eid testeid;
 
 	dundi_ttl = DUNDI_DEFAULT_TTL;
@@ -4512,7 +4514,7 @@
 		if (strcasecmp(cat, "general") && strcasecmp(cat, "mappings")) {
 			/* Entries */
 			if (!dundi_str_to_eid(&testeid, cat))
-				build_peer(&testeid, ast_variable_browse(cfg, cat));
+				build_peer(&testeid, ast_variable_browse(cfg, cat), &globalpcmodel);
 			else
 				ast_log(LOG_NOTICE, "Ignoring invalid EID entry '%s'\n", cat);
 		}
@@ -4521,7 +4523,8 @@
 	prune_peers();
 	ast_destroy(cfg);
 	load_password();
-	dundi_precache_full();
+	if (globalpcmodel & DUNDI_MODEL_OUTBOUND)
+		dundi_precache_full();
 	return 0;
 }
 




More information about the svn-commits mailing list