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
This commit is contained in:
Philipp Maier 2018-07-10 09:32:27 +02:00
parent 628a05e738
commit 48338570e1
3 changed files with 36 additions and 0 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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);