-
Preprocessor definitions can begin with either
#!
OR
!!
so you might want to use this as your grep regex (I didn't test this, but i think it would catch both patterns):
[#!]!ifn?def|[#!]!endif
-
You mention that you have a
definitions.cfg file which means that you're using at least one
include_file or import_file declaration, and if you're using one, then it's a good chance you're using more than one. Make sure you're considering your entire Kamailio config file. Rather
than grepping only kamailio.cfg it might be more helpful to dump the kamailio config to grep:
kamailio --cfg-print | grep [#!]!ifn?def|[#!]!endif
-
Finally it might be good to consider if you need all of those preprocessor defines and ifdefs. Yes, the default sample config has many of them, but that's a situation where a single file is meant to be able to
illustrate a lot of potential use cases. In most real-world situations, you will program the server already knowing what you will/wont need and not need all of those feature flags. Like, either my environment has RTPEngine and I'm going to use it, or it
doeesn't. I know this when I write my Kamailio scrip, so either I write the code I need or I don't. It's likely that you can clean these up, resolve your issue, and have the benefit of a cleaner more easier read config as well.