[NEW] Branch manipulation in failure route

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[NEW] Branch manipulation in failure route

Bogdan-Andrei Iancu
Hi,

There are some recent change in OpenSIPS about how the call branches are
handled in the failure route. These changes tries to simplify the usage
and understanding of the OpenSIPS scripting by unifying the branch logic
between request and failure routes and also between all the modules
using branches in failure route.

Former problems:

1)  in request route, the first destination is in RURI and the
additional destination are filled in as branches; but in failure route
all the destinations were filled in as branched - this discrepancy made
the failure route understanding more difficult and also the scripting
itself more complex as you need different behaviours in the 2 routes

2) modules operating with branches in failure routes implemented 2
different approaches: (a) fill in the new destination directly as branch
or (b) fill in the new destination as RURI and expect the script writer
to do an append_branch before t_relay; This was confusing as each module
had its own approach.


Current behaviour:

1) both in request and failure route, the destinations are now filled in
in RURI + branches - in it the same logic (as previously for request
route). So, there is no need for the append_branch() in failure route,
only if you have more than one branch

Ex:
Previously:
route{
    seturi("sip:[hidden email]");
    t_on_failure("1");
    t_relay();
}

failure_route[1] {
    seturi("sip:[hidden email]");
    append_branch();
    t_relay();  
}

Current format:
route{
    seturi("sip:[hidden email]");
    t_on_failure("1");
    t_relay();
}

failure_route[1] {
    seturi("sip:[hidden email]");
    t_relay();  
}

Note, there is no need for the append_branch() for using the RURI in
failure route.



2) all modules are filling the RURI and branches, as standard behaviour.
Changed modules: cpl-c, dispatcher, lcr, uac_redirect. Instead of
directly pushing the new destination to branch, the destination goes to
RURI, it is expose to script changes and then automatically used by t_relay.

Actually for lcr and dispatcher module, nothing have to be changed in
failure route logic as the two changes (in t_relay() and modules) are
complementary. The only difference here is that the new destination is
exposed via RURI in script, so you can do script manipulation on it
before relay.


Best regards,
Bogdan

PS: for any questions or doubts on these changes, please let me know ;)

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel