hi,
in top level kamailio config file (kamailio.cfg) i have this defined ``` #!ifdef TRAFFIC_FILTER-ROLE include_file "traffic-filter-role.cfg" #!endif ... ####### Routing Logic ######## route { ... #!ifdef TRAFFIC_FILTER-ROLE route(TRAFFIC_FILTER); #!endif ... } ``` and in "traffic-filter-role.cfg" i have ``` route[TRAFFIC_FILTER] { ... } ``` it seems that kamailio thinks that `TRAFFIC_FILTER-ROLE` and `TRAFFIC_FILTER` are the same. ``` 0(8619) : <core> [cfg.y:3368]: yyerror_at(): parse error in config file traffic-filter-role.cfg, line 1, column 7: syntax error 0(8619) : <core> [cfg.y:3368]: yyerror_at(): parse error in config file traffic-filter-role.cfg, line 1, column 7: invalid route statement 0(8619) : <core> [cfg.y:3365]: yyerror_at(): parse error in config file traffic-filter-role.cfg, line 1, column 8-11: ERROR: bad config file (3 errors) 0(8619) WARNING: <core> [ppcfg.c:221]: pp_ifdef_level_check(): different number of preprocessor directives: N(#!IF[N]DEF) - N(#!ENDIF) = 1 ```
if i change `TRAFFIC_FILTER-ROLE` to `TRAFFIC_FILTER_ROLE` then all is good. is '-' character reserved in the syntax and kamailio assumes the string ended there ?
kamailio should either accept '-' has part of the defines or throw error when parsing the `TRAFFIC_FILTER-ROLE` and send something like 'invalid name in trydef' to the output
The '-' is special token, being used as 'minus' in expressions for substitution. Perhaps the grammar for config file can be extended to be more strict and rise error in such case.
Closed #743.
At quick investigation, it is actually a valid define, like:
``` #!define NAME[SEPARATOR]VALUE ```
So:
``` #!define X-Y ```
is like X is defined with the value '-Y'.
Anyhow, I added some rules in the grammar to try to catch this situation, one can add space after ID to separate more visible from the value.