Browse code

core: usage of drop in onsend_route for Kamailio compatibility

- in K exit and drop have different behavior in some cases
- fr onsend_route exit means stop executing the actions and drop does in
addition discard sending the message
(cherry picked from commit 8a43c6fcb21ff7aeb097b1d8791bfc3d8f020bcb)

Daniel-Constantin Mierla authored on 24/12/2009 16:11:58
Showing 1 changed files
... ...
@@ -40,6 +40,7 @@
40 40
 #include "action.h"
41 41
 #include "route.h"
42 42
 #include "script_cb.h"
43
+#include "sr_compat.h"
43 44
 
44 45
 struct onsend_info{
45 46
 	union sockaddr_union* to;
... ...
@@ -89,6 +90,10 @@ static inline int run_onsend(struct sip_msg* orig_msg, struct dest_info* dst,
89 89
 			orig_msg->fwd_send_flags=fwd_snd_flags_bak;
90 90
 			orig_msg->rpl_send_flags=rpl_snd_flags_bak;
91 91
 			exec_post_script_cb(orig_msg, ONSEND_CB_TYPE);
92
+			if((sr_cfg_compat==SR_COMPAT_KAMAILIO)
93
+					&& (ret==0) && !(ra_ctx.run_flags&DROP_R_F)){
94
+				ret = 1;
95
+			}
92 96
 		} else {
93 97
 			ret=0; /* drop the message */
94 98
 		}