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

FreeSWITCH SVN anthm at freeswitch.org
Wed Nov 26 11:30:42 PST 2008


Author: anthm
Date: Wed Nov 26 14:30:40 2008
New Revision: 10544

Log:
patch for SFSIP-104

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

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 26 14:30:40 2008
@@ -367,6 +367,8 @@
 	char *bindurl;
 	char *tls_url;
 	char *tls_bindurl;
+	char *tcp_contact;
+	char *tls_contact;
 	char *sipdomain;
 	char *timer_name;
 	char *hold_music;

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	Wed Nov 26 14:30:40 2008
@@ -2071,11 +2071,15 @@
 					profile->bindurl = profile->url;
 				}
 
+				profile->tcp_contact = switch_core_sprintf(profile->pool, "%s;transport=tcp", profile->url);
+				profile->tls_contact = switch_core_sprintf(profile->pool, "%s;transport=tls", profile->url);
+				
+				
 				if (profile->bind_params) {
 					char *bindurl = profile->bindurl;
 					profile->bindurl = switch_core_sprintf(profile->pool, "%s;%s", bindurl, profile->bind_params);
 				}
-
+				
 				/*
 				 * handle TLS params #2
 				 */

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	Wed Nov 26 14:30:40 2008
@@ -1540,7 +1540,8 @@
 
 		if (status < 200) {
 			char *sticky = NULL;
-
+			char *contact_str = profile->url;
+			
 			if (is_nat) {
 				char params[128] = "";
 				if (contact->m_url->url_params) {
@@ -1555,9 +1556,16 @@
 										network_port,
 										params);
 			}
+			
+			if (switch_stristr("port=tcp", contact->m_url->url_params)) {
+				contact_str = profile->tcp_contact;
+			} else if (switch_stristr("port=tls", contact->m_url->url_params)) {
+				contact_str = profile->tls_contact;
+			}
+
 
-			nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS(nua), SIPTAG_SUBSCRIPTION_STATE_STR(sstr), TAG_IF(sticky, NUTAG_PROXY(sticky)),
-						TAG_END());
+			nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(contact_str), NUTAG_WITH_THIS(nua), SIPTAG_SUBSCRIPTION_STATE_STR(sstr), 
+						TAG_IF(sticky, NUTAG_PROXY(sticky)), TAG_END());
 
 			switch_safe_free(sticky);
 



More information about the Freeswitch-svn mailing list