Skip to content

Commit

Permalink
dialog: added clusterer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
eseanucristian committed Aug 27, 2015
1 parent 1fcb875 commit 73f5fd3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions modules/dialog/dialog.c
Expand Up @@ -357,15 +357,29 @@ static module_dependency_t *get_deps_cachedb_url(param_export_t *param)
return alloc_module_dep(MOD_TYPE_CACHEDB, NULL, DEP_ABORT);
}

static module_dependency_t *get_deps_clusterer(param_export_t *param)
{
int cluster_id = *(int *)param->param_pointer;

if (cluster_id <= 0)
return NULL;

return alloc_module_dep(MOD_TYPE_DEFAULT, "clusterer", DEP_ABORT);
}

static dep_export_t deps = {
{ /* OpenSIPS module dependencies */
{ MOD_TYPE_DEFAULT, "tm", DEP_ABORT },
{ MOD_TYPE_DEFAULT, "rr", DEP_ABORT },
{ MOD_TYPE_NULL, NULL, 0 },
},
{ /* modparam dependencies */
{ "db_mode", get_deps_db_mode },
{ "cachedb_url", get_deps_cachedb_url },
{ "db_mode", get_deps_db_mode },
{ "cachedb_url", get_deps_cachedb_url },
{ "accept_replicated_dialogs", get_deps_clusterer },
{ "replicate_dialogs_to", get_deps_clusterer },
{ "accept_replicated_profiles", get_deps_clusterer },
{ "replicate_profiles_to", get_deps_clusterer },
{ NULL, NULL },
},
};
Expand Down

0 comments on commit 73f5fd3

Please sign in to comment.