[Kamailio-Devel] append_branch() inside modules

Iñaki Baz Castillo ibc at aliax.net
Fri Nov 28 16:10:34 CET 2008


El Viernes, 28 de Noviembre de 2008, Klaus Darilion escribió:
> Iñaki Baz Castillo schrieb:
> > El Viernes, 28 de Noviembre de 2008, Klaus Darilion escribió:
> >>> Why should be bflags copied when appending a new branch manually?
> >>
> >> Example: You want to create 2 branches with different settings:
> >> 1. set RURI, set bflag, set send_socket
> >> 2. append branch()
> >> 3. set RURI, set bflag, set send_socket
> >
> > What do you mean with this example? I don't get it.
> >
> > BTW, imagine A calls B (natted) so bflag(natted)=1.
> > The call fails and failure_route creates a new branch (append_branch) to
> > a voicemail server (not natted). I would like (as the current behaviour)
> > that bflag(natted)=0 in this new branch, I don't want, at all, the value
> > being 1 jsut because B was natted.
>
> IMO then the bflag should be resetted before append_branch, or
> append_brnach should be extended to have flags to control which parts of
>   branch[0] are copied, e.g. a bitmask:
>   1 copy ruri (default)
>   2 copy duri
>   4 copy send_socket
>   8 copy bflags
>
> Thus append_branch("15") would copy all the branch parameters.

Great suggestion. But there is a problem: note that "append_branch()" already 
accepts an argument (a SIP URI, that could be null), how to handle both kind 
of arguments?



-- 
Iñaki Baz Castillo



More information about the Devel mailing list