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
Tue Apr 20 00:26:44 UTC 2021


neels has uploaded this change for review. ( 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, 12 insertions(+), 8 deletions(-)



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

diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 245528f..5b5bd6b 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,24 @@
 /* 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(?)) {
+		       /* FIXME: always picks subslot 0, because I currently can't be bothered to figure out how a TCH/H
+			* subslot 1 is indicated in RslChannelNr (plus all current tests where this matters use subslot
+			* 0 anyway). */
+		       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;
+		       }
+	       }
 	}
 
 	if (bssmap.speechOrDataIndicator == '0011'B) {
@@ -1134,7 +1138,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: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210420/cd3a01c7/attachment.htm>


More information about the gerrit-log mailing list