Re: Error: different number of preprocessor directives

Sergei Safarov via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <[email protected]>
Try add one mandatory route block like

route{
        ;
}


On Wed, 2025-07-23 at 16:48 +0000, Fernando Lopes via sr-users wrote:
> Hello everyone,
> 
> I'm having an issue with my Kamailio config where I'm getting the
> following error:
> 
> ERROR: bad config file (0 errors) (parsing code: 0)
> 0(2) ERROR: <core> [core/ppcfg.c:276]: pp_ifdef_level_error():
> different number of preprocessor directives: 1 more #!if[n]def as
> #!endif
> 
> I've gone through the config up and down so many times and can't seem
> to find the problem. I have a definitions.cfg file where I define all
> the variables, and I’ve made sure that every #!ifdef WITH_SOMETHING
> has a corresponding definition.
> I also ran this command (recommended by GPT):
> 
> grep -E '#!ifn?def|#!endif' /usr/local/etc/kamailio/kamailio.cfg
> 
> It shows matching numbers of #!ifdef and #!endif, and I’ve checked it
> manually several times — everything looks fine. 
> Any tips for debuging or finding the problem.
> 
> #!ifdef WITH_CDRS
> #!endif
> #!ifdef WITH_DEBUG
> #!endif
> #!ifdef WITH_TLS
> #!endif
> #!ifdef WITH_NAT
> #!endif
> #!ifdef WITH_TLS
> #!endif
> #!ifdef WITH_FAIL2BAN
> #!ifdef WITH_ANTIFLOOD
> #!endif
> #!endif
> #!ifdef WITH_DISPATCHER
> #!endif
> #!ifdef WITH_RESPONSE_STATS
> #!endif
> #!ifdef WITH_HOMER
> #!endif
> #!ifdef WITH_CDRS
> #!endif
> #!ifdef WITH_RTPENGINE
> #!endif
> #!ifdef WITH_HTTP
> #!endif
> #!ifdef WITH_WEBSOCKETS
> #!endif
> #!ifdef WITH_NAT
> #!ifdef WITH_RTPENGINE
> #!endif
> #!endif
> #!ifdef WITH_TLS
> #!endif
> #!ifdef WITH_ANTIFLOOD
> #!endif
> #!ifdef WITH_FAIL2BAN
> #!endif
> #!ifdef WITH_DISPATCHER
> #!endif
> #!ifdef WITH_HOMER
> #!endif
> #!ifdef WITH_CDRS
> #!endif
> #!ifdef WITH_FAIL2BAN
> #!endif
> #!ifdef WITH_RTPENGINE
> #!endif
> #!ifdef WITH_HOMER
> #!endif
> #!ifdef WITH_RTPENGINE
> #!endif
> #!ifdef WITH_ANTIFLOOD
> #!endif
> #!ifdef WITH_NATSIPPING
> #!endif
> #!ifdef WITH_NOAUTH_PRIVATE_NET
> #!endif
> #!ifdef WITH_AUTH
> #!endif
> #!ifdef WITH_NAT
> #!endif
> #!ifdef WITH_NAT
> #!endif
> #!ifdef WITH_NAT
> #!endif
> #!ifdef WITH_RTPENGINE
> #!endif
> #!ifdef WITH_DISPATCHER
> #!endif
> #!ifdef WITH_WEBSOCKETS
> #!endif
> #!ifdef WITH_HTTP
> #!ifdef WITH_WEBSOCKETS
> #!endif
> #!endif
> #!ifdef WITH_RTPENGINE
> #!endif
> 
> Thank you.
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions --
> [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only
> to the sender!
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.