[OpenSER-Users] is_uri_host_local() returns 1 or 4294967295 (always TRUE !!!)
Daniel-Constantin Mierla
daniel at voice-system.ro
Wed Sep 5 17:10:23 CEST 2007
Hello,
On 09/04/07 10:37, Iñaki Baz Castillo wrote:
> El Monday 03 September 2007 13:48:24 Daniel-Constantin Mierla escribió:
>
>> Hello,
>>
>> On 09/03/07 14:35, Iñaki Baz Castillo wrote:
>>
>>> El Monday 03 September 2007 12:55:34 Daniel-Constantin Mierla escribió:
>>>
>>>> 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.
>>>>
>>> In my case it doesn't work:
>>>
>>> is_uri_host_local();
>>> $var(kk)=$retcode;
>>> xlog("---- var(kk) = $var(kk)\n");
>>>
>>> And it occurs the same, $var(kk) is 1 or 4294967295, so the real problem
>>> is that "is_uri_host_local()" just return these two values. :(
>>>
>> have you tried the if() conditions? Don't look at printed value, just
>> try to use if() conditions.
>>
>
>
> I've tryed that you mean:
>
> is_uri_host_local();
> $var(kk)=$retcode;
> if($var(kk)) {
> xlog("-------------------- POSITIVE ------------------\n");
> }
> if(!$var(kk)) {
> xlog("------------------- NEGATIVE------------------\n");
> }
>
> and it ALWAYS shows "POSITIVE", so it's managing values 1 or 4294967295 :(
>
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.
Cheers,
Daniel
>
>
>
>
>
More information about the Users
mailing list