Hello,
On 09/03/07 13:36, Iñaki Baz Castillo wrote:
Hi, in order to minimize the SQL queries for
functions
"is_uri_host_local()" and "is_from_local()" I want to exec they just
one
time and store the result in a variable, but the result is unexpected:
$var(is_uri_host_local) = is_uri_host_local();
xlog("------------is_uri_host_local = $var(is_uri_host_local)\n");
a better way to do it is:
is_uri_host_local();
$var(is_uri_host_local) = $retcode;
Some times, because of OpenSER return code schema, negative values are
converted to -1, positive to 1 (0 is used to signal an exit from config
script interpretation). In this case might work, but not in all. The
4294967295 is actually the unsigned int of -1 (or similar). The printing
function should be changed to use signed int to have it clear and
correct here.
However, with the above code I gave, you can do:
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.
Thanks for the explanation. ;)
--
Iñaki Baz Castillo
ibc(a)in.ilimit.es