Browse code

core: drop reply in K compatible style

- drop reply in default onreply_route when using 'drop'

Daniel-Constantin Mierla authored on 29/10/2009 10:28:20 • Andrei Pelinescu-Onciul committed on 01/02/2010 11:01:57
Showing 1 changed files
... ...
@@ -91,6 +91,7 @@ unsigned int inc_msg_no(void)
91 91
 int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) 
92 92
 {
93 93
 	struct sip_msg* msg;
94
+	struct run_act_ctx ctx;
94 95
 	int ret;
95 96
 #ifdef STATS
96 97
 	int skipped = 1;
... ...
@@ -228,13 +229,17 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
228 229
 		/* exec the onreply routing script */
229 230
 		if (onreply_rt.rlist[DEFAULT_RT]){
230 231
 			set_route_type(ONREPLY_ROUTE);
231
-			ret=run_top_route(onreply_rt.rlist[DEFAULT_RT], msg, 0);
232
+			ret=run_top_route(onreply_rt.rlist[DEFAULT_RT], msg, &ctx);
233
+#if 0
232 234
 			if (ret<0){
233 235
 				LOG(L_WARN, "WARNING: receive_msg: "
234 236
 						"error while trying onreply script\n");
235 237
 				goto error_rpl;
236
-			}else if (ret==0) goto skip_send_reply; /* drop the message, 
237
-													   no error */
238
+			}else
239
+#endif
240
+			if (ctx.run_flags&DROP_R_F){
241
+				goto skip_send_reply; /* drop the message, no error */
242
+			}
238 243
 		}
239 244
 		/* send the msg */
240 245
 		forward_reply(msg);
... ...
@@ -264,11 +269,13 @@ end:
264 269
 	if (skipped) STATS_RX_DROPS;
265 270
 #endif
266 271
 	return 0;
272
+#if 0
267 273
 error_rpl:
268 274
 	/* execute post reply-script callbacks */
269 275
 	exec_post_script_cb(msg, ONREPLY_CB_TYPE);
270 276
 	reset_avps();
271 277
 	goto error02;
278
+#endif
272 279
 error_req:
273 280
 	DBG("receive_msg: error:...\n");
274 281
 	/* execute post request-script callbacks */