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

Function sqlops_init

modules/sqlops/sqlops.c:299–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297
298
299static int sqlops_init(void)
300{
301 LM_DBG("initializing...\n");
302
303 db_table.len = strlen(db_table.s);
304 uuid_col.len = strlen(uuid_col.s);
305 attribute_col.len = strlen(attribute_col.s);
306 value_col.len = strlen(value_col.s);
307 type_col.len = strlen(type_col.s);
308 username_col.len = strlen(username_col.s);
309 domain_col.len = strlen(domain_col.s);
310
311 default_db_url = get_default_db_url();
312 if (default_db_url==NULL) {
313 if (db_default_url==NULL) {
314 LM_ERR("no DB URL provision into the module!\n");
315 return -1;
316 }
317 /* if nothing explicitly set as DB URL, add automatically
318 * the default DB URL */
319 if (add_db_url(STR_PARAM, db_default_url)!=0) {
320 LM_ERR("failed to use the default DB URL!\n");
321 return -1;
322 }
323 default_db_url = get_default_db_url();
324 if (default_db_url==NULL) {
325 LM_BUG("Really ?!\n");
326 return -1;
327 }
328 }
329
330 /* bind to the DB module */
331 if (sqlops_db_bind()<0)
332 goto error;
333
334 init_store_avps(db_columns);
335
336 return 0;
337error:
338 return -1;
339}
340
341
342static int sqlops_child_init(int rank)

Callers

nothing calls this directly

Calls 4

get_default_db_urlFunction · 0.85
add_db_urlFunction · 0.85
sqlops_db_bindFunction · 0.85
init_store_avpsFunction · 0.85

Tested by

no test coverage detected