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

Freeswitch SVN anthm at freeswitch.org
Mon May 12 10:19:48 EDT 2008


Author: anthm
Date: Mon May 12 10:19:48 2008
New Revision: 8360

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

Log:
update

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 May 12 10:19:48 2008
@@ -345,6 +345,10 @@
 	default:
 		if (nh && ((sofia_private && sofia_private->destroy_nh) || !nua_handle_magic(nh))) {
 			//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Destroy handle [%s]\n", nua_event_name(event));
+			if (sofia_private) {
+				nua_handle_bind(nh, NULL);
+				sofia_private->destroy_me = 1;
+			}
 			nua_handle_destroy(nh);
 		}
 		break;
@@ -1532,8 +1536,6 @@
 		}
 		gateway->ping = switch_timestamp(NULL) + gateway->ping_freq;
 		sofia_reg_release_gateway(gateway);
-		nua_handle_bind(nh, NULL);
-		free(sofia_private);
 		gateway->pinging = 0;
 	} else if ((profile->pflags & PFLAG_UNREG_OPTIONS_FAIL) && status != 200 && sip && sip->sip_to) {
 		char *sql;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Mon May 12 10:19:48 2008
@@ -88,6 +88,7 @@
 			switch_assert(pvt);
 			memset(pvt, 0, sizeof(*pvt));
 			pvt->destroy_nh = 1;
+			pvt->destroy_me = 1;
 			switch_copy_string(pvt->gateway_name, gateway_ptr->name, sizeof(pvt->gateway_name));
 			nua_handle_bind(nh, pvt);
 



More information about the Freeswitch-svn mailing list