[Freeswitch-trunk] [commit] r13541 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nta

FreeSWITCH SVN mikej at freeswitch.org
Mon Jun 1 15:50:59 PDT 2009


Author: mikej
Date: Mon Jun  1 17:50:59 2009
New Revision: 13541

Log:
Thu May 14 09:05:13 CDT 2009  Aleksander Morgado <aleksander at es.gnu.org>
  * extra_100 parameter at transaction level



Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Mon Jun  1 17:50:59 2009
@@ -1 +1 @@
-Mon Jun  1 17:49:52 CDT 2009
+Mon Jun  1 17:50:41 CDT 2009

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	Mon Jun  1 17:50:59 2009
@@ -440,6 +440,7 @@
   unsigned irq_reliable_tp:1;	/**< Transport is reliable */
   unsigned irq_sigcomp_zap:1;	/**< Reset SigComp */
   unsigned irq_must_100rel:1;	/**< 100rel is required */
+  unsigned irq_extra_100:1;	/**< 100 Trying should be sent */
   unsigned irq_tag_set:1;	/**< Tag is not from request */
   unsigned :0;
 
@@ -5274,6 +5275,7 @@
     }
     irq->irq_branch  = sip->sip_via->v_branch;
     irq->irq_reliable_tp = tport_is_reliable(tport);
+    irq->irq_extra_100 = 1; /* Sending extra 100 trying true by default */
 
     if (sip->sip_timestamp)
       irq->irq_timestamp = sip_timestamp_copy(home, sip->sip_timestamp);
@@ -6016,8 +6018,9 @@
 		sip->sip_request->rq_method_name, irq->irq_status));
     incoming_retransmit_reply(irq, tport);
   }
-  else if (irq->irq_agent->sa_extra_100) {
-    /* Answer automatically with 100 Trying */
+  else if (irq->irq_agent->sa_extra_100 &&
+           irq->irq_extra_100) {
+    /* Agent and Irq configured to answer automatically with 100 Trying */
     if (irq->irq_method == sip_method_invite ||
 	/*
 	 * Send 100 trying to non-invite if at least half of T2 has expired
@@ -6184,11 +6187,11 @@
 
 /**Set server transaction parameters.
  *
- * Sets the server transaction parameters. The parameters determine the way
+ * Sets the server transaction parameters. Among others, parameters determine the way
  * the SigComp compression is handled.
  *
  * @TAGS
- * NTATAG_COMP(), and NTATAG_SIGCOMP_CLOSE().
+ * NTATAG_COMP(), NTATAG_SIGCOMP_CLOSE() and NTATAG_EXTRA_100().
  *
  * @retval number of set parameters when succesful
  * @retval -1 upon an error
@@ -6234,6 +6237,9 @@
 
     else if (tptag_compartment == tt)
       cc = (void *)t->t_value, retval++;
+
+    else if (ntatag_extra_100 == tt)
+      irq->irq_extra_100 = t->t_value != 0, retval++;
   }
 
   if (cc != NONE) {
@@ -6848,9 +6854,16 @@
     }
     else {
       /* Timer N1 */
-      SU_DEBUG_5(("nta: timer N1 fired, sending %u %s\n", SIP_100_TRYING));
       incoming_reset_timer(irq);
-      nta_incoming_treply(irq, SIP_100_TRYING, TAG_END());
+
+      if(irq->irq_extra_100) {
+        SU_DEBUG_5(("nta: timer N1 fired, sending %u %s\n", SIP_100_TRYING));
+        nta_incoming_treply(irq, SIP_100_TRYING, TAG_END());
+      }
+      else {
+        SU_DEBUG_5(("nta: timer N1 fired, but avoided sending %u %s\n",
+                    SIP_100_TRYING));
+      }
     }
   }
 

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	Mon Jun  1 17:50:59 2009
@@ -967,9 +967,17 @@
  * to a request within half of the SIP T2 (the default value for T2 is 4000
  * milliseconds, so the extra <i>100 Trying</i> would be sent after 2 seconds).
  *
+ * At agent level, this option applies to retransmissions of both non-INVITE
+ * and INVITE transactions.
+ *
+ * At incoming request level, this option can disable sending the 100 Trying for
+ * both retransmissions (if set at agent level) and N1 firings, for just a given
+ * incoming request.
+ *
  * @par Used with
  *    nua_create(), nua_set_params(),
- *    nta_agent_create(), nta_agent_set_params()
+ *    nta_agent_create(), nta_agent_set_params(),
+ *    nta_incoming_set_params()
  *
  * @par Parameter type
  *    boolean: true (non-zero or non-NULL pointer)
@@ -979,9 +987,12 @@
  *    - true - send extra 100 Trying if application does not respond
  *    - false - do not send 100 Trying
  *
- * @par Default Value
+ * @par Default Value at Agent level
  *    - 0 (false, do not respond with 100 Trying to retransmissions)
-
+ *
+ * @par Default Value at incoming transaction level
+ *    - 1 (true, respond with 100 Trying to retransmissions and when N1 fired)
+ *
  * @sa @RFC4320, NTATAG_PASS_408(), NTATAG_TIMEOUT_408()
  */
 tag_typedef_t ntatag_extra_100 = BOOLTAG_TYPEDEF(extra_100);



More information about the Freeswitch-trunk mailing list