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
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]: http://www.kamailio.org/dokuwiki/doku.php/install:1.5.x-to-3.0.0
2013/4/9 Jon Bonilla manwe@aholab.ehu.es
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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
El Tue, 9 Apr 2013 18:16:52 +0200 José Luis Millán jmillan@aliax.net escribió:
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.
Thx Jose. Looks like the documentation (core cookbook) wasn't updated.
2013/4/9 Jon Bonilla manwe@aholab.ehu.es
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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users