aboutsummaryrefslogtreecommitdiffstats
path: root/src/bs11_config.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-02-19 03:11:13 +0000
committerHarald Welte <laforge@gnumonks.org>2009-02-19 03:11:13 +0000
commitf80b7d347c0449034f48152f25ae972aaaae8a9e (patch)
treeb8f2103e50076a4be493118041832e7cbefbd3d7 /src/bs11_config.c
parentfb81ae9da2a35b1359a4c810733bac11519e09e1 (diff)
bs11_config: makes sure we disconnect properly before exiting
Diffstat (limited to 'src/bs11_config.c')
-rw-r--r--src/bs11_config.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bs11_config.c b/src/bs11_config.c
index bb1539173..1e980c94f 100644
--- a/src/bs11_config.c
+++ b/src/bs11_config.c
@@ -421,7 +421,7 @@ static int handle_state_resp(enum abis_bs11_phase state)
case BS11_STATE_MAINTENANCE:
if (command) {
if (!strcmp(command, "disconnect"))
- exit(0);
+ abis_nm_bs11_factory_logon(g_bts, 0);
else if (!strcmp(command, "reconnect"))
rc = abis_nm_bs11_bsc_disconnect(g_bts, 1);
else if (!strcmp(command, "software")
@@ -438,9 +438,13 @@ static int handle_state_resp(enum abis_bs11_phase state)
} else if (!strcmp(command, "delete-trx1")) {
abis_nm_bs11_delete_object(g_bts, BS11_OBJ_BBSIG, 1);
abis_nm_bs11_delete_object(g_bts, BS11_OBJ_PA, 1);
+ sleep(5);
+ abis_nm_bs11_factory_logon(g_bts, 0);
command = NULL;
} else if (!strcmp(command, "create-trx1")) {
create_trx1(g_bts);
+ sleep(5);
+ abis_nm_bs11_factory_logon(g_bts, 0);
command = NULL;
} else if (!strcmp(command, "restart")) {
abis_nm_bs11_restart(g_bts);
@@ -451,7 +455,7 @@ static int handle_state_resp(enum abis_bs11_phase state)
case BS11_STATE_NORMAL:
if (command) {
if (!strcmp(command, "reconnect"))
- exit(0);
+ abis_nm_bs11_factory_logon(g_bts, 0);
else if (!strcmp(command, "disconnect"))
abis_nm_bs11_bsc_disconnect(g_bts, 0);
else if (!strcmp(command, "query")) {
@@ -460,6 +464,8 @@ static int handle_state_resp(enum abis_bs11_phase state)
abis_nm_bs11_get_oml_tei_ts(g_bts);
abis_nm_bs11_get_trx_power(&g_bts->trx[0]);
abis_nm_bs11_get_trx_power(&g_bts->trx[1]);
+ sleep(5);
+ abis_nm_bs11_factory_logon(g_bts, 0);
command = NULL;
}
} else if (param_disconnect) {