Skip to content

Commit

Permalink
core: properly handle drop() action for kemi engines
Browse files Browse the repository at this point in the history
- GH #3718
  • Loading branch information
xkaraman authored and miconda committed Feb 2, 2024
1 parent a226823 commit 82593a0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/onsend.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,18 @@ int run_onsend(sip_msg_t *orig_msg, dest_info_t *dst, char *buf, int len)
orig_msg->fwd_send_flags = fwd_snd_flags_bak;
orig_msg->rpl_send_flags = rpl_snd_flags_bak;
exec_post_script_cb(orig_msg, ONSEND_CB_TYPE);
if((ret == 0) && !(ra_ctx.run_flags & DROP_R_F)) {
/* - handle drop action with flag DROP_R_F
* KEMI case (python,lua,jsdt)
* ret = 1 always
* Native case:
* ret = 1 success
* ret = 0 drop the message
*/
if(ra_ctx.run_flags & DROP_R_F) {
ret = 0;
} else if(ret == 0) {
/* native case where run_actions return 0
* but DROP_R_F is not set */
ret = 1;
}
} else {
Expand Down

0 comments on commit 82593a0

Please sign in to comment.