Fix "CTRL GET msc_connection_status" response.

Since 39f62bbcbf the msc_connection_status
variable in osmo_bsc_ctrl.c is no longer updated. Query the connection's
status from the is_connected flag in struct bsc_msc_connection instead.

Makes test BSC_Tests.TC_ctrl_msc_connection_status in ttcn3-bsc-test pass.

However, we only query the connection status of the first MSC. Adapting
the control command to work with mulitple MSCs is left for future work.

Change-Id: I8ab8aac83ef6b7831b6136f7e9e3eddfbb43ecaa
Related: OS#2729
This commit is contained in:
Stefan Sperling 2018-01-03 14:05:24 +01:00 committed by Harald Welte
parent ed23c1d83d
commit 607f8c41bc
1 changed files with 4 additions and 1 deletions

View File

@ -62,7 +62,10 @@ static int msc_connection_status = 0;
static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data)
{
if (msc_connection_status)
struct gsm_network *gsmnet = data;
struct bsc_msc_data *msc = osmo_msc_data_find(gsmnet, 0);
if (msc->msc_con->is_connected)
cmd->reply = "connected";
else
cmd->reply = "disconnected";