[Freeswitch-svn] [commit] r8643 - in freeswitch/trunk: libs/sofia-sip/libsofia-sip-ua/nta src/mod/endpoints/mod_sofia

Freeswitch SVN mikej at freeswitch.org
Sun May 25 17:22:35 EDT 2008


Author: mikej
Date: Sun May 25 17:22:35 2008
New Revision: 8643

Modified:
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
add NTATAG_SERVER_RPORT(2) that will act like there is always a rport in the via.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	Sun May 25 17:22:35 2008
@@ -987,7 +987,7 @@
   void *smime         = agent->sa_smime;
   uint32_t flags      = agent->sa_flags;
   int rport           = agent->sa_rport;
-  int server_rport    = agent->sa_server_rport;
+  unsigned server_rport    = agent->sa_server_rport;
   int tcp_rport       = agent->sa_tcp_rport;
   unsigned preload         = agent->sa_preload;
   unsigned threadpool      = agent->sa_tport_threadpool;
@@ -2579,7 +2579,7 @@
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
   }
-  else {
+  else if (agent->sa_server_rport == 2) {
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
   } 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h	Sun May 25 17:22:35 2008
@@ -226,7 +226,7 @@
   /** If true, use rport at client */
   unsigned              sa_rport:1;
   /** If true, use rport at server */
-  unsigned              sa_server_rport:1;
+  unsigned              sa_server_rport:2;
   /** If true, use rport with tcp, too */
   unsigned              sa_tcp_rport:1;
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c	Sun May 25 17:22:35 2008
@@ -1334,7 +1334,7 @@
  *
  * @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), @Via
  */
-tag_typedef_t ntatag_server_rport = BOOLTAG_TYPEDEF(server_rport);
+tag_typedef_t ntatag_server_rport = UINTTAG_TYPEDEF(server_rport);
 
 
 /**@def NTATAG_TCP_RPORT(x)

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	Sun May 25 17:22:35 2008
@@ -544,6 +544,7 @@
 							TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), NUTAG_CERTIFICATE_DIR(profile->tls_cert_dir)),
 							TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), TPTAG_TLS_VERSION(profile->tls_version)),
 							NTATAG_UDP_MTU(65536),
+							NTATAG_SERVER_RPORT(2),
 							TAG_IF(tportlog, TPTAG_LOG(1)),
 							TAG_END());	/* Last tag should always finish the sequence */
 
@@ -586,6 +587,7 @@
 		node->nua = nua_create(profile->s_root,	/* Event loop */
 								sofia_event_callback,	/* Callback for processing events */
 								profile,	/* Additional data to pass to callback */
+								NTATAG_SERVER_RPORT(2),
 								NUTAG_URL(node->url), TAG_END());	/* Last tag should always finish the sequence */
 
 		nua_set_params(node->nua,



More information about the Freeswitch-svn mailing list