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

Freeswitch SVN anthm at freeswitch.org
Mon Apr 30 20:26:41 EDT 2007


Author: anthm
Date: Mon Apr 30 20:26:41 2007
New Revision: 5047

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
fix some oversights from earlier sip patch

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Apr 30 20:26:41 2007
@@ -953,7 +953,11 @@
 	if (!strcasecmp(argv[1], "stop")) {
 		sofia_clear_pflag_locked(profile, PFLAG_RUNNING);
 		stream->write_function(stream, "stopping: %s", profile->name);
-	} 
+	} else if (!strcasecmp(argv[1], "restart")) {
+		sofia_set_pflag_locked(profile, PFLAG_RESPAWN);
+		sofia_clear_pflag_locked(profile, PFLAG_RUNNING);
+		stream->write_function(stream, "restarting: %s", profile->name);
+	}
 
 	if (profile) {
 		switch_thread_rwlock_unlock(profile->rwlock);

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	Mon Apr 30 20:26:41 2007
@@ -110,7 +110,8 @@
 	PFLAG_PASS_RFC2833 = (1 << 5),
 	PFLAG_DISABLE_TRANSCODING = (1 << 6),
 	PFLAG_REWRITE_TIMESTAMPS = (1 << 7),
-	PFLAG_RUNNING = (1 << 8)
+	PFLAG_RUNNING = (1 << 8),
+	PFLAG_RESPAWN = (1 << 9)
 } PFLAGS;
 
 typedef enum {

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Mon Apr 30 20:26:41 2007
@@ -252,7 +252,7 @@
 	uint32_t ireg_loops = 0;
 	uint32_t gateway_loops = 0;
 	switch_event_t *s_event;
-
+	
 	switch_mutex_lock(mod_sofia_globals.mutex);
 	mod_sofia_globals.threads++;
 	switch_mutex_unlock(mod_sofia_globals.mutex);
@@ -384,6 +384,10 @@
 	sofia_glue_del_profile(profile);
 
 	switch_thread_rwlock_unlock(profile->rwlock);
+
+	if (sofia_test_pflag(profile, PFLAG_RESPAWN)) {
+		config_sofia(1, profile->name);
+	}
 	
 	switch_core_destroy_memory_pool(&pool);
 
@@ -869,6 +873,7 @@
 											parse_gateways(profile, gateways_tag);
 										}
 									}
+									switch_xml_free(droot);
 								}
 							}
 							sofia_glue_add_profile(switch_core_strdup(profile->pool, dname), profile);



More information about the Freeswitch-svn mailing list