]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Thu May 14 09:05:13 CDT 2009 Aleksander Morgado <aleksander@es.gnu.org>
authorMichael Jerris <mike@jerris.com>
Mon, 1 Jun 2009 22:50:59 +0000 (22:50 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 1 Jun 2009 22:50:59 +0000 (22:50 +0000)
  * extra_100 parameter at transaction level

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13541 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/nta/nta.c
libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c

index 503482ef2d0c0df59ec9878b7f0a2d88255da47f..6bfd8e752bb1f6988e9c1c90a02d7a6b843a36b9 100644 (file)
@@ -1 +1 @@
-Mon Jun  1 17:49:52 CDT 2009
+Mon Jun  1 17:50:41 CDT 2009
index 731c92d4c9026a2428363008459cfc7b857e654c..48ce86614631ce8802a6dbe55caa4b8c3af783e4 100644 (file)
@@ -440,6 +440,7 @@ struct nta_incoming_s
   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 @@ nta_incoming_t *incoming_create(nta_agent_t *agent,
     }
     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 @@ incoming_recv(nta_incoming_t *irq, msg_t *msg, sip_t *sip, tport_t *tport)
                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 @@ incoming_call_callback(nta_incoming_t *irq, msg_t *msg, sip_t *sip)
 
 /**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 @@ int incoming_set_params(nta_incoming_t *irq, tagi_t const *tags)
 
     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 @@ static void incoming_timer(nta_agent_t *sa)
     }
     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));
+      }
     }
   }
 
index ea0a8c17aa5d9d3cf6da43d7492bf194c982a99b..3eb619073d9ab4adfa3ac3cdff421cd78936b361 100644 (file)
@@ -967,9 +967,17 @@ tag_typedef_t ntatag_pass_100 = BOOLTAG_TYPEDEF(pass_100);
  * 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 @@ tag_typedef_t ntatag_pass_100 = BOOLTAG_TYPEDEF(pass_100);
  *    - 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);