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

Function init_reg_db

modules/uac_registrant/reg_db_handler.c:503–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503int init_reg_db(const str *db_url)
504{
505 /* Find a database module */
506 if (db_bind_mod(db_url, &reg_dbf) < 0) {
507 LM_ERR("Unable to bind to a database driver\n");
508 return -1;
509 }
510 if (connect_reg_db(db_url)!=0){
511 LM_ERR("unable to connect to the database\n");
512 return -1;
513 }
514 if(db_check_table_version(&reg_dbf, reg_db_handle,
515 &reg_table_name, REG_TABLE_VERSION) < 0) {
516 LM_ERR("error during table version check.\n");
517 return -1;
518 }
519 /* Load registrants into the primary list */
520 if(load_reg_info_from_db(REG_DB_LOAD, NULL) !=0){
521 LM_ERR("unable to load the registrant data\n");
522 return -1;
523 }
524
525 reg_dbf.close(reg_db_handle);
526 reg_db_handle = NULL;
527
528 return 0;
529}
530
531
532void destroy_reg_db(void)

Callers 1

mod_initFunction · 0.85

Calls 4

db_bind_modFunction · 0.85
connect_reg_dbFunction · 0.85
db_check_table_versionFunction · 0.85
load_reg_info_from_dbFunction · 0.85

Tested by

no test coverage detected