[Kamailio-Devel] [ openser-Feature Requests-2045364 ] A way to reset "t_on_branch" in serial forking

SourceForge.net noreply at sourceforge.net
Sun Aug 10 23:44:29 CEST 2008


Feature Requests item #2045364, was opened at 2008-08-10 18:32
Message generated for change (Comment added) made by ibc_sf
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743023&aid=2045364&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Iaki Baz (ibc_sf)
Assigned to: Daniel-Constantin Mierla (miconda)
Summary: A way to reset "t_on_branch" in serial forking

Initial Comment:
imagine this simple case:

--------------------------
route {
        t_on_branch("1");
        t_on_failure("2");

        xlog("We are in 'route'");
        t_relay("1.1.1.1");
}

branch_route[1] {
        xlog("We are in 'branch_route[1]'");
        # do something....
}

failure_route[2] {
        xlog("We are in 'failure_route[2]'");
        append_branch();
        t_relay("2.2.2.2");
}
---------------------------


In case an error occurs when forwarding the request to 1.1.1.1 this would be the screen log output:

   We are in 'route'
   We are in 'branch_route[1]'
   We are in 'failure_route[2]'
   We are in 'branch_route[1]'

This is: branch_route[1] will also be runned **again** after the failure route since it was loaded in the first forward attemp.

I really don't know if this is intuitive or not. The only way to "dissable" branch_route[1] in the failure route is by adding:

-------------------
failure_route[2] {
        t_on_branch("2");  # <--- Dissable t_on_branch("1")

        xlog("We are in 'failure_route[2]'");
        append_branch();
        t_relay("2.2.2.2");
}

branch_route[2] {
        xlog("We are in 'branch_route[2]'");
        # Nothing to do here.
        # This route is neccesary to dissable
        # previous t_on_branch("1")
}
------------------

This would show:

   We are in 'route'
   We are in 'branch_route[1]'
   We are in 'failure_route[2]'
   We are in 'branch_route[2]'


What about if "t_on_branch" wouldn't remain loaded after a failure route or serial forking? wouldn't be more intuitive to re-enable it explicitely when required?

Or perhaps a way to reset the previosly loaded "t_on_branch"? Anyway I think is more simple and intuitive to reset it by default and if required load it again explicitely.

PD: The same occurs with "t_on_failure" and "t_on_reply".

----------------------------------------------------------------------

>Comment By: Iaki Baz (ibc_sf)
Date: 2008-08-10 23:44

Message:
Logged In: YES 
user_id=1844020
Originator: YES

Yes, t_on_branch("0") resets the "branch_route".

> Anyhow, some questions are still here:
> - shall they be rearmed by default, or reset once the callback 
> route is executed

At least under my experience, is more intuitive and logical to reset it in
each serial step.

> - is 0 parameter enough meaningful to be a clear reset? Docs updated
> properly or new functions with proper name?

Well, if it was well documented, for me is the same.

----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-08-10 18:59

Message:
Logged In: YES 
user_id=1246013
Originator: NO

Investigating the code should work with:
t_on_branch("0")

Similar with the rest of the cases. Can you test and see?

Anyhow, some questions are still here:
- shall they be rearmed by default, or reset once the callback route is
executed
- is 0 parameter enough meaningful to be a clear reset? Docs updated
properly or new functions with proper name?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743023&aid=2045364&group_id=139143



More information about the Devel mailing list