[OpenSER-Users] is_uri_host_local() returns 1 or 4294967295 (always TRUE !!!)

Iñaki Baz Castillo ibc at in.ilimit.es
Fri Sep 7 10:23:29 CEST 2007


El Thursday 06 September 2007 19:36:20 Daniel-Constantin Mierla escribió:
> On 09/06/07 11:05, Iñaki Baz Castillo wrote:
> > El Wednesday 05 September 2007 17:10:23 Daniel-Constantin Mierla escribió:
> >> your conditions are wrong. I said:
> >> if ($var(is_uri_host_local)<0) to check if was a false response or:
> >> if ($var(is_uri_host_local)>0) to check if was a true response.
> >>
> >> To clarify a bit:
> >> - when a function or route returns, the code is interpreted as: negative
> >> value is false; 0 is exit interpreting configuration file; positive is
> >> true - when an integer value is tested, the test is as in C: 0 is false,
> >> otherwise is true
> >>
> >> In your case, you test an integer.
> >
> > Ok, understood. And it works at you say (doing the test > or <).
> >
> > Anyway I don't like that test so I prefer to do at the start:
> >
> >   $var(is_uri_host_local)=is_uri_host_local();
> >   if ($var(is_uri_host_local) != 1) {
> >        $var(is_uri_host_local) = "";
> >   }
>
> maybe not in this case, but yu should test for >0 to set it true or
> false. 1 is not the only return code representing true, any number which
> is positive.

Yes, ok, thanks for the advice.

Anyway I did some test and **this** function just returns "1" when true.

Thanks a lot for all you help.




-- 
ilimit...


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

ÀREA SISTEMES
0034 937 333 375
VOLTA 1, PIS 5
08224 TERRASSA.BCN

Aquest enviament és confidencial i està destinat únicament a la persona a qui 
s'ha enviat.
Pot contenir informació privada sotmesa al secret professional, la distribució 
de la qual està prohibida per la legislació vigent.




More information about the sr-users mailing list