[SR-Users] Important problem with this test : if ($var(i:maxRangeInx)==$null)

Ginhoux, Patrick patrick.ginhoux at fr.unisys.com
Mon Mar 27 15:22:41 CEST 2017


Hi,

I'm continue my job to 'migrate' my 3.3.1 kamailio.cfg script on a RHEL 6.2 server to the 5.0.x kamailio version on a RHEL 7.1 server, and I encounter a major problem with the '== $null' test in the script.

My original script (3.3.1) contains this sequence :

        $var(i:rangeInx)=0;
        $var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
        xlog(" imbxRangeInx value before test : '$var(i:maxRangeInx)' ");
        if ($var(i:maxRangeInx)==$null) {
                $var(i:maxRangeInx)=99;
        }
        xlog(" imbxRangeInx after test : '$var(i:maxRangeInx)' ");

==> The results are :
imbxRangeInx value before test : '0'
imbxRangeInx value after test : '99'

I run the same script on my new server and I get '0' before and after the test.

I attempted another kind of test to try to figure out where the problem is. So I write the simple test (with kamailio 5.0.x) :

        $var(i:rangeInx)=0;
        $var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
        $var(toto) = $null;
        if ($var(toto) == $null)
                xlog ("toto true");
        else
                xlog ("toto false");

The result I got is always 'toto false'.

So it appears to me that the test '== $null' doens' that gives a good result with kamailio 3.3.1, doesn't return the same with kamailio 5.0.x.

That is a major issue for me and it let me confused about the possibility to move to kamailio 5.0.x.

Have people an idea / explanation, why this issue ?

Cordialement
Patrick GINHOUX

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170327/e063da28/attachment.html>


More information about the sr-users mailing list