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

Freeswitch SVN anthm at freeswitch.org
Mon May 21 17:44:35 EDT 2007


Author: anthm
Date: Mon May 21 17:44:35 2007
New Revision: 5208

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

Log:
make contact: match the to: in 200OK for the sake of interop

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	Mon May 21 17:44:35 2007
@@ -317,7 +317,7 @@
 		}
 
 		nua_respond(tech_pvt->nh, SIP_200_OK,
-					SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+					SIPTAG_CONTACT_STR(tech_pvt->to_uri),
 					SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
 
 	}
@@ -680,7 +680,7 @@
 			sofia_glue_set_local_sdp(tech_pvt, ip, atoi(port), msg->string_arg, 1);
 		}
 		nua_respond(tech_pvt->nh, SIP_200_OK,
-					SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+					SIPTAG_CONTACT_STR(tech_pvt->to_uri),
 					SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
 		switch_channel_mark_answered(channel);
 	}

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 21 17:44:35 2007
@@ -1812,7 +1812,13 @@
 	}
 
 	if (sip->sip_to && sip->sip_to->a_url) {
+		char *val;
 		url_set_chanvars(session, sip->sip_to->a_url, sip_to);
+		if ((val = switch_channel_get_variable(channel, "sip_to_uri"))) {
+			tech_pvt->to_uri = switch_core_session_sprintf(session, "sip:%s", val);
+		} else {
+			tech_pvt->to_uri = tech_pvt->profile->url;
+		}
 	}
 
 	if (sip->sip_contact && sip->sip_contact->m_url) {



More information about the Freeswitch-svn mailing list