[OpenSER-Users] is_uri_host_local() returns 1 or 4294967295 (always TRUE !!!)
Iñaki Baz Castillo
ibc at in.ilimit.es
Thu Sep 6 10:05:22 CEST 2007
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) = "";
}
And later do a "normal" test:
if ($var(is_uri_host_local)) ...
if (!$var(is_uri_host_local)) ...
IMHO is clearer in this way, just my opinion.
Thanks a lot for your good explanation and regards.
--
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 Users
mailing list