Miklos Tirpak wrote: > We just had a long discussion with Jan and Michal, and the result is that: > > - if (@rr.param.lr) will return false if the parameter exists, but has > empty body. So there will be no change, perl and pyton work the same way. > This would be fine and in accord with how the AVPs work now. > - a new function will be introduced that can be used to explicitly check > the existence of a header or parameter, something like if > (exists((@rr.param.lr)) than... > > Maybe a @rr.param.lr.exits or @rr.param.present.lr; I'd find something like this more natural than a "function".
Bogdan. > Thanks, > Miklos > > On 04/14/2008 01:31 PM, Jan Janak wrote: > >> Miklos Tirpak wrote: >> >>> Hi all, >>> >>> there is an issue with error handling as well, the result of an >>> expression evaluation that causes error can be hardly determined, for >>> example: >>> >>> @rr.uri tries to parse the RR HF, and get the URI part of it, but it >>> returns an error if the RR HF is missing from the request, because the >>> parsing fails: >>> >>> if (@rr.uri) is false, which is correct. >>> >>> if ([EMAIL PROTECTED]) is also false, which is strange. The error is >>> captured, >>> and eval_expr() exists before negating the result. >>> >>> if (@rr.uri || 1) is also false, because nothing after @rr.uri is checked. >>> >>> The problem exists with AVPs as well: >>> >>> $second = 2; >>> if ($second != "foo") is false, which means 2=="foo". The reason is the >>> same as above, the string cannot be converted to integer, thus, the >>> evaluator returns error. >>> >>> None of the above expressions should result error in my opinion, they >>> could simply return true or false instead. What do you think? >>> >> Yes, I agree, I was my impression that is already worked that way, but >> probably not. >> >> Jan. >> > _______________________________________________ > Serdev mailing list > [email protected] > http://lists.iptel.org/mailman/listinfo/serdev > > -- Bogdan Pintea iptego GmbH - VoIP Security http://www.iptego.com _______________________________________________ Serdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/serdev
