run actions from a route */ returns: 0, or 1 on success, <0 on error */ (0 if drop or break encountered, 1 if not ) */
| 114 | /* returns: 0, or 1 on success, <0 on error */ |
| 115 | /* (0 if drop or break encountered, 1 if not ) */ |
| 116 | static inline int run_actions(struct action* a, struct sip_msg* msg) |
| 117 | { |
| 118 | int ret, _, ret_lvl; |
| 119 | str top_route; |
| 120 | |
| 121 | if (route_stack_size > ROUTE_MAX_REC_LEV) { |
| 122 | get_top_route_type(&top_route, &_); |
| 123 | LM_ERR("route recursion limit reached, giving up! (nested routes: %d, " |
| 124 | "first: '%.*s', last: '%s')!\n", route_stack_size, |
| 125 | top_route.len, top_route.s, route_stack[ROUTE_MAX_REC_LEV]); |
| 126 | ret=E_UNSPEC; |
| 127 | goto error; |
| 128 | } |
| 129 | |
| 130 | if (a==0){ |
| 131 | LM_WARN("null action list (route stack size: %d)\n", |
| 132 | route_stack_size); |
| 133 | ret=1; |
| 134 | goto error; |
| 135 | } |
| 136 | |
| 137 | ret_lvl=script_return_push(); |
| 138 | |
| 139 | ret=run_action_list(a, msg); |
| 140 | |
| 141 | /* if 'return', reset the flag */ |
| 142 | if(action_flags&ACT_FL_RETURN) |
| 143 | action_flags &= ~ACT_FL_RETURN; |
| 144 | |
| 145 | script_return_pop(ret_lvl); |
| 146 | |
| 147 | return ret; |
| 148 | |
| 149 | error: |
| 150 | return ret; |
| 151 | } |
| 152 | |
| 153 | |
| 154 | int _run_actions(struct action *a, struct sip_msg *msg) |
no test coverage detected