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.
Cheers,
Daniel
So if the URI is local then the result is 1.
But if the URI is not local then result is 4294967295. ¿?¿?¿?¿
Obviously it makes me difficult for me to do:
if ($var(is_uri_host_local))
because always is true and I need to convert the values and so.
Why "is_uri_host_local()" doesn't return -1 in case of being not local
domain?
Or maybe the issue is when I store the result in a variable? but why?
Thanks.