bsc: TC_assignment_csd: expect BSC to handle CSD
Related: OS#4393
Change-Id: Iff19dc704af09d09d2265d8da38fc745a3936ce4
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 31b733f..ebcd576 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1837,13 +1837,37 @@
}
return dt;
}
-testcase TC_assignment_csd() runs on test_CT {
- var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
+
+private function f_tc_assignment_csd(charstring id) runs on MSC_ConnHdlr {
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
var PDU_BSSAP ass_cmd := f_gen_ass_req();
+
ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCSD);
- //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7);
- var DchanTuple dt := f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for CSD");
- f_perform_clear_test_ct(dt);
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecCSData}));
+
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := GSM0808_DATA_RATE_TRANSP_4k8;
+
+ f_establish_fully(ass_cmd, exp_compl);
+ f_perform_clear();
+}
+testcase TC_assignment_csd() runs on test_CT {
+ if (Misc_Helpers.f_osmo_repo_is("nightly")) { /* osmo-bsc > 1.10.0 */
+ var MSC_ConnHdlr vc_conn;
+ var TestHdlrParams pars := f_gen_test_hdlr_pars();
+ pars.encr := valueof(t_EncrParams('01'O, f_rnd_octstring(8)));
+
+ f_init(1, true);
+ f_sleep(1.0);
+ vc_conn := f_start_handler(refers(f_tc_assignment_csd), pars);
+ vc_conn.done;
+ } else {
+ var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCSD);
+ //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7);
+ var DchanTuple dt := f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for CSD");
+ f_perform_clear_test_ct(dt);
+ }
f_shutdown_helper();
}
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 1eebb02..02aad9f 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -112,6 +112,36 @@
GSM0808_CAUSE_DTM_HO_TIMER_EXPIRY ('1100010'B)
} with { variant "FIELDLENGTH(7)" };
+/* 3GPP TS 48.008 3.2.2.11 Channel Type
+ * Transparent: Data Rate */
+const OCT1 GSM0808_DATA_RATE_TRANSP_32k0 := ('3a'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_28k8 := ('39'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_14k4 := ('18'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_9k6 := ('10'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_4k8 := ('11'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_2k4 := ('12'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_1k2 := ('13'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_600 := ('14'O);
+const OCT1 GSM0808_DATA_RATE_TRANSP_1200_75 := ('15'O);
+
+/* 3GPP TS 48.008 3.2.2.11 Channel Type
+ * Non-Transparent: Radio Interface Data Rate (preferred) */
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_12000_6000 := ('00'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_43k5 := ('34'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_29k0 := ('31'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_14k5 := ('14'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_12k0 := ('10'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_6k0 := ('11'O);
+
+/* 3GPP TS 48.008 3.2.2.11 Channel Type
+ * Non-Transparent: Allowed Radio Interface Data Rate (all possible allowed) */
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_43k5 := ('40'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_32k0 := ('20'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_29k0 := ('10'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_14k5 := ('08'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_12k0 := ('02'O);
+const OCT1 GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_6k0 := ('01'O);
+
type enumerated BSSMAP_LcsCause {
BSSMAP_LCS_CAUSE_UNSPECIFIED ('00000000'B),
BSSMAP_LCS_CAUSE_SYSTEM_FAILURE ('00000001'B),
@@ -603,6 +633,15 @@
codecType := FR_AMR_WB,
s0_7 := '00000001'B
}
+template (value) BSSMAP_FIELD_CodecElement ts_CodecCSData modifies ts_CodecBase := {
+ codecType := CodecExtension,
+ tF := '0'B, /* Spare */
+ pT := '0'B, /* CSDoTDM */
+ pI := '1'B, /* CSDoIP */
+ fI := '0'B, /* Spare */
+ extendedCodecType := 'FD'O, /* CSData */
+ s0_7 := '00000000'B /* R2, R3, Spare */
+}
template BSSMAP_IE_SpeechCodecList ts_BSSMAP_IE_CodecList(template BSSMAP_FIELD_CodecElements elem) := {
elementIdentifier := '7D'O,
lengthIndicator := 0, /* overwritten */