[Freeswitch-svn] [commit] r13245 - in freeswitch/trunk: conf/sip_profiles src/mod/endpoints/mod_sofia

FreeSWITCH SVN mrene at freeswitch.org
Wed May 6 11:12:44 PDT 2009


Author: mrene
Date: Wed May  6 13:12:44 2009
New Revision: 13245

Log:
Add sofia profile params to fine-tune timers

Modified:
   freeswitch/trunk/conf/sip_profiles/internal.xml
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Modified: freeswitch/trunk/conf/sip_profiles/internal.xml
==============================================================================
--- freeswitch/trunk/conf/sip_profiles/internal.xml	(original)
+++ freeswitch/trunk/conf/sip_profiles/internal.xml	Wed May  6 13:12:44 2009
@@ -207,6 +207,34 @@
 	 <!--<param name="disable-srv" value="false" />-->
 	 <!--<param name="disable-naptr" value="false" />-->
 
+	<!-- The following can be used to fine-tune timers within sofia's transport layer 
+		 Those settings are for advanced users and can safely be left as-is -->
+		
+	<!-- Initial retransmission interval (in milliseconds).
+		Set the T1 retransmission interval used by the SIP transaction engine. 
+		The T1 is the initial duration used by request retransmission timers A and E (UDP) as well as response retransmission timer G. 	 -->
+	<!-- <param name="timer-T1" value="500" /> -->
+	
+	<!--  Transaction timeout (defaults to T1 * 64).
+		Set the T1x64 timeout value used by the SIP transaction engine.
+		The T1x64 is duration used for timers B, F, H, and J (UDP) by the SIP transaction engine. 
+		The timeout value T1x64 can be adjusted separately from the initial retransmission interval T1. -->
+	<!-- <param name="timer-T1X64" value="32000" /> -->
+	
+	
+	<!-- Maximum retransmission interval (in milliseconds).
+		Set the maximum retransmission interval used by the SIP transaction engine. 
+		The T2 is the maximum duration used for the timers E (UDP) and G by the SIP transaction engine. 
+		Note that the timer A is not capped by T2. Retransmission interval of INVITE requests grows exponentially 
+		until the timer B fires.  -->
+	<!-- <param name="timer-T2" value="4000" /> -->
+		
+	<!--
+		Transaction lifetime (in milliseconds).
+		Set the lifetime for completed transactions used by the SIP transaction engine. 
+		A completed transaction is kept around for the duration of T4 in order to catch late responses. 
+		The T4 is the maximum duration for the messages to stay in the network and the duration of SIP timer K. -->
+	<!-- <param name="timer-T4" value="4000" /> -->
     
   </settings>
 </profile>

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 May  6 13:12:44 2009
@@ -479,6 +479,10 @@
 	uint32_t ob_calls;
 	uint32_t ib_failed_calls;
 	uint32_t ob_failed_calls;
+	uint32_t timer_t1;
+	uint32_t timer_t1x64;
+	uint32_t timer_t2;
+	uint32_t timer_t4;	
 };
 
 struct private_object {

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 May  6 13:12:44 2009
@@ -775,6 +775,10 @@
 							  NTATAG_DEFAULT_PROXY(profile->outbound_proxy),
 							  NTATAG_SERVER_RPORT(profile->rport_level), 
 							  TPTAG_LOG(sofia_test_flag(profile, TFLAG_TPORT_LOG)), 
+							  TAG_IF(profile->timer_t1, NTATAG_SIP_T1(profile->timer_t1)),
+							  TAG_IF(profile->timer_t1x64, NTATAG_SIP_T1X64(profile->timer_t1x64)),
+							  TAG_IF(profile->timer_t2, NTATAG_SIP_T2(profile->timer_t2)),
+							  TAG_IF(profile->timer_t4, NTATAG_SIP_T4(profile->timer_t4)),
 							  TAG_END());	/* Last tag should always finish the sequence */
 
 	if (!profile->nua) {
@@ -1780,6 +1784,38 @@
 							profile->dtmf_duration = SWITCH_DEFAULT_DTMF_DURATION;
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Duration out of bounds, using default of %d!\n", SWITCH_DEFAULT_DTMF_DURATION);
 						}
+					} else if (!strcasecmp(var, "timer-T1")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t1 = v;
+						} else {
+							profile->timer_t1 = 500;
+						}
+						nua_set_params(profile->nua, NTATAG_SIP_T1(profile->timer_t1), TAG_END());
+					} else if (!strcasecmp(var, "timer-T1X64")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t1x64 = v;
+						} else {
+							profile->timer_t1x64 = 32000;
+						}
+						nua_set_params(profile->nua, NTATAG_SIP_T1X64(profile->timer_t1x64), TAG_END());
+					} else if (!strcasecmp(var, "timer-T2")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t2 = v;
+						} else {
+							profile->timer_t2 = 4000;
+						}
+						nua_set_params(profile->nua, NTATAG_SIP_T2(profile->timer_t2), TAG_END());
+					} else if (!strcasecmp(var, "timer-T4")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t4 = v;
+						} else {
+							profile->timer_t4 = 4000;
+						}
+						nua_set_params(profile->nua, NTATAG_SIP_T4(profile->timer_t4), TAG_END());
 					}
 				}
 			}
@@ -2408,6 +2444,34 @@
 						} else {
 							profile->tls_version = 0;
 						}
+					} else if (!strcasecmp(var, "timer-T1")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t1 = v;
+						} else {
+							profile->timer_t1 = 500;
+						}
+					} else if (!strcasecmp(var, "timer-T1X64")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t1x64 = v;
+						} else {
+							profile->timer_t1x64 = 32000;
+						}
+					} else if (!strcasecmp(var, "timer-T2")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t2 = v;
+						} else {
+							profile->timer_t2 = 4000;
+						}
+					} else if (!strcasecmp(var, "timer-T4")) {
+						int v = atoi(val);
+						if (v > 0) {
+							profile->timer_t4 = v;
+						} else {
+							profile->timer_t4 = 4000;
+						}
 					}
 				}
 



More information about the Freeswitch-svn mailing list