Author: rco
Date: 2008-06-03 19:25:11 +0200 (Tue, 03 Jun 2008)
New Revision: 1002

Modified:
   branches/1.0.0/core/plug-in/sipctrl/sip_timers.h
   branches/1.0.0/core/plug-in/sipctrl/sip_trans.h
   branches/1.0.0/core/plug-in/sipctrl/trans_layer.cpp
Log:
- this fixes a severe bug causing UAC transactions to stay for ever in memory 
(backported from trunk r1001).


Modified: branches/1.0.0/core/plug-in/sipctrl/sip_timers.h
===================================================================
--- branches/1.0.0/core/plug-in/sipctrl/sip_timers.h    2008-06-02 10:19:47 UTC 
(rev 1001)
+++ branches/1.0.0/core/plug-in/sipctrl/sip_timers.h    2008-06-03 17:25:11 UTC 
(rev 1002)
@@ -59,6 +59,15 @@
 //type 0x0a
 #define J_TIMER  64*T1_TIMER
 
+
+// This timer is not defined by
+// RFC 3261. But it is needed
+// to handle 200 ACKs automatically
+// in UAC transactions.
+
+//type 0x0b
+#define L_TIMER  64*T1_TIMER
+
 #endif
 
 

Modified: branches/1.0.0/core/plug-in/sipctrl/sip_trans.h
===================================================================
--- branches/1.0.0/core/plug-in/sipctrl/sip_trans.h     2008-06-02 10:19:47 UTC 
(rev 1001)
+++ branches/1.0.0/core/plug-in/sipctrl/sip_trans.h     2008-06-03 17:25:11 UTC 
(rev 1002)
@@ -80,8 +80,13 @@
     STIMER_I,  // Confirmed: -> Terminated
 
     // non-INVITE server transaction
-    STIMER_J   // Completed: -> Terminated
+    STIMER_J,  // Completed: -> Terminated
 
+    // This timer is not defined by
+    // RFC 3261. But it is needed
+    // to handle 200 ACKs automatically
+    // in UAC transactions.
+    STIMER_L  // Terminated_200 -> Terminated
 };
 
 

Modified: branches/1.0.0/core/plug-in/sipctrl/trans_layer.cpp
===================================================================
--- branches/1.0.0/core/plug-in/sipctrl/trans_layer.cpp 2008-06-02 10:19:47 UTC 
(rev 1001)
+++ branches/1.0.0/core/plug-in/sipctrl/trans_layer.cpp 2008-06-03 17:25:11 UTC 
(rev 1002)
@@ -646,7 +646,6 @@
     if(transport->get_local_port() != 5060)
        via += ":" + int2str(transport->get_local_port());
 
-    //request_len += via_len(stl2cstr(via),branch);
     request_len += copy_hdr_len(req->via1);
 
     request_len += copy_hdr_len(req->to)
@@ -937,7 +936,11 @@
                //        - re-transmit ACK.
 
                t->state  = TS_TERMINATED_200;
+               t->clear_timer(STIMER_A);
+               t->clear_timer(STIMER_B);
 
+               t->reset_timer(STIMER_L, L_TIMER, bucket->get_id());
+
                t->to_tag.s = new char[to_tag.len];
                t->to_tag.len = to_tag.len;
                memcpy((void*)t->to_tag.s,to_tag.s,to_tag.len);
@@ -1276,7 +1279,6 @@
 
     switch(type){
 
-
     case STIMER_A:  // Calling: (re-)send INV
 
        n++;
@@ -1291,6 +1293,9 @@
            DBG("Transaction timeout!\n");
            timeout(bucket,tr);
        }
+       else {
+           DBG("Transaction timeout timer hit while state=0x%x",tr->state);
+       }
        break;
 
     case STIMER_F:  // Trying/Proceeding: terminate transaction
@@ -1304,9 +1309,9 @@
            DBG("Transaction timeout!\n");
            timeout(bucket,tr);
            break;
-       case TS_TERMINATED_200:
-           bucket->remove_trans(tr);
-           break;
+//     case TS_TERMINATED_200:
+//         bucket->remove_trans(tr);
+//         break;
        }
        break;
 
@@ -1315,6 +1320,7 @@
     case STIMER_J:  // Completed: -> Terminated
     case STIMER_H:  // Completed: -> Terminated
     case STIMER_I:  // Confirmed: -> Terminated
+    case STIMER_L:  // Terminated_200 -> Terminated
        
        tr->clear_timer(type);
        tr->state = TS_TERMINATED;

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to