Revision
15115
Author
anthm
Date
2009-10-08 09:55:16 -0500 (Thu, 08 Oct 2009)

Log Message

fix the crash that was caused by fixing the leak that was preventing the crash in the previous revision

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (15114 => 15115)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2009-10-08 14:01:03 UTC (rev 15114)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2009-10-08 14:55:16 UTC (rev 15115)
@@ -483,6 +483,7 @@
 							SOATAG_REUSE_REJECTED(1),
 							SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), 
 							TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+							SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
 							TAG_END());
 
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "3PCC-PROXY, Sent a 200 OK, waiting for ACK\n");
@@ -571,6 +572,7 @@
 					SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 					SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), 
 					TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+					SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
 					TAG_END());
 		switch_safe_free(extra_headers);
 		sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
@@ -1491,6 +1493,7 @@
 						SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
 						SIPTAG_HEADER_STR(generate_pai_str(session)), 
 						TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
+						SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
 						TAG_END());
 			switch_safe_free(extra_header);
 			switch_channel_mark_ring_ready(channel);
@@ -1576,6 +1579,7 @@
 								SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
 								SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), 
 								TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
+								SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
 								TAG_END());
 					switch_safe_free(extra_header);
 				}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (15114 => 15115)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2009-10-08 14:01:03 UTC (rev 15114)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2009-10-08 14:55:16 UTC (rev 15115)
@@ -96,6 +96,7 @@
 #define SOFIA_SECURE_MEDIA_CONFIRMED_VARIABLE "sip_secure_media_confirmed"
 #define SOFIA_HAS_CRYPTO_VARIABLE "sip_has_crypto"
 #define SOFIA_CRYPTO_MANDATORY_VARIABLE "sip_crypto_mandatory"
+#define SOFIA_ACTUALLY_SUPPORT "UPDATE"
 
 #include <sofia-sip/nua.h>
 #include <sofia-sip/sip_status.h>
@@ -580,6 +581,8 @@
 	char *extrtpip;
 	char *stun_ip;
 	char *route_uri;
+	char *x_actually_supported_remote;
+	char *x_actually_supported_local;
 	switch_port_t stun_port;
 	uint32_t stun_flags;
 	unsigned long rm_rate;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15114 => 15115)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-08 14:01:03 UTC (rev 15114)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-08 14:55:16 UTC (rev 15115)
@@ -5491,6 +5491,8 @@
 				}
 			} else if (!strncasecmp(un->un_name, "History-Info", 12)) {
 				switch_channel_set_variable(channel, "sip_history_info", un->un_value);
+			} else if (!strcasecmp(un->un_name, "X-Actually-Supported")) {
+				tech_pvt->x_actually_supported_remote = switch_core_session_strdup(session, un->un_value);
 			} else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
 				if (!switch_strlen_zero(un->un_value)) {
 					char new_name[512] = "";

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (15114 => 15115)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2009-10-08 14:01:03 UTC (rev 15114)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2009-10-08 14:55:16 UTC (rev 15115)
@@ -1767,6 +1767,7 @@
 			   TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
 			   TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
 			   TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+			   SIPTAG_HEADER_STR("X-Actually-Support: UPDATE"),
 			   TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
 			   TAG_IF(!switch_strlen_zero(route_uri), NUTAG_PROXY(route_uri)),
 			   TAG_IF(!switch_strlen_zero(route), SIPTAG_ROUTE_STR(route)),

Modified: freeswitch/trunk/src/switch_core_file.c (15114 => 15115)


--- freeswitch/trunk/src/switch_core_file.c	2009-10-08 14:01:03 UTC (rev 15114)
+++ freeswitch/trunk/src/switch_core_file.c	2009-10-08 14:55:16 UTC (rev 15115)
@@ -104,7 +104,7 @@
 
 		if ((ext = strrchr(file_path, '.')) == 0) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown file Format [%s]\n", file_path);
-			switch_goto_status(SWITCH_STATUS_FALSE, end);
+			switch_goto_status(SWITCH_STATUS_FALSE, fail);
 		}
 		ext++;
 		fh->file_path = switch_core_strdup(fh->memory_pool, file_path);
@@ -114,7 +114,7 @@
 
 	if ((fh->file_interface = switch_loadable_module_get_file_interface(ext)) == 0) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid file format [%s] for [%s]!\n", ext, file_path);
-		switch_goto_status(SWITCH_STATUS_GENERR, end);
+		switch_goto_status(SWITCH_STATUS_GENERR, fail);
 	}
 
 	fh->file = file;
@@ -155,7 +155,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Spool dir is set.  Make sure [%s] is also a valid path\n", fh->spool_path);
 		}
 		UNPROTECT_INTERFACE(fh->file_interface);
-		switch_goto_status(status, end);
+		switch_goto_status(status, fail);
 	}
 
 
@@ -164,7 +164,7 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File [%s] not created!\n", file_path);
 		fh->file_interface->file_close(fh);
 		UNPROTECT_INTERFACE(fh->file_interface);
-		switch_goto_status(status, end);
+		switch_goto_status(status, fail);
 	}
 
 	if ((flags & SWITCH_FILE_FLAG_READ)) {
@@ -191,8 +191,9 @@
 	}
 
 	switch_set_flag(fh, SWITCH_FILE_OPEN);
+	return status;
 
- end:
+ fail:
 	
 	if (switch_test_flag(fh, SWITCH_FILE_FLAG_FREE_POOL)) {
 		switch_core_destroy_memory_pool(&fh->memory_pool);