Beispiel #1
0
static void destroy(void)
{
	/* Cleanup forward */
	conf_destroy();
	destroy_shmlock();
	/* Close pres db */
	pres_db_close();
}
Beispiel #2
0
static int pres_db_init(void) {
    if (!pres_db_url.s || !pres_db_url.len) {
	LM_INFO("xcap_auth_status function is disabled\n");
	return 0;
    }
    if (db_bind_mod(&pres_db_url, &pres_dbf) < 0) {
	LM_ERR("can't bind database module\n");
	return -1;
    }
    if ((pres_dbh = pres_dbf.init(&pres_db_url)) == NULL) {
	LM_ERR("can't connect to database\n");
	return -1;
    }
    if (db_check_table_version(&pres_dbf, pres_dbh, &xcap_table,
			       XCAP_TABLE_VERSION) < 0) {
	LM_ERR("during table version check\n");
	pres_db_close();
	return -1;
    }
    pres_db_close();
    return 0;
}