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

Freeswitch SVN anthm at freeswitch.org
Thu Oct 26 16:02:58 EDT 2006


Author: anthm
Date: Thu Oct 26 16:02:57 2006
New Revision: 3214

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

Log:
update

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	Thu Oct 26 16:02:57 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.4.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	Thu Oct 26 16:02:57 2006
@@ -1145,17 +1145,13 @@
 	tech_pvt = (private_object_t *) switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);
 
-	if (switch_test_flag(tech_pvt, TFLAG_BYE)) {
-		return SWITCH_STATUS_SUCCESS;
-	}
-
 	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);
+					  switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
 
 	if (tech_pvt->hash_key) {
 		switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key);
@@ -1181,16 +1177,14 @@
 					nua_cancel(tech_pvt->nh, TAG_END());
 				}
 			}
+			switch_set_flag_locked(tech_pvt, TFLAG_BYE);
 		}
-		nua_handle_destroy(tech_pvt->nh);
-		tech_pvt->nh = NULL;
 	}
 
 	if (tech_pvt->from_str) {
 		switch_safe_free(tech_pvt->from_str);
 	}
 
-	switch_set_flag_locked(tech_pvt, TFLAG_BYE);
 	switch_clear_flag_locked(tech_pvt, TFLAG_IO);
 
 	if (tech_pvt->home) {
@@ -1425,14 +1419,14 @@
 							  switch_channel_get_name(channel),
 							  tech_pvt->local_sdp_str);
 			nua_respond(tech_pvt->nh, SIP_200_OK, 
-						SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+						SIPTAG_CONTACT_STR(tech_pvt->profile->url),
 						SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 						SOATAG_AUDIO_AUX("cn telephone-event"),
 						NUTAG_INCLUDE_EXTRA_SDP(1),
 						TAG_END());
 			
 		}
-	}
+	} 
 
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -1877,7 +1871,7 @@
 #endif
 	}
 	
-	switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, (char*) "%s", data);
+	switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, (char*) "%s", data);
 	free(data);
 }
 
@@ -2435,6 +2429,7 @@
 						switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
 						switch_channel_set_state(channel, CS_INIT);
 						switch_set_flag_locked(tech_pvt, TFLAG_READY);
+						//sofia_answer_channel(session);//XXX TMP
 						switch_core_session_thread_launch(session);
 						
 						if (replaces_str && (replaces = sip_replaces_make(tech_pvt->home, replaces_str)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
@@ -2573,14 +2568,16 @@
 				switch_set_flag_locked(tech_pvt, TFLAG_BYE);
 				if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
 					switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
-					nua_handle_destroy(tech_pvt->nh);
-					tech_pvt->nh = NULL;
 				} else {
 					snprintf(st, sizeof(st), "%d", status);
 					switch_channel_set_variable(channel, "sip_term_status", st);
 					terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__);
 				}
 			}
+			tech_pvt->nh = NULL;
+		}
+		if (nh) {
+			nua_handle_destroy(nh);
 		}
 		break;
 	}



More information about the Freeswitch-svn mailing list