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

Freeswitch SVN anthm at freeswitch.org
Wed Nov 21 12:07:42 EST 2007


Author: anthm
Date: Wed Nov 21 12:07:41 2007
New Revision: 6370

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_glue.c

Log:
fix FSCORE-62

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 Nov 21 12:07:41 2007
@@ -327,7 +327,7 @@
 			session_timeout = v_session_timeout;
 		}
 	}
-
+	printf("GRRXXXXXXXXXXXXX\n%s\n", tech_pvt->local_sdp_str);
 	nua_respond(tech_pvt->nh, SIP_200_OK,
 				NUTAG_SESSION_TIMER(session_timeout),
 				SIPTAG_CONTACT_STR(tech_pvt->reply_contact),

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	Wed Nov 21 12:07:41 2007
@@ -299,6 +299,7 @@
 	char *rpid;
 	char *gateway_from_str;
 	char *rm_encoding;
+	char *iananame;
 	char *rm_fmtp;
 	char *fmtp_out;
 	char *remote_sdp_str;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Wed Nov 21 12:07:41 2007
@@ -868,7 +868,7 @@
 		if (!force) {
 			return SWITCH_STATUS_SUCCESS;
 		}
-		if (strcasecmp(tech_pvt->read_codec.implementation->iananame, tech_pvt->rm_encoding) ||
+		if (strcasecmp(tech_pvt->read_codec.implementation->iananame, tech_pvt->iananame) ||
 			tech_pvt->read_codec.implementation->samples_per_second != tech_pvt->rm_rate) {
 
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Changing Codec from %s to %s\n",
@@ -882,13 +882,13 @@
 		}
 	}
 
-	if (!tech_pvt->rm_encoding) {
+	if (!tech_pvt->iananame) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec with no name?\n");
 		return SWITCH_STATUS_FALSE;
 	}
 
 	if (switch_core_codec_init(&tech_pvt->read_codec,
-							   tech_pvt->rm_encoding,
+							   tech_pvt->iananame,
 							   tech_pvt->rm_fmtp,
 							   tech_pvt->rm_rate,
 							   tech_pvt->codec_ms,
@@ -899,7 +899,7 @@
 		return SWITCH_STATUS_FALSE;
 	} else {
 		if (switch_core_codec_init(&tech_pvt->write_codec,
-								   tech_pvt->rm_encoding,
+								   tech_pvt->iananame,
 								   tech_pvt->rm_fmtp,
 								   tech_pvt->rm_rate,
 								   tech_pvt->codec_ms,
@@ -913,7 +913,7 @@
 			tech_pvt->read_frame.rate = tech_pvt->rm_rate;
 			ms = tech_pvt->write_codec.implementation->microseconds_per_frame / 1000;
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set Codec %s %s/%ld %d ms %d samples\n",
-							  switch_channel_get_name(tech_pvt->channel), tech_pvt->rm_encoding, tech_pvt->rm_rate, tech_pvt->codec_ms,
+							  switch_channel_get_name(tech_pvt->channel), tech_pvt->iananame, tech_pvt->rm_rate, tech_pvt->codec_ms,
 							  tech_pvt->read_codec.implementation->samples_per_frame
 							  );
 			tech_pvt->read_frame.codec = &tech_pvt->read_codec;
@@ -1371,21 +1371,20 @@
 				}
 
 				if (mimp) {
-					if ((tech_pvt->rm_encoding = switch_core_session_strdup(session, (char *) rm_encoding))) {
-						char tmp[50];
-						tech_pvt->pt = (switch_payload_t) map->rm_pt;
-						tech_pvt->rm_rate = map->rm_rate;
-						tech_pvt->codec_ms = mimp->microseconds_per_frame / 1000;
-						tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(session, (char *) connection->c_address);
-						tech_pvt->rm_fmtp = switch_core_session_strdup(session, (char *) map->rm_fmtp);
-						tech_pvt->remote_sdp_audio_port = (switch_port_t) m->m_port;
-						tech_pvt->agreed_pt = (switch_payload_t) map->rm_pt;
-						snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
-						switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE, tech_pvt->remote_sdp_audio_ip);
-						switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp);
-					} else {
-						match = 0;
-					}
+					char tmp[50];
+					tech_pvt->rm_encoding = switch_core_session_strdup(session, (char *) map->rm_encoding);
+					tech_pvt->iananame = switch_core_session_strdup(session, (char *) mimp->iananame);
+					tech_pvt->pt = (switch_payload_t) map->rm_pt;
+					tech_pvt->rm_rate = map->rm_rate;
+					tech_pvt->codec_ms = mimp->microseconds_per_frame / 1000;
+					tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(session, (char *) connection->c_address);
+					tech_pvt->rm_fmtp = switch_core_session_strdup(session, (char *) map->rm_fmtp);
+					tech_pvt->remote_sdp_audio_port = (switch_port_t) m->m_port;
+					tech_pvt->agreed_pt = (switch_payload_t) map->rm_pt;
+					snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
+					switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE, tech_pvt->remote_sdp_audio_ip);
+					switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp);
+
 				}
 
 				if (match) {



More information about the Freeswitch-trunk mailing list