[OpenSER-Devel] discussion: issues with local_route
Daniel-Constantin Mierla
miconda at gmail.com
Thu Jun 12 11:02:30 CEST 2008
On 06/12/08 11:32, Iñaki Baz Castillo wrote:
> 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).
>
Right, you may get true or false, and IMO this is correct, because
isbflagset() works on the first branch, not on all branches. The results
is what I would expect, the status of the flags for first branch.
> 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.
>
Complexity is another aspect, the one that worries me is the unexpected
side effects. local_route is good to have, no doubt, but should be
properly designed and integrated before a major release.
Cheers,
Daniel
> Thanks a lot :)
>
>
>
--
http://www.asipto.com
More information about the Devel
mailing list