Browse Source

tm: drop reply in onreply_route[x]

- K compatible mode to drop reply in TM onreply routes by using 'drop'
  for reply status < 200
Daniel-Constantin Mierla 16 years ago
parent
commit
1f2388acad
1 changed files with 5 additions and 2 deletions
  1. 5 2
      modules/tm/t_reply.c

+ 5 - 2
modules/tm/t_reply.c

@@ -1846,6 +1846,7 @@ int reply_received( struct sip_msg  *p_msg )
 #ifdef TMCB_ONSEND
 	struct tmcb_params onsend_params;
 #endif
+	struct run_act_ctx ctx;
 
 	/* make sure we know the associated transaction ... */
 	if (t_check( p_msg  , &branch )==-1)
@@ -1984,8 +1985,10 @@ int reply_received( struct sip_msg  *p_msg )
 		/* Pre- and post-script callbacks have already
 		 * been executed by the core. (Miklos)
 		 */
-		if (run_top_route(onreply_rt.rlist[t->on_reply], p_msg, 0)<0)
-			LOG(L_ERR, "ERROR: on_reply processing failed\n");
+		run_top_route(onreply_rt.rlist[t->on_reply], p_msg, &ctx);
+		if ((ctx.run_flags&DROP_R_F)  && (msg_status<200)) {
+			goto done;
+		}
 		/* transfer current message context back to t */
 		if (t->uas.request) t->uas.request->flags=p_msg->flags;
 		getbflagsval(0, &uac->branch_flags);