[sr-dev] git:master: modules/tm: Added branch_failure event route to tm documentation

Daniel-Constantin Mierla miconda at gmail.com
Sat Apr 6 12:44:56 CEST 2013


Hello,

On 4/5/13 5:34 PM, Hugh Waite wrote:
> Hi Olle,
>
>
> On 05/04/2013 14:53, Olle E. Johansson wrote:
>>> modules/tm: Added branch_failure event route to tm documentation
>> Thank you for adding this route!
> You're welcome!
>> Formatting issue: I don't like the event route doc to come after the 
>> module API. We usually have the API docs as the last item.
> That is easily fixed.
>> Architecture/documentation issues:
>>
>> - Is it really an event route - or does it work as the other 
>> T_ON_FAILURE?
>>
>> - Would it be better to enable a route with 
>> t_on_branch_failure(ROUTE_NAME) ?
>>
>> - What's the architectural difference between an event_route and the 
>> other routes triggered by TM?
> This branch-failure route has been implemented as an event route after 
> discussion with Daniel. (See 
> http://lists.kamailio.org/pipermail/sr-dev/2013-March/019191.html).
> As a result, you cannot specify multiple named routes and enable them 
> with a t_on_branch_failure() function. There can only be one route and 
> it is enabled when it is defined.

if I understood right, you can't specify the 
event_route[tm:branch_failure] per transaction. This is not a limitation 
of the event_route, you can do it. Just that so far it was used only 
when enabled.

You can code to do something like:

t_on_branch_failure("myroute");

which should execute following event route in case of branch failure.

event_route[tm:branch_failure:myroute] { ... }

My idea was to avoid adding other event-like routes (even branch_route 
or failure_route are like this, but we keep them since they were defined 
like this long time ago), because it is extending the config file 
language unnecessary.

But you can still develop similar mechanisms as t_on_something() even 
with event_route. Note that the naming of event routes is not 
syntactically forced to be modname:xyz, it is just a recommendation that 
will help relating easier the event route with the module executing it.

Hope now is more clear, or maybe I misunderstood what you added.

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 -




More information about the sr-dev mailing list