From f547360b8923afdcb3a5874563e2095e7e62ce56 Mon Sep 17 00:00:00 2001 From: kosza <31093540+kosza@users.noreply.github.com> Date: Fri, 27 Jul 2018 14:04:33 +0200 Subject: [PATCH] Fix no cdr after restart bug The run_load_callbacks() should be call after acc module is loaded. The acc module will setup DLGCB_LOADED type callback. So run_load_callbacks() should be delayed and run only once, the child_init(PROC_MAIN) is perfect for it. --- src/modules/dialog/dialog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c index 84262ea25f4..e33401be57b 100644 --- a/src/modules/dialog/dialog.c +++ b/src/modules/dialog/dialog.c @@ -711,7 +711,6 @@ static int mod_init(void) LM_ERR("failed to initialize the DB support\n"); return -1; } - run_load_callbacks(); } destroy_dlg_callbacks( DLGCB_LOADED ); @@ -764,6 +763,10 @@ static int child_init(int rank) LM_ERR("failed to start clean timer routine as process\n"); return -1; /* error */ } + + if (dlg_db_mode!=DB_MODE_NONE) { + run_load_callbacks(); + } } if ( ((dlg_db_mode==DB_MODE_REALTIME || dlg_db_mode==DB_MODE_DELAYED) &&