library/RSL_Types: RSL_SpeechAlgo: support CSD
Prepare to test CSD in BSC_Tests.ttcn. After sending a BSSAP assignment
request to the BSC with channel type data, the BSC will send a channel
activation via RSL to the BTS (which is emulated by the testsuite).
Without CSD support in the RSL template, the testsuite is unable to
decode the message, prints "Data remained at the end of the stream
after successful decoding" and the test fails.
Related: OS#4393
Change-Id: Ief2d95c7e9d71afb26fa74da755294226c8e158d
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1859eed..e1281bb 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -871,7 +871,7 @@
ch_act.ies := ch_act.ies & { valueof(t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info :=
encr_info})) };
}
- if (mode.coding_alg_rate == RSL_CMOD_SP_GSM3) {
+ if (ischosen(mode.u.speech) and mode.u.speech == RSL_CMOD_SP_GSM3) {
ch_act.ies := ch_act.ies & { valueof(t_RSL_IE(RSL_IE_MR_CONFIG,
RSL_IE_Body:{multirate_cfg := g_pars.mr_conf})) };
}
@@ -2542,18 +2542,24 @@
var uint8_t amr_start_codec := 0;
var BIT8 amr_codecs_bitmask := '00000000'B;
- select (g_pars.chan_mode.coding_alg_rate) {
- case (RSL_CMOD_NO_RESOURCE) { tch_mode := L1CTL_CHAN_MODE_SIGN; }
- case (RSL_CMOD_SP_GSM1) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V1; }
- case (RSL_CMOD_SP_GSM2) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V2; }
- case (RSL_CMOD_SP_GSM3) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V3;
- amr_codecs_bitmask := g_pars.mr_conf.codec_modes;
- }
- case else {
- log("RSL channel mode := ", g_pars.chan_mode.coding_alg_rate,
- " is not supported by the L1, falling back to signalling");
+ if (ischosen(g_pars.chan_mode.u.sign) and g_pars.chan_mode.u.sign == RSL_CMOD_NO_RESOURCE) {
tch_mode := L1CTL_CHAN_MODE_SIGN;
+ } else if (ischosen(g_pars.chan_mode.u.speech)) {
+ select (g_pars.chan_mode.u.speech) {
+ case (RSL_CMOD_SP_GSM1) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V1; }
+ case (RSL_CMOD_SP_GSM2) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V2; }
+ case (RSL_CMOD_SP_GSM3) { tch_mode := L1CTL_CHAN_MODE_SPEECH_V3;
+ amr_codecs_bitmask := g_pars.mr_conf.codec_modes;
+ }
+ case else {
+ log("RSL channel mode := ", g_pars.chan_mode.u.speech,
+ " is not supported by the L1, falling back to signalling");
+ tch_mode := L1CTL_CHAN_MODE_SIGN;
+ }
}
+ } else {
+ log("RSL channel mode is not supported by the L1, falling back to signalling");
+ tch_mode := L1CTL_CHAN_MODE_SIGN;
}
f_L1CTL_TCH_MODE(L1CTL,
diff --git a/bts/BTS_Tests_VAMOS.ttcn b/bts/BTS_Tests_VAMOS.ttcn
index 2d03411..c4bd171 100644
--- a/bts/BTS_Tests_VAMOS.ttcn
+++ b/bts/BTS_Tests_VAMOS.ttcn
@@ -174,7 +174,7 @@
for (var integer ch := 0; ch < lengthof(test[i]); ch := ch + 1) {
pars[ch] := valueof(t_Pars(test[i][ch].chan_nr,
test[i][ch].chan_mode));
- if (test[i][ch].chan_mode.coding_alg_rate == RSL_CMOD_SP_GSM3) {
+ if (ischosen(test[i][ch].chan_mode.u.speech) and test[i][ch].chan_mode.u.speech == RSL_CMOD_SP_GSM3) {
pars[ch].mr_conf := valueof(ts_RSL_MultirateCfg);
}
vc_conn[ch] := f_start_handler(handler, pars[ch], l1ctl := false);
@@ -248,10 +248,10 @@
/* If we're in signalling mode, modify to speech */
if (g_pars.chan_mode.spd_ind == RSL_SPDI_SIGN) {
g_pars.chan_mode.spd_ind := RSL_SPDI_SPEECH;
- g_pars.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM1;
+ g_pars.chan_mode.u.speech := RSL_CMOD_SP_GSM1;
} else { /* ... or vice versa */
g_pars.chan_mode.spd_ind := RSL_SPDI_SIGN;
- g_pars.chan_mode.coding_alg_rate := RSL_CMOD_NO_RESOURCE;
+ g_pars.chan_mode.u.sign := RSL_CMOD_NO_RESOURCE;
}
var RSL_Message rsl := valueof(ts_RSL_MODE_MODIFY_REQ(g_chan_nr, g_pars.chan_mode));