aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-07-10 09:32:27 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-08-08 13:02:58 +0200
commit48338570e1035825e9a5f6f100509cc82ea6d28c (patch)
treedf23c2951980d6f785e17df9f6a474b5b3c10878
parent628a05e738b5f37e2fecd544780240e56db54036 (diff)
lcls: do not LCLS call legs with different codecs
It is theoretically possible to LCLS two legs that use different codecs. However, this requires transcoding capabilities on the local MGW. If the local MGW lacks transcoding features such a local circuit should be avoided. Enabeling LCLS under such coditions should be optional (VTY) - Add check to avoid LCLS on different codec/rate - Add VTY-Option to optionally override the check (MGW is able to transcode) Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Related: OS#1602
-rw-r--r--include/osmocom/bsc/bsc_msc_data.h1
-rw-r--r--src/osmo-bsc/osmo_bsc_lcls.c12
-rw-r--r--src/osmo-bsc/osmo_bsc_vty.c23
3 files changed, 36 insertions, 0 deletions
diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index 79d2eca48..7ec34423c 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -87,6 +87,7 @@ struct bsc_msc_data {
struct gsm_audio_support **audio_support;
int audio_length;
enum bsc_lcls_mode lcls_mode;
+ bool lcls_codec_mismatch_allow;
/* ussd welcome text */
char *ussd_welcome_txt;
diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c
index 4639c4e36..6aeccb3bb 100644
--- a/src/osmo-bsc/osmo_bsc_lcls.c
+++ b/src/osmo-bsc/osmo_bsc_lcls.c
@@ -274,6 +274,18 @@ static bool lcls_enable_possible(struct gsm_subscriber_connection *conn)
return false;
}
+ if (conn->user_plane.full_rate != conn->lcls.other->user_plane.full_rate
+ && conn->sccp.msc->lcls_codec_mismatch_allow == false) {
+ LOGPFSM(conn->lcls.fi, "Not enabling LS due to codec mismiatch (channel rate)\n");
+ return false;
+ }
+
+ if (conn->user_plane.chan_mode != conn->lcls.other->user_plane.chan_mode
+ && conn->sccp.msc->lcls_codec_mismatch_allow == false) {
+ LOGPFSM(conn->lcls.fi, "Not enabling LS due to codec mismiatch (channel mode)\n");
+ return false;
+ }
+
return true;
}
diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c
index f6f1b8a99..efa12e09b 100644
--- a/src/osmo-bsc/osmo_bsc_vty.c
+++ b/src/osmo-bsc/osmo_bsc_vty.c
@@ -184,6 +184,11 @@ static void write_msc(struct vty *vty, struct bsc_msc_data *msc)
vty_out(vty, " lcls-mode %s%s", get_value_string(bsc_lcls_mode_names, msc->lcls_mode),
VTY_NEWLINE);
+ if (msc->lcls_codec_mismatch_allow)
+ vty_out(vty, " lcls-codec-mismatch allowed%s", VTY_NEWLINE);
+ else
+ vty_out(vty, " lcls-codec-mismatch forbidden%s", VTY_NEWLINE);
+
/* write MGW configuration */
mgcp_client_config_write(vty, " ");
}
@@ -650,6 +655,23 @@ DEFUN(cfg_net_msc_lcls_mode,
return CMD_SUCCESS;
}
+DEFUN(cfg_net_msc_lcls_mismtch,
+ cfg_net_msc_lcls_mismtch_cmd,
+ "lcls-codec-mismatch (allowed|forbidden)",
+ "Allow 3GPP LCLS (Local Call, Local Switch) when call legs use different codec/rate\n"
+ "Allow LCLS only only for calls that use the same codec/rate on both legs\n"
+ "Do not Allow LCLS for calls that use a different codec/rate on both legs\n")
+{
+ struct bsc_msc_data *data = bsc_msc_data(vty);
+
+ if (strcmp(argv[0], "allowed") == 0)
+ data->lcls_codec_mismatch_allow = true;
+ else
+ data->lcls_codec_mismatch_allow = false;
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_net_bsc_mid_call_text,
cfg_net_bsc_mid_call_text_cmd,
"mid-call-text .TEXT",
@@ -938,6 +960,7 @@ int bsc_vty_init_extra(void)
install_element(MSC_NODE, &cfg_net_msc_amr_5_15_cmd);
install_element(MSC_NODE, &cfg_net_msc_amr_4_75_cmd);
install_element(MSC_NODE, &cfg_net_msc_lcls_mode_cmd);
+ install_element(MSC_NODE, &cfg_net_msc_lcls_mismtch_cmd);
install_element(MSC_NODE, &cfg_msc_acc_lst_name_cmd);
install_element(MSC_NODE, &cfg_msc_no_acc_lst_name_cmd);
install_element(MSC_NODE, &cfg_msc_cs7_bsc_addr_cmd);