Hi Daniel,
This is a sketch of how I would force the execution of the acc/cdr dialog callbacks for dialogues created from the database. This solution needs more testing and I don't expect it to be accepted as is.
I think that the run_create_callbacks was omitted because at a later step, the callbacks would need to access the initial request (params->req) that originated the dialog. Looking in the generated CDRs one can also spot that certain values are left blank most probably because of the params->req message is missing.
How would you solve this problem? Is there a way to populate/ mock the request with values inside the dialog_vars table? Would you add all variables of interest inside that table or inside the dialog table?
Thank you, Lucian You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1036
-- Commit Summary --
* Fix for no cdr after Kamailio 5.0 restart
-- File Changes --
M src/modules/acc/acc_cdr.c (8) M src/modules/dialog/dlg_db_handler.c (11)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1036.patch https://github.com/kamailio/kamailio/pull/1036.diff
Maybe DLGCB_LOADED callback can be used for this situation -- I guess it is no need populate again the variables in the dlg structure as they were already done when the dialog was effectively created.
If you create a new solution, make a commit per module and prefix the first log message with the module name:
* https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md#com...
Updated the pull request using DLGCB_LOAD which keeps changes only in acc module. This works for me in 5.0.
Part of the code was present in Diego Nadares' proposed solution too.
Merged #1036.