int run_top_route(struct action* a, struct sip_msg* msg) { static unsigned int bl_last_msg_id = 0; int bk_action_flags; int bk_rec_lev; int ret; bk_action_flags = action_flags; bk_rec_lev = rec_lev; action_flags = 0; rec_lev = 0; init_err_info(); if (bl_last_msg_id != msg->id) { bl_last_msg_id = msg->id; reset_bl_markers(); } resetsflag( (unsigned int)-1 ); run_actions(a, msg); ret = action_flags; action_flags = bk_action_flags; rec_lev = bk_rec_lev; /* reset script tracing */ use_script_trace = 0; return ret; }
/* run a list of actions */ int run_action_list(struct action* a, struct sip_msg* msg) { int ret=E_UNSPEC; struct action* t; for (t=a; t!=0; t=t->next){ ret=do_action(t, msg); /* if action returns 0, then stop processing the script */ if(ret==0) action_flags |= ACT_FL_EXIT; if(error_rlist.a!=NULL && (route_type&(ERROR_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE))==0 && _oser_err_info.eclass!=0) { LM_DBG("jumping to error route\n"); set_route_type( ERROR_ROUTE ); run_actions(error_rlist.a, msg); /* if don't exit, then reset error info */ if(!(action_flags&ACT_FL_EXIT)) init_err_info(); } if((action_flags&ACT_FL_RETURN) || (action_flags&ACT_FL_EXIT)) break; } return ret; }
/* run the error route with correct handling - simpler wrapper to allow the usage from other parts of the code */ void run_error_route(struct sip_msg* msg, int force_reset) { int old_route; LM_DBG("triggering\n"); swap_route_type(old_route, ERROR_ROUTE); run_actions(error_rlist.a, msg); /* reset error info */ init_err_info(); set_route_type(old_route); }
int run_top_route(struct action* a, struct sip_msg* msg) { int bk_action_flags; int bk_rec_lev; int ret; bk_action_flags = action_flags; bk_rec_lev = rec_lev; action_flags = 0; rec_lev = 0; init_err_info(); reset_bl_markers(); resetsflag( (unsigned int)-1 ); run_actions(a, msg); ret = action_flags; action_flags = bk_action_flags; rec_lev = bk_rec_lev; return ret; }