[Devel] Branch flags
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Thu Sep 1 20:12:29 CEST 2005
Hi Juha,
I failed to understand completely what you said, but it inspired me for
a solution (quite ok in my opinion).
The basic idea is to have a mask to tell which flags are global (as all
were so far) and which are per-branch. Let's say the mask (TM module
param) tells which are globals (the default value will be 0xffffffff):
- in request route, you will have in msg->flags the global flags and
the RURI-branch flags; in dset there will be the additional branch's flags.
- when entering in branch route, for each branch the visible flags
shall be the globals ones and the ones for that branch ( =
(msg->flags&MASK)| BRANCH_FLAGS ). When exiting the branch route, the
resulting flags will be saved in TM, per branch; also, the globals once,
if modified, will be updated. ( msg->flags&=MASK ). When all branch
routes ended, in TM UAS there will be the globals flags and in TM UAC
the global+branch flags
- in onreply route, you get the TM UAC flags(msg->flags=BRANCH_FLAGS
).; if the global flags are modified, the TM UAS is updated
(BRANCH_FLAGS=msg->flags; GLOBAL_FLAGS=msg->flags&MASK)
- in failure route, you will get the common flags (from TM UAS) and
the flags of the winning branch (msg->flags=GLOBAL_FLAGS| BRANCH_FLAGS).
maybe the algorithm sounds complicated, but is quite simple and easy to
use. What a user should know is that in the flags there is a range of
global flags (per transaction) and another on per branch.....
and all the issues will be solved :)
comments?
regards,
bogdan
Juha Heinanen wrote:
>Bogdan-Andrei Iancu writes:
>
> > - branch route will be run - what flags will be visible here?
> > logically should be an OR between the common flags (msg->flags) and the
> > dset branch flags (from dset)....but this is not quite OK since the
> > msg->flags will contain the the particular NAT flag for the RURI
> > branch...so msg->flags does not actually contain only the common flags,
> > but also the particular flags for the RURI branch....that's *issue
> > number one*.
>
>why OR? it may namely be possible that some flag that is set in common
>flags is reset in branch flags. if we have common flags word, branch
>flags word, and a "modified" branch flags word that has a bit on if the
>flag has been modified in the branch flags word, then when branch route
>is executed, a flag is 1, iff corresponding branch flag is 1 or
>(modified flag is 0 and common flag is 1).
>
> > - in failure route...again what flags should be visible? right now,
> > the msg->flags flags are...the common ones...but doing this makes
> > impossible to pass any flags from onreply route to failure route (and
> > this is not good)....and that's *issue number two*...
>
>why can't you make any on_reply flag set/reset visible in the common
>flags?
>
>-- juha
>
>
>
More information about the Devel
mailing list