[Freeswitch-trunk] [commit] r6186 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Thu Nov 8 09:06:33 EST 2007


Author: anthm
Date: Thu Nov  8 09:06:32 2007
New Revision: 6186

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c

Log:
fix profile reload issue

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Thu Nov  8 09:06:32 2007
@@ -1663,14 +1663,17 @@
 	switch_hash_index_t *hi;
 	const void *var;
 	void *val;
+	sofia_profile_t *pptr;
 	
 	switch_mutex_lock(mod_sofia_globals.hash_mutex);
 
 	for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 		switch_hash_this(hi, &var, NULL, &val);
-		aliases[i++] = strdup((char *) var);
-		if (i == 512) {
-			abort();
+		if ((pptr = (sofia_profile_t *) val) && pptr == profile) {
+			aliases[i++] = strdup((char *) var);
+			if (i == 512) {
+				abort();
+			}
 		}
 	}
 
@@ -1681,6 +1684,8 @@
 
 	for (gp = profile->gateways; gp; gp = gp->next) {
 		switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->name);
+		switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_from);
+		switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_contact);
 	}
 
 	switch_mutex_unlock(mod_sofia_globals.hash_mutex);



More information about the Freeswitch-trunk mailing list