vty: Fix and deprecate typo in cmd 'amr-payload bandwith-efficient'

Related: OS#6161
Change-Id: Iefbadea374974587a421ec981e246b87c7b5de59
This commit is contained in:
Pau Espin 2022-10-26 12:09:01 +02:00
parent da4af65a51
commit 69db1e9498
2 changed files with 16 additions and 4 deletions

View File

@ -2524,7 +2524,7 @@ static void write_msc_amr_options(struct vty *vty, struct bsc_msc_data *msc)
if (msc->amr_octet_aligned)
vty_out(vty, " amr-payload octet-aligned%s", VTY_NEWLINE);
else
vty_out(vty, " amr-payload bandwith-efficient%s", VTY_NEWLINE);
vty_out(vty, " amr-payload bandwidth-efficient%s", VTY_NEWLINE);
}
static void msc_write_nri(struct vty *vty, struct bsc_msc_data *msc, bool verbose);
@ -3212,7 +3212,7 @@ ALIAS_DEPRECATED(cfg_net_msc_dest, cfg_net_msc_no_dest_cmd,
DEFUN_USRATTR(cfg_net_msc_amr_octet_align,
cfg_net_msc_amr_octet_align_cmd,
X(BSC_VTY_ATTR_NEW_LCHAN),
"amr-payload (octet-aligned|bandwith-efficient",
"amr-payload (octet-aligned|bandwidth-efficient)",
"Set AMR payload framing mode\n"
"payload fields aligned on octet boundaries\n"
"payload fields packed (AoIP)\n")
@ -3221,11 +3221,22 @@ DEFUN_USRATTR(cfg_net_msc_amr_octet_align,
if (strcmp(argv[0], "octet-aligned") == 0)
data->amr_octet_aligned = true;
else if (strcmp(argv[0], "bandwith-efficient") == 0)
else if (strcmp(argv[0], "bandwidth-efficient") == 0)
data->amr_octet_aligned = false;
else {
data->amr_octet_aligned = false;
vty_out(vty, "%% Command 'amr-payload': Option 'bandwith-efficient' "
"containing typo is deprecated, use 'bandwidth-efficient' instead!%s",
VTY_NEWLINE);
}
return CMD_SUCCESS;
}
ALIAS_DEPRECATED(cfg_net_msc_amr_octet_align,
cfg_net_msc_amr_octet_align_deprecated_cmd,
"amr-payload bandwith-efficient",
"Set AMR payload framing mode\n"
"payload fields packed (AoIP)\n");
DEFUN_ATTR(cfg_msc_nri_add, cfg_msc_nri_add_cmd,
"nri add <0-32767> [<0-32767>]",
@ -3527,6 +3538,7 @@ int bsc_vty_init(struct gsm_network *network)
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_amr_octet_align_cmd);
install_element(MSC_NODE, &cfg_net_msc_amr_octet_align_deprecated_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_cs7_bsc_addr_cmd);

View File

@ -919,7 +919,7 @@ void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *l
if (bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) {
/* FIXME: At the moment all BTSs we support are using the
* octet-aligned payload format. However, in the future
* we may support BTSs that are using bandwith-efficient
* we may support BTSs that are using bandwidth-efficient
* format. In this case we will have to add functionality
* that distinguishes by the BTS model which mode to use. */
verb_info->param.amr_octet_aligned = true;