Skip to content

Commit

Permalink
Check if at least one DB URL is provided in avpops
Browse files Browse the repository at this point in the history
Reported by David Sanders (@dsanders11).
Closes #644 .
  • Loading branch information
bogdan-iancu committed Sep 24, 2015
1 parent 783a18a commit 34fab0d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/avpops/avpops.c
Expand Up @@ -235,6 +235,23 @@ static int avpops_init(void)
domain_col.len = strlen(domain_col.s);

default_db_url = get_default_db_url();
if (default_db_url==NULL) {
if (db_default_url==NULL) {
LM_ERR("no DB URL provision into the module!\n");
return -1;
}
/* if nothing explicitly set as DB URL, add automatically
* the default DB URL */
if (add_db_url(STR_PARAM, db_default_url)!=0) {
LM_ERR("failed to use the default DB URL!\n");
return -1;
}
default_db_url = get_default_db_url();
if (default_db_url==NULL) {
LM_BUG("Really ?!\n");
return -1;
}
}

/* bind to the DB module */
if (avpops_db_bind()<0)
Expand Down

0 comments on commit 34fab0d

Please sign in to comment.