Browse code

kr requests only

Jiri Kuthan authored on 29/03/2003 23:58:57
Showing 3 changed files
... ...
@@ -26,6 +26,7 @@
26 26
  *
27 27
  * History
28 28
  * -------
29
+ * 2003-03-30  set_kr for requests only (jiri)
29 30
  * 2003-03-16  removed _TOTAG (jiri)
30 31
  * 2003-03-06  200/INV to-tag list deallocation added;
31 32
  *             setting "kill_reason" moved in here -- it is moved
... ...
@@ -60,10 +61,6 @@ static struct s_table*  tm_table;
60 61
 
61 62
 void set_kr( enum kill_reason _kr )
62 63
 {
63
-	if (kr!=0 && _kr!=0) {
64
-			DBG("DEBUG: set_kr: kill reason reset: "
65
-					"old=%d update=%d\n", kr, _kr );
66
-	}
67 64
 	kr|=_kr;
68 65
 }
69 66
 enum kill_reason get_kr() {
... ...
@@ -51,6 +51,7 @@
51 51
  *
52 52
  * History:
53 53
  * ----------
54
+ * 2003-03-30  set_kr for requests only (jiri)
54 55
  * 2003-03-29  optimization: e2e ACK matching only if callback installed
55 56
  *             (jiri)
56 57
  * 2003-03-06  dialog matching introduced for ACKs -- that's important for 
... ...
@@ -1086,11 +1087,13 @@ int t_unref( struct sip_msg* p_msg  )
1086 1087
 
1087 1088
 	if (T==T_UNDEFINED || T==T_NULL_CELL)
1088 1089
 		return -1;
1089
-	kr=get_kr();
1090
-	if (kr==0 
1091
-		||(p_msg->REQ_METHOD==METHOD_ACK && !(kr & REQ_RLSD))) {
1092
-		LOG(L_WARN, "WARNING: script writer didn't release transaction\n");
1093
-		t_release_transaction(T);
1090
+	if (p_msg->first_line.type==SIP_REQUEST){
1091
+		kr=get_kr();
1092
+		if (kr==0 
1093
+				||(p_msg->REQ_METHOD==METHOD_ACK && !(kr & REQ_RLSD))) {
1094
+			LOG(L_WARN, "WARNING: script writer didn't release transaction\n");
1095
+			t_release_transaction(T);
1096
+		}
1094 1097
 	}
1095 1098
 	UNREF( T );
1096 1099
 	set_t(T_UNDEFINED);
... ...
@@ -61,6 +61,7 @@
61 61
  *  2003-03-10  module export interface updated to the new format (andrei)
62 62
  *  2003-03-16  flags export parameter added (janakj)
63 63
  *  2003-03-19  replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei)
64
+ *  2003-03-30  set_kr for requests only (jiri)
64 65
  */
65 66
 
66 67
 
... ...
@@ -228,13 +229,15 @@ static int script_init( struct sip_msg *foo, void *bar)
228 229
 	   not be used again
229 230
     */
230 231
 
231
-	/* make sure the new message will not inherit previous
232
-	   message's t_on_negative value
233
-	*/
234
-	t_on_negative( 0 );
232
+	if (foo->first_line.type==SIP_REQUEST){
233
+		/* make sure the new message will not inherit previous
234
+	   		message's t_on_negative value
235
+		*/
236
+		t_on_negative( 0 );
235 237
 
236
-	/* reset the kr status */
237
-	set_kr(0);
238
+		/* reset the kr status */
239
+		set_kr(0);
240
+	}
238 241
 
239 242
 	return 1;
240 243
 }