diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c index 84262ea25f4..a7efe2d7e97 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 ); @@ -742,6 +741,13 @@ static int child_init(int rank) { dlg_db_mode = dlg_db_mode_param; + + if(rank==PROC_INIT) { + if (dlg_db_mode!=DB_MODE_NONE) { + run_load_callbacks(); + } + } + if(rank==PROC_MAIN) { if(dlg_timer_procs>0) { if(fork_sync_timer(PROC_TIMER, "Dialog Main Timer", 1 /*socks flag*/, diff --git a/src/modules/dialog/dlg_cb.c b/src/modules/dialog/dlg_cb.c index 6ba48513ec6..12946994ba1 100644 --- a/src/modules/dialog/dlg_cb.c +++ b/src/modules/dialog/dlg_cb.c @@ -133,7 +133,7 @@ int register_dlgcb(struct dlg_cell *dlg, int types, dialog_cb f, cb->callback_param_free = ff; if ( types==DLGCB_CREATED ) { - if (load_cbs==POINTER_CLOSED_MARKER) { + if (create_cbs==POINTER_CLOSED_MARKER) { LM_CRIT("DLGCB_CREATED type registered after shutdown!?!\n"); goto error; }