Merge commit 'origin/ser_core_cvs'
[sip-router] / receive.c
index c5eca2a..beb4c58 100644 (file)
--- a/receive.c
+++ b/receive.c
@@ -169,6 +169,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
                if (exec_pre_req_cb(msg)==0 )
                        goto end; /* drop the request */
 
+               set_route_type(REQUEST_ROUTE);
                /* exec the routing script */
                init_run_actions_ctx(&ra_ctx);
                if (run_actions(&ra_ctx, main_rt.rlist[DEFAULT_RT], msg)<0){
@@ -210,8 +211,10 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
                */
                if (exec_pre_rpl_cb(msg)==0 )
                        goto end; /* drop the request */
+
                /* exec the onreply routing script */
                if (onreply_rt.rlist[DEFAULT_RT]){
+                       set_route_type(ONREPLY_ROUTE);
                        init_run_actions_ctx(&ra_ctx);
                        ret=run_actions(&ra_ctx, onreply_rt.rlist[DEFAULT_RT], msg);
                        if (ret<0){