Hello,

On 3/20/13 3:22 PM, Hugh Waite wrote:
Hi,
To run in an event_route, functions need to have the EVENT_ROUTE/REQUEST_ROUTE flag set. So far the ones I want to use already have that, and I can always add that flag if required. I know functions can check the route type with 'get_route_type()', but for an event_route this is the same as REQUEST_ROUTE.
For example, I will want to run something like:

branch_failure_route[OUTBOUND_FAIL] {
    if (t_check_status("430") {
        disable_contact();
        t_next_contact_flow();
        t_relay();
    }
}
I think t_check_status() will return the wrong thing here because of the route type. Can I work round that in an event_route and are there any similar implications?

a new internal ID for a route type can be defined if needed, otherwise you can set the type to a different one than REQUEST_ROUTE if it is more suitable. This type is set in code before execution of the routing block, for example in htable:

        set_route_type(REQUEST_ROUTE);
        init_run_actions_ctx(&ctx);
        run_top_route(event_rt.rlist[rt], fmsg, &ctx);

But I would not want to have more routing block names in the config -- at the start of v3.0 (ser-kamailio integration) we even removed some old ones (local_route being replaced by event_route[tm:local-request]).

Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
 - http://conference.kamailio.com -


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to