Module: sip-router
Branch: kamailio_3.0
Commit: 1f2388acad2f8b2e611eade1eb532d510a48985b
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1f2388acad2f8b2e611eade1eb532d510a48985b

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date:   Thu Oct 29 11:49:38 2009 +0100

tm: drop reply in onreply_route[x]

- K compatible mode to drop reply in TM onreply routes by using 'drop'
  for reply status < 200

---

 modules/tm/t_reply.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 28e635e..d643245 100644
--- a/modules/tm/t_reply.c
+++ b/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);


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to