[SR-Users] Odd behavior comparing strings

Duarte Rocha duarterocha91 at gmail.com
Thu Oct 25 14:54:49 CEST 2018


Greetings,

I found an odd behaviour in Kamailio and i would like to know if it's
intentional.

I've made this snippet for showing :


$var(teste) = $null;

if($var(teste) == "Test")
{
xerr("TEST : If returned true");
}

The "if" returns true if the $var is $null or 0.

I'm using the "cmp_str()" now in order to avoid this issue.

Best Regards,

Duarte Rocha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20181025/d1248403/attachment.html>


More information about the sr-users mailing list