osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32343 )


Change subject: bsc: improve TC_assignment_csd
......................................................................

bsc: improve TC_assignment_csd

Verify that CSD ipaccess CRCX/MDCX has the CSD RTP payload type, and
that the RSL_IE_IPAC_RTP_CSD_FMT IE is set with
RSL_IPA_RTP_CSD_TRAU_BTS.

Related: OS#4393
Change-Id: Id0e0c5631d7a36635e1ef49cf5bf554f0336556b
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M library/MGCP_Types.ttcn
M library/RSL_Types.ttcn
4 files changed, 67 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/43/32343/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index f40b19e..aa627b7 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1852,6 +1852,7 @@
 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();
+       var SDP_FIELD_PayloadType pt_csd := PT_CSD;

        ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelTypeCSD);
        ass_cmd.pdu.bssmap.assignmentRequest.codecList := 
valueof(ts_BSSMAP_IE_CodecList({ts_CodecCSData}));
@@ -1859,6 +1860,11 @@
        ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator 
:= GSM0808_DATA_RATE_TRANSP_4k8;

        f_establish_fully(ass_cmd, exp_compl);
+
+       if (g_media.bts.rtp_pt != enum2int(pt_csd)) {
+               Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
log2str("unexpected RTP payload type: ", g_media.bts.rtp_pt));
+       }
+
        f_perform_clear();
 }
 testcase TC_assignment_csd() runs on test_CT {
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index b3e6af6..fa7cd84 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -198,6 +198,28 @@
        return -1;
 }

+/* Verify that CSD CRCX/MDCX has the RSL_IE_IPAC_RTP_CSD_FMT IE, and that
+ * inside it the D value is set to RSL_IPA_RTP_CSD_TRAU_BTS. */
+private function f_ipacc_crcx_mdcx_check_rtp_pt_csd(RSL_Message rsl) runs on 
MSC_ConnHdlr {
+       var SDP_FIELD_PayloadType pt_csd := PT_CSD;
+       var RSL_IE_Body ie;
+
+       if (g_media.bts.rtp_pt != enum2int(pt_csd)) {
+               return;
+       }
+
+       if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_CSD_FMT, ie)) {
+               if (ie.ipa_rtp_csd_fmt.d != RSL_IPA_RTP_CSD_TRAU_BTS) {
+                       Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+                                               "Rx unexpected IPAC CRCX for 
CSD with RTP_CSD_FMT IE");
+               }
+               return;
+       }
+
+       Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+                               "Rx unexpected IPAC CRCX for CSD without 
RTP_CSD_FMT IE");
+}
+
 /* altstep for handling of IPACC media related commands. Activated by 
as_Media() to test
  * RSL level media handling */
 altstep as_Media_ipacc(RSL_DCHAN_PT rsl_pt := RSL, RSL_DCHAN_PT 
rsl_pt_ho_target := RSL1) runs on MSC_ConnHdlr {
@@ -224,6 +246,7 @@
                        g_media.bts.local_osmux_cid := omit;
                        g_media.bts.remote_osmux_cid := omit;
                }
+               f_ipacc_crcx_mdcx_check_rtp_pt_csd(rsl);
                rsl_pt.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, g_media.bts.conn_id,
                                                
f_inet_addr(g_media.bts.bts.host),
                                                g_media.bts.bts.port_nr,
@@ -262,6 +285,7 @@
                        g_media.bts.local_osmux_cid := omit;
                        g_media.bts.remote_osmux_cid := omit;
                }
+               f_ipacc_crcx_mdcx_check_rtp_pt_csd(rsl);
                rsl_pt.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, g_media.bts.conn_id,
                                                
f_inet_addr(g_media.bts.peer.host),
                                                g_media.bts.peer.port_nr,
diff --git a/library/MGCP_Types.ttcn b/library/MGCP_Types.ttcn
index 01d4d3a..da1b7f6 100644
--- a/library/MGCP_Types.ttcn
+++ b/library/MGCP_Types.ttcn
@@ -128,7 +128,8 @@
                PT_GSMEFR(110),
                PT_GSMHR(111),
                PT_AMR(112),
-               PT_AMRWB(113)
+               PT_AMRWB(113),
+               PT_CSD(120)
        }

 } with { encode "TEXT" }
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index fff87f2..0f03c87 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -945,6 +945,25 @@
                RSL_IPA_Codec           codec
        }

+       type enumerated RSL_IPA_RTP_CSD_FMT_D {
+               RSL_IPA_RTP_CSD_EXT_TRAU        ('0000'B),
+               RSL_IPA_RTP_CSD_NON_TRAU        ('0001'B),
+               RSL_IPA_RTP_CSD_TRAU_BTS        ('0010'B),
+               RSL_IPA_RTP_CSD_IWF_FREE        ('0011'B)
+       } with { variant "FIELDLENGTH(4)" }
+
+       type enumerated RSL_IPA_RTP_CSD_FMT_IR {
+               RSL_IPA_RTP_CSD_8k      ('0000'B),
+               RSL_IPA_RTP_CSD_16k     ('0001'B),
+               RSL_IPA_RTP_CSD_32k     ('0010'B),
+               RSL_IPA_RTP_CSD_64      ('0011'B)
+       } with { variant "FIELDLENGTH(4)" }
+
+       type record RSL_IE_IPA_RTP_CSD_FMT {
+               RSL_IPA_RTP_CSD_FMT_IR  ir,
+               RSL_IPA_RTP_CSD_FMT_D   d
+       }
+
        /* 9.3.20 */
        type enumerated RSL_IE_ReleaseMode {
                RSL_REL_MODE_NORMAL     ('00'B),
@@ -1076,6 +1095,7 @@
                uint8_t                 ipa_rtp_pt2,
                RSL_IE_IPA_ConnectionStats ipa_stats,
                RSL_IE_IPA_SpeechMode   ipa_speech_mode,
+               RSL_IE_IPA_RTP_CSD_FMT  ipa_rtp_csd_fmt,

                RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
                RSL_IE_OSMO_RepAcchCap  rep_acch_cap,
@@ -1142,6 +1162,7 @@
                                        ipa_rtp_pt2, iei = 
RSL_IE_IPAC_RTP_PAYLOAD2;
                                        ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
                                        ipa_speech_mode, iei = 
RSL_IE_IPAC_SPEECH_MODE;
+                                       ipa_rtp_csd_fmt, iei = 
RSL_IE_IPAC_RTP_CSD_FMT;

                                        osmo_training_sequence, iei = 
RSL_IE_OSMO_TRAINING_SEQUENCE;
                                        rep_acch_cap, iei = 
RSL_IE_OSMO_REP_ACCH_CAP;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32343
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id0e0c5631d7a36635e1ef49cf5bf554f0336556b
Gerrit-Change-Number: 32343
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-MessageType: newchange

Reply via email to