> I am not sure if this is actually working, or at least some operations to be
> done in the rpc command callback. Have you tested it?
>
> Checking the DB capability and opening the DB connection inside the rpc
> command callback is not enough, because the module write from SIP workers not
> from RPC worker process. Actually, the RPC worker process might not need
> database connection at all, because it might never handle SIP traffic.
>
> Are the SIP workers also opening connections after the flag is enabled via
> RPC? The PR does not seem to have code for it.
Hi @miconda,
Yes, i have tested this changes. And seems to work fine.
The logic i introduce is similar (equal) to the one applied inside `child_init`.
Example of test (startup without connection to DB):
```sh
modparam("siptrace", "db_url", "MY_DATABSE_CONNECTION")
modparam("siptrace", "table", "sip_trace")
modparam("siptrace", "trace_flag", FLT_SIPTRACE)
modparam("siptrace", "trace_sl_acks", 0)
modparam("siptrace", "trace_to_database", 0)
modparam("siptrace", "trace_on", 0)
```
Doing a `kamcmd siptrace.database enable`, SIP Traces are now added to database.
In the inverse order, the opposite logic happens.
But, feel free to test, and also add additional things, if needed.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3877#issuecomment-2173559302
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3877/c2173559...@github.com>
_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org