summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-21 18:46:06 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-21 22:48:18 +0100
commite97eab4da4e34973844ca6ffafd03919becdf15d (patch)
tree9952cfa5d4aebe935290c5131292f716182b94c9
parent3618d9d74895a2865e40f74f516e2d8619efebf9 (diff)
bsc: Allow multiple subsequent calls of f_MscConnHdlr_init()
If the function was called once, don't start another VTY/telnet component. Change-Id: I47bdeb0417a6814ed3a3f5c0c5797bd1bc7a59ba
-rw-r--r--bsc/MSC_ConnectionHandler.ttcn11
1 files changed, 8 insertions, 3 deletions
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 32f834d..6bf3221 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -297,14 +297,19 @@ type component MSC_ConnHdlr extends BSSAP_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr
var MediaState g_media;
var TestHdlrParams g_pars;
+
+ var boolean g_vty_initialized := false;
}
/* initialize all parameters */
function f_MscConnHdlr_init(integer i, HostName bts, HostName mgw) runs on MSC_ConnHdlr {
f_MediaState_init(g_media, i, bts, mgw);
- map(self:BSCVTY, system:BSCVTY);
- f_vty_set_prompts(BSCVTY);
- f_vty_transceive(BSCVTY, "enable");
+ if (not g_vty_initialized) {
+ map(self:BSCVTY, system:BSCVTY);
+ f_vty_set_prompts(BSCVTY);
+ f_vty_transceive(BSCVTY, "enable");
+ g_vty_initialized := true;
+ }
}
/* Callback function from general BSSMAP_Emulation whenever a connectionless