[bsc_hack] Initialize db as part of the network
Let us establish the rule that there is one DB per network. This will allow to assign a BTS of the network to a subscriber that is loaded from the db across restarts.
This commit is contained in:
parent
d4cb79f90d
commit
ef7f7ce452
|
@ -916,6 +916,18 @@ static int bootstrap_network(void)
|
|||
paging_init(bts);
|
||||
bts->paging.channel_allocated = bsc_hack_channel_allocated;
|
||||
|
||||
if (db_init(database_name)) {
|
||||
printf("DB: Failed to init database. Please check the option settings.\n");
|
||||
return -1;
|
||||
}
|
||||
printf("DB: Database initialized.\n");
|
||||
|
||||
if (db_prepare()) {
|
||||
printf("DB: Failed to prepare database.\n");
|
||||
return -1;
|
||||
}
|
||||
printf("DB: Database prepared.\n");
|
||||
|
||||
telnet_init(gsmnet, 4242);
|
||||
|
||||
/* E1 mISDN input setup */
|
||||
|
@ -1046,18 +1058,6 @@ int main(int argc, char **argv)
|
|||
/* parse options */
|
||||
handle_options(argc, argv);
|
||||
|
||||
if (db_init(database_name)) {
|
||||
printf("DB: Failed to init database. Please check the option settings.\n");
|
||||
return 1;
|
||||
}
|
||||
printf("DB: Database initialized.\n");
|
||||
|
||||
if (db_prepare()) {
|
||||
printf("DB: Failed to prepare database.\n");
|
||||
return 1;
|
||||
}
|
||||
printf("DB: Database prepared.\n");
|
||||
|
||||
/* seed the PRNG */
|
||||
srand(time(NULL));
|
||||
|
||||
|
|
Loading…
Reference in New Issue