aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-msc/msc_main.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-02 02:37:39 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-16 15:32:33 +0100
commite48c9d13ae37545fecbd9ddde5f326c12ebb9f93 (patch)
tree9154286a8a3f558386a6792dc11790ed94022507 /openbsc/src/osmo-msc/msc_main.c
parent443a180a81ec7c592a5f754a7aec78db497f940f (diff)
Make the code work so that the msc_vlr tests pass
Diffstat (limited to 'openbsc/src/osmo-msc/msc_main.c')
-rw-r--r--openbsc/src/osmo-msc/msc_main.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/openbsc/src/osmo-msc/msc_main.c b/openbsc/src/osmo-msc/msc_main.c
index 9d3efd702..f4b3b363b 100644
--- a/openbsc/src/osmo-msc/msc_main.c
+++ b/openbsc/src/osmo-msc/msc_main.c
@@ -260,10 +260,6 @@ void msc_network_shutdown(struct gsm_network *net)
static struct gsm_network *msc_network = NULL;
-/* TODO this is here to satisfy linking during intermediate development. Once
- * libbsc is not linked to osmo-msc, this should go away. */
-struct gsm_network *bsc_gsmnet = NULL;
-
extern void *tall_vty_ctx;
static void signal_handler(int signal)
{
@@ -305,12 +301,6 @@ static void db_sync_timer_cb(void *data)
osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
}
-static void subscr_expire_cb(void *data)
-{
- /* TODO expire vlr_subscrs? */
- osmo_timer_schedule(&bsc_gsmnet->subscr_expire_timer, EXPIRE_INTERVAL);
-}
-
extern int bsc_vty_go_parent(struct vty *vty);
static struct vty_app_info msc_vty_info = {
@@ -370,6 +360,11 @@ int main(int argc, char **argv)
if (!msc_network)
return -ENOMEM;
+ if (msc_vlr_alloc(msc_network)) {
+ fprintf(stderr, "Failed to allocate VLR\n");
+ exit(1);
+ }
+
ctrl_vty_init(tall_msc_ctx);
logging_vty_add_cmds(&log_info);
msc_vty_init(msc_network);
@@ -426,7 +421,7 @@ int main(int argc, char **argv)
* A third-party MSC may well be able to handle a TCH/H TCH/F
* mismatch.
*/
- bsc_gsmnet->dyn_ts_allow_tch_f = false;
+ msc_network->dyn_ts_allow_tch_f = false;
/* start control interface after reading config for
* ctrl_vty_get_bind_addr() */
@@ -448,7 +443,7 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
#endif
#if 0
- if (msc_ctrl_cmds_install(bsc_gsmnet) != 0) {
+ if (msc_ctrl_cmds_install(msc_network) != 0) {
printf("Failed to initialize the MSC control commands.\n");
return -1;
}
@@ -466,19 +461,13 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
}
osmo_fsm_log_addr(true);
- if (msc_vlr_start(bsc_gsmnet)) {
+ if (msc_vlr_start(msc_network)) {
fprintf(stderr, "Failed to start VLR\n");
exit(1);
}
msc_subscr_conn_init();
- 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 5;
@@ -489,10 +478,6 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
if (msc_cmdline_config.use_db_counter)
osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
- msc_network->subscr_expire_timer.cb = subscr_expire_cb;
- msc_network->subscr_expire_timer.data = NULL;
- osmo_timer_schedule(&msc_network->subscr_expire_timer, EXPIRE_INTERVAL);
-
signal(SIGINT, &signal_handler);
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);