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

Daniel-Constantin Mierla miconda at gmail.com
Sat Apr 6 21:31:07 CEST 2013


On 4/6/13 8:44 PM, Hugh Waite wrote:
> Hi,
> On 06/04/2013 11:44, Daniel-Constantin Mierla wrote:
>> 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] { ... }
>>
>> Hope now is more clear, or maybe I misunderstood what you added.
> I did not realise this was possible as I was learning from other code 
> examples. This was part of my first attempt, so I will try to add this 
> back in soon.
OK, at the end you can decide how to specify the event_route to be executed:

t_on_branch_failure("myroute");

or

t_on_branch_failure("tm:branch_failure:myroute");

The first will require to build the full event_route name inside the 
function to prefix the parameter with "tm:branch_failure:". Otherwise 
you will lookup the event_route inside the t_on_branch_failure(...) and 
store only its index in tm branch structure.

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