Jon,
I guess you can find the response in [1]
```
not operator in if()
if (!$fd=~“regexp”) must now be written as if (!($fd=~“regexp”)) for what
reason ever.
Notice: the operator !~ seems not to be working for some reason as well.
e.g.: ($fd !~ 'not this') must be replaced with !($fd =~ 'not this')
```
We found the same issue when starting with Kamailio 3.X
Hope this helps.
[1]:
Hi all
I was checking for an operator not matching regular expression. Acording
to the
doc we have =~ and !~ for matching and not matching.
http://www.kamailio.org/wiki/cookbooks/3.3.x/core#script_statements
I tried this one:
if(!is_domain_local("$rd") && $rd !~ "^.+\.local$")
Resulting on these errors:
root@sp1:~# /etc/init.d/kamailio-proxy restart
Not executing command for kamailio-proxy: invalid configuration file!
-e
0(1813) : <core> [cfg.y:3549]: parse error in config file
/etc/kamailio/proxy/proxy.cfg, line 1067, column 36: syntax error
0(1813) : <core> [cfg.y:3549]: parse error in config file
/etc/kamailio/proxy/proxy.cfg, line 1067, column 52: bad expression
0(1813) : <core> [cfg.y:3549]: parse error in config file
/etc/kamailio/proxy/proxy.cfg, line 1067, column 52: bad command
0(1813) : <core> [cfg.y:3549]: parse error in config file
/etc/kamailio/proxy/proxy.cfg, line 1068, column 2: bad command
0(1813) : <core> [cfg.y:3546]: parse error in config file
/etc/kamailio/proxy/proxy.cfg, line 1083, column 2-21: syntax error
0(1813) : <core> [cfg.y:3546]: parse error in config file
/etc/kamailio/proxy/proxy.cfg, line 1083, column 2-21:
ERROR: bad config file (6 errors)
while this one:
if(!(is_domain_local("$rd") || $rd =~ "^.+\.local$"))
Works perfectly fine.
Am I wrong with the usage of !~ operator?
cheers,
Jon
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users