| 286 | }; |
| 287 | |
| 288 | void route_timer_f(unsigned int ticks, void* param) |
| 289 | { |
| 290 | struct timer_route_param *tr=(struct timer_route_param *)param; |
| 291 | struct script_route sr; |
| 292 | struct sip_msg *req; |
| 293 | int old_route_type; |
| 294 | |
| 295 | if (tr->version!=sroutes->version) { |
| 296 | LM_WARN("timer route triggering received for an old cfg version " |
| 297 | "%d<>%d\n",tr->version, sroutes->version); |
| 298 | return; |
| 299 | } |
| 300 | |
| 301 | sr.name = sroutes->timer[tr->idx].name; |
| 302 | sr.a = sroutes->timer[tr->idx].a; |
| 303 | |
| 304 | if(sr.a == NULL) { |
| 305 | LM_ERR("NULL actions for timer_route '%s'/%d\n", sr.name, tr->idx); |
| 306 | return; |
| 307 | } |
| 308 | |
| 309 | req = get_dummy_sip_msg(); |
| 310 | if(req == NULL) { |
| 311 | LM_ERR("No more memory\n"); |
| 312 | return; |
| 313 | } |
| 314 | |
| 315 | swap_route_type(old_route_type, TIMER_ROUTE); |
| 316 | run_top_route(sr, req); |
| 317 | set_route_type(old_route_type); |
| 318 | |
| 319 | /* clean whatever extra structures were added by script functions */ |
| 320 | release_dummy_sip_msg(req); |
| 321 | |
| 322 | /* remove all added AVP - here we use all the time the default AVP list */ |
| 323 | reset_avps( ); |
| 324 | } |
| 325 | |
| 326 | |
| 327 | /* the function will check the timer routes from the current process, |
nothing calls this directly
no test coverage detected