Hi all,
I was trying to use Kamailio 3.1.3 with acc module, but without DB
backend (syslog only). Unfortunately kamailio segfaulted after
receiving a NATed REGISTER (flagged in my script with the first pos
"0"). If I understood correctly, the trouble lies with some
misbehaviour with the acc parameters initializations, namely, even if
I remove the modparam with db_url, and set db_flag and db_missed_flag
to -1, the mod_init() function in modules_k/acc/acc_mod.c, reset the
flags to "0", because in its opinion db_url.s was not NULL.
Unfortunately I'm not confident with the config file parsing through
yacc, so I'm not sure where the problem actually is.
So, I tried a workaround specifying a "null" db_url (as I supposed to
be the default, reading the docs; and actually the value I found in
modules_k/acc/acc_mod.c):
modparam("acc", "db_url", 0)
or
modparam("acc", "db_url", "")
or
modparam("acc", "db_url", "NULL")
but, understandably, they don't work. Is there a way to specify a null
value for a modparam in the config file?
In the meanwhile I set the db_url to a valid value, created a valid
table `acc`, and used a flag that I never use in my script, but I know
it could be done better.
For example, maybe mod_init can reset db_flag and db_missed_flag to an
invalid value (-1?) when it find NULL the db_url variable (using a
valid flag, as 0, may lead to unexpected behaviour; or I've not got
what a valid flag is? In this case, I'm sorry).
Secondarily mod_init could check for the zero-length too, supposing
that no valid db_url can be zero-length.
Finally, and more importantly, do you have any idea about the reason
for which the config parser can see a default value for db_url (for
acc), different from the one in modules_k/acc/acc_mod.c (specifically,
it takes a valid db_url used by other modules)?
Thank you,
Best regards,
Francesco Castellano