[SR-Users] Warning "constant value in if(...)"

Ginhoux, Patrick patrick.ginhoux at fr.unisys.com
Thu May 11 15:27:06 CEST 2017


Hi,

 

I discovered that when kamailio (version 5.0.1) starts, if reports a waring
on a 'if' command :

 

May 11 11:26:20 vm-vse02-siprouter2 kamailio: WARNING: <core>
[core/cfg.y:3378]: warn_at(): warning in config file
//etc/kamailio/kamailio.cfg, line 978, column 6-13: constant value in
if(...)

 

The line 978 (in yellow) is part of the following routing below in my
Kamailio.cfg :

 

route[TO_MMM] {

                $var(mbxDN)=$null; # directory number containing mailbox
number     

                $var(uDigit)=$null; # application digits

                $var(i:NodePath)=$null;

                $var(TechNumber)=$null;

               $avp(nodeInx)=$null;

                # strip prefix from user in URI request user field

                $var(TechNumber) =
$(rU{re.subst,/^(\+33|\+262|\+377|\+590|\+594|\+596|0)//});

                # strip suffix from user in URI request user field - suffix
headed by anything other than digit or '+'

                $var(TechNumber) =
$(var(TechNumber){re.subst,/[^\+0-9].*//});

 

                if (VM_TARGET_TECHNICAL_NUMBER!=$null) {

                                $avp(vm_prefix) =
VM_TARGET_TECHNICAL_NUMBER;

                } else {

                                $avp(vm_prefix) =
$(var(TechNumber){s.substr,0,5});

 

 

The same code with kamailio 3.3 doesn't report this warning. Also the same
code exists in another part of the routine but don't report a warning.

 

I have no idea of the impact of such warning.

 

Also I'm looking for help to understand the problem.

 

Thanks in advance for the answers.

 

 

 

Cordialement

Patrick GINHOUX

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170511/66c09676/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7886 bytes
Desc: not available
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170511/66c09676/attachment.bin>


More information about the sr-users mailing list