Skip to content

Commit

Permalink
srdb1 Check if the module is loaded, so the error message makes sense…
Browse files Browse the repository at this point in the history
… in case of missing module

If a module use a default database and it's not loaded, currently
Kamailio complains that the module doesn't implement an API function
instead of actually telling the Kamailian that the module is not loaded.
This patch modifies that behaviour.

(cherry picked from commit c1a1a1b)
(cherry picked from commit 7e788aa)
  • Loading branch information
oej authored and miconda committed Dec 17, 2015
1 parent a19a5fe commit e40375c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/srdb1/db.c
Expand Up @@ -207,6 +207,10 @@ int db_bind_mod(const str* mod, db_func_t* mydbf)
tmp = name;
}

if (!find_module_by_name(tmp)) {
LM_ERR("Module %s not found. Missing loadmodule? \n", tmp);
goto error;
}
dbind = (db_bind_api_f)find_mod_export(tmp, "db_bind_api", 0, 0);
if(dbind != NULL)
{
Expand Down

0 comments on commit e40375c

Please sign in to comment.