[OpenSER-Devel] discussion: issues with local_route

Iñaki Baz Castillo ibc at in.ilimit.es
Thu Jun 12 10:32:04 CEST 2008


El Thursday 12 June 2008 10:19:04 Daniel-Constantin Mierla escribió:

> Message flags are safe as they are kept in a inner field of struct
> sip_msg. The others are in global variables, specific for  the context
> of the script/message.
>
> The branch flags are broken.
>
> route {
>    setbflag(3);
>    if(method=="INVITE")
>        m_dump();
>    if(isbflagset(3))
>    {
>          # Is it executed for the incoming INVITE?      <-- A
>    }
> }
>
>
> local_route {
>    if(isbflagset(3))
>    {
>          # Is it executed for the dummped MESSAGE?  <-- B
>    }
> }
>
> in this case, bot A and B are executed.


Well, IMHO "isbflagset()" should not be used in top route because the result 
is unexpected (if you get two contacts from location table, one with NAT flag 
and test bflag(NAT) you will get true or false depending on which contact 
appears first in the table).

Anyway I agree that this local_route induces some confusion. Obviously it 
provides cool funcionality but I hope the price to pay is not OpenSer 
scripting becoming more complex that it's already is.

Thanks a lot :)


-- 
Iñaki Baz Castillo
ibc at in.ilimit.es



More information about the Devel mailing list