[sr-dev] git:hpw/branch_failure_route: modules/tm: Initial revision of branch_failure_route

Hugh Waite hugh.waite at crocodile-rcs.com
Wed Mar 20 15:22:57 CET 2013


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?

Regards,
Hugh


On 19/03/2013 22:14, Daniel-Constantin Mierla wrote:
> Hello,
>
> wouldn't be possible to reuse the event_route concept for this case? I 
> would try to avoid keep adding new routing block in the core.
>
> Maybe something as:
> ...
> t_on_branch_failure("xyz");
> ..
> event_route[tm:branch-failure:xyz] {
> ...
> }
>
> In this way the flex/bison part from core does not need to be changed 
> at all.
>
> Cheers,
> Daniel
>
> On 3/19/13 4:45 PM, Hugh Waite wrote:
>> Module: sip-router
>> Branch: hpw/branch_failure_route
>> Commit: 4e0cf550f75835b3f97bda9bb7934389a54b1f18
>> URL: 
>> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4e0cf550f75835b3f97bda9bb7934389a54b1f18
>>
>> Author: Hugh Waite <hugh.waite at crocodile-rcs.com>
>> Committer: Hugh Waite <hugh.waite at crocodile-rcs.com>
>> Date:   Tue Mar 19 15:41:55 2013 +0000
>>
>> modules/tm: Initial revision of branch_failure_route
>>
>> - New branch_failure_route defined
>> - cfg route is called but xlog() causes segfault
>>
>> ---
>>
>>   modules/tm/h_table.h  |    4 ++
>>   modules/tm/t_fwd.c    |    1 +
>>   modules/tm/t_hooks.h  |    6 +++-
>>   modules/tm/t_lookup.c |    1 +
>>   modules/tm/t_reply.c  |   97 
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>   modules/tm/t_reply.h  |    7 ++++
>>   modules/tm/tm.c       |   27 ++++++++++++++
>>   modules/tm/tm_load.c  |    1 +
>>   modules/tm/tm_load.h  |    2 +
>>   9 files changed, 145 insertions(+), 1 deletions(-)
>>
>> Diff: 
>> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=4e0cf550f75835b3f97bda9bb7934389a54b1f18
>>
>> _______________________________________________
>> sr-dev mailing list
>> sr-dev at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
>


-- 
Hugh Waite
Principal Design Engineer
Crocodile RCS Ltd.




More information about the sr-dev mailing list