Change in osmo-ttcn3-hacks[master]: f_channel_needs_modify(): ask actual TCH lchan mode via VTY

neels gerrit-no-reply at lists.osmocom.org
Fri Apr 30 19:38:20 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23807 )

Change subject: f_channel_needs_modify(): ask actual TCH lchan mode via VTY
......................................................................

f_channel_needs_modify(): ask actual TCH lchan mode via VTY

I am introducing a BSC test case that runs through a assigning a TCH
channel for signalling, and then using Channel Mode Modify to change its
mode from signalling to speech. For this to work,
f_channel_needs_modify() needs to actually look up the channel mode of
the TCH and not assume that a TCH is always in speech mode.

Related: SYS#4895
Change-Id: If30e2cec65da91cb5899ee29e2afb6696437a4c9
---
M bsc/MSC_ConnectionHandler.ttcn
1 file changed, 18 insertions(+), 8 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 245528f..aa9f395 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -45,6 +45,7 @@
 
 import from TELNETasp_PortType all;
 import from Osmocom_VTY_Functions all;
+import from TCCConversion_Functions all;
 
 
 /***********************************************************************
@@ -955,21 +956,30 @@
 /* Determine if the channel mode specified within rsl_chan_nr requires a
  * MODE MODIFY in to match the channel mode specified by given BSSMAP
  * ChannelType */
-function f_channel_needs_modify(BSSMAP_IE_ChannelType bssmap, RslChannelNr rsl_chan_nr)
+function f_channel_needs_modify(TELNETasp_PT vty, BSSMAP_IE_ChannelType bssmap, RslChannelNr rsl_chan_nr)
 return boolean {
 
-	/* FIXME: This tests the rsl_chan_nr to determine if we are on a
-	 * signalling channel or not. Unfortunately this may lead to false
-	 * results if we are on a TCH. The problem is that a TCH may be also
-	 * used in signalling mode, but this function assumes that only SDCCH4
-	 * and SDCCH8 are used as signalling channels at all. */
-
 	var boolean current_signalling := false;
 	var boolean desired_signalling := false;
 
 	select (rsl_chan_nr) {
 	       case (t_RslChanNr_SDCCH4(?, ?)) { current_signalling := true; }
 	       case (t_RslChanNr_SDCCH8(?, ?)) { current_signalling := true; }
+	       case (t_RslChanNr_Bm(?)) {
+			/* TCH/F, always subslot 0 */
+			var charstring res := f_vty_transceive_ret(vty, "show lchan 0 0 " & int2str(rsl_chan_nr.tn) & " 0");
+			if (f_strstr(res, "Channel Mode / Codec: SIGNALLING", 0) >= 0) {
+				current_signalling := true;
+			}
+	       }
+	       case (t_RslChanNr_Lm(?, ?)) {
+			/* TCH/H */
+			var charstring res := f_vty_transceive_ret(vty, "show lchan 0 0 " & int2str(rsl_chan_nr.tn)
+								   & " " & int2str(rsl_chan_nr.u.lm.sub_chan));
+			if (f_strstr(res, "Channel Mode / Codec: SIGNALLING", 0) >= 0) {
+				current_signalling := true;
+			}
+	       }
 	}
 
 	if (bssmap.speechOrDataIndicator == '0011'B) {
@@ -1134,7 +1144,7 @@
 		 * channel, we must now check if the mode of the current
 		 * channel is compatible. If not we expect the BSC to modify
 		 * the mode */
-		exp_modify := f_channel_needs_modify(ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr);
+		exp_modify := f_channel_needs_modify(BSCVTY, ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr);
 	}
 
 	/* Some test situations will involve MGCP transactions on a media

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23807
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: If30e2cec65da91cb5899ee29e2afb6696437a4c9
Gerrit-Change-Number: 23807
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210430/a97ec76f/attachment.htm>


More information about the gerrit-log mailing list