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

Freeswitch SVN anthm at freeswitch.org
Wed Oct 25 10:01:04 EDT 2006


Author: anthm
Date: Wed Oct 25 10:01:03 2006
New Revision: 3196

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

Log:
tidy up

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/Makefile	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/Makefile	Wed Oct 25 10:01:03 2006
@@ -1,6 +1,6 @@
 OS_ARCH         := $(subst /,_,$(shell uname -s | sed /\ /s//_/))
 VERSION = sofia-sip-1.12
-TARBALL = sofia-sip-1.12.3.5.tar.gz
+TARBALL = sofia-sip-1.12.3.6.tar.gz
 CFLAGS += -I. -I$(PREFIX)/include/$(VERSION)
 LDFLAGS += -lsofia-sip-ua
 LINKER=$(CC)

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	Wed Oct 25 10:01:03 2006
@@ -1142,16 +1142,18 @@
 	channel = switch_core_session_get_channel(session);
 	assert(channel != NULL);
 
-	cause = switch_channel_get_cause(channel);
-	sip_cause = hangup_cause_to_sip(cause);
-
 	tech_pvt = (private_object_t *) switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);
 
-	deactivate_rtp(tech_pvt);
+	if (switch_test_flag(tech_pvt, TFLAG_BYE)) {
+		return SWITCH_STATUS_SUCCESS;
+	}
 
-	su_home_deinit(tech_pvt->home);
+	cause = switch_channel_get_cause(channel);
+	sip_cause = hangup_cause_to_sip(cause);
 
+	deactivate_rtp(tech_pvt);
+
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n", 
 			  switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
 
@@ -1190,6 +1192,11 @@
 
 	switch_set_flag_locked(tech_pvt, TFLAG_BYE);
 	switch_clear_flag_locked(tech_pvt, TFLAG_IO);
+
+	if (tech_pvt->home) {
+		su_home_deinit(tech_pvt->home);
+		tech_pvt->home = NULL;
+	}
 
 	return SWITCH_STATUS_SUCCESS;
 }



More information about the Freeswitch-svn mailing list