MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cpl_db_bind

Function cpl_db_bind

modules/cpl_c/cpl_db.c:43–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42
43int cpl_db_bind(const str* db_url, const str *db_table)
44{
45 if (db_bind_mod(db_url, &cpl_dbf )) {
46 LM_CRIT("cannot bind to database module! "
47 "Did you forget to load a database module ?\n");
48 return -1;
49 }
50
51 /* CPL module uses all database functions */
52 if (!DB_CAPABILITY(cpl_dbf, DB_CAP_ALL)) {
53 LM_CRIT("Database modules does not "
54 "provide all functions needed by cpl_c module\n");
55 return -1;
56 }
57
58 if ( cpl_db_init( db_url, db_table) )
59 return -1;
60
61 if(db_check_table_version(&cpl_dbf, db_hdl, db_table, TABLE_VERSION) < 0) {
62 LM_ERR("error during table version check.\n");
63 cpl_db_close();
64 return -1;
65 }
66
67 cpl_db_close();
68 return 0;
69}
70
71
72

Callers 1

cpl_initFunction · 0.85

Calls 4

db_bind_modFunction · 0.85
cpl_db_initFunction · 0.85
db_check_table_versionFunction · 0.85
cpl_db_closeFunction · 0.85

Tested by

no test coverage detected