Skip to content

Commit

Permalink
acc: use the dependencies function to register dlg ctx
Browse files Browse the repository at this point in the history
This is a temporary fix, until we figure out a way of registering the
dlg ctx index only if cdr is used.
  • Loading branch information
razvancrainea committed Aug 23, 2019
1 parent c0697b9 commit 3aa5596
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions modules/acc/acc_logic.c
Expand Up @@ -1095,8 +1095,6 @@ unsigned long long do_acc_flags_parser(str* token)
LM_ERR("cannot register callback for dialog loaded - accounting "
"for ongoing calls will be lost after restart\n");

acc_dlg_ctx_idx = dlg_api.dlg_ctx_register_ptr(unref_acc_ctx);

is_cdr_enabled=1;
}

Expand Down
8 changes: 7 additions & 1 deletion modules/acc/acc_mod.c
Expand Up @@ -255,14 +255,20 @@ static dep_export_t deps = {
},
};

static int acc_deps(void)
{
acc_dlg_ctx_idx = dlg_api.dlg_ctx_register_ptr(unref_acc_ctx);
return 0;
}

struct module_exports exports= {
"acc",
MOD_TYPE_DEFAULT,/* class of this module */
MODULE_VERSION, /* module version */
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
acc_deps, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
params, /* exported params */
Expand Down

0 comments on commit 3aa5596

Please sign in to comment.