<p>neels <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23807">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">f_channel_needs_modify(): ask actual TCH lchan mode via VTY<br><br>I am introducing a BSC test case that runs through a assigning a TCH<br>channel for signalling, and then using Channel Mode Modify to change its<br>mode from signalling to speech. For this to work,<br>f_channel_needs_modify() needs to actually look up the channel mode of<br>the TCH and not assume that a TCH is always in speech mode.<br><br>Related: SYS#4895<br>Change-Id: If30e2cec65da91cb5899ee29e2afb6696437a4c9<br>---<br>M bsc/MSC_ConnectionHandler.ttcn<br>1 file changed, 18 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn</span><br><span>index 245528f..aa9f395 100644</span><br><span>--- a/bsc/MSC_ConnectionHandler.ttcn</span><br><span>+++ b/bsc/MSC_ConnectionHandler.ttcn</span><br><span>@@ -45,6 +45,7 @@</span><br><span> </span><br><span> import from TELNETasp_PortType all;</span><br><span> import from Osmocom_VTY_Functions all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from TCCConversion_Functions all;</span><br><span> </span><br><span> </span><br><span> /***********************************************************************</span><br><span>@@ -955,21 +956,30 @@</span><br><span> /* Determine if the channel mode specified within rsl_chan_nr requires a</span><br><span>  * MODE MODIFY in to match the channel mode specified by given BSSMAP</span><br><span>  * ChannelType */</span><br><span style="color: hsl(0, 100%, 40%);">-function f_channel_needs_modify(BSSMAP_IE_ChannelType bssmap, RslChannelNr rsl_chan_nr)</span><br><span style="color: hsl(120, 100%, 40%);">+function f_channel_needs_modify(TELNETasp_PT vty, BSSMAP_IE_ChannelType bssmap, RslChannelNr rsl_chan_nr)</span><br><span> return boolean {</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      /* FIXME: This tests the rsl_chan_nr to determine if we are on a</span><br><span style="color: hsl(0, 100%, 40%);">-         * signalling channel or not. Unfortunately this may lead to false</span><br><span style="color: hsl(0, 100%, 40%);">-       * results if we are on a TCH. The problem is that a TCH may be also</span><br><span style="color: hsl(0, 100%, 40%);">-     * used in signalling mode, but this function assumes that only SDCCH4</span><br><span style="color: hsl(0, 100%, 40%);">-   * and SDCCH8 are used as signalling channels at all. */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>     var boolean current_signalling := false;</span><br><span>     var boolean desired_signalling := false;</span><br><span> </span><br><span>         select (rsl_chan_nr) {</span><br><span>              case (t_RslChanNr_SDCCH4(?, ?)) { current_signalling := true; }</span><br><span>              case (t_RslChanNr_SDCCH8(?, ?)) { current_signalling := true; }</span><br><span style="color: hsl(120, 100%, 40%);">+               case (t_RslChanNr_Bm(?)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     /* TCH/F, always subslot 0 */</span><br><span style="color: hsl(120, 100%, 40%);">+                 var charstring res := f_vty_transceive_ret(vty, "show lchan 0 0 " & int2str(rsl_chan_nr.tn) & " 0");</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (f_strstr(res, "Channel Mode / Codec: SIGNALLING", 0) >= 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         current_signalling := true;</span><br><span style="color: hsl(120, 100%, 40%);">+                   }</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span style="color: hsl(120, 100%, 40%);">+             case (t_RslChanNr_Lm(?, ?)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  /* TCH/H */</span><br><span style="color: hsl(120, 100%, 40%);">+                   var charstring res := f_vty_transceive_ret(vty, "show lchan 0 0 " & int2str(rsl_chan_nr.tn)</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                & " " & int2str(rsl_chan_nr.u.lm.sub_chan));</span><br><span style="color: hsl(120, 100%, 40%);">+                     if (f_strstr(res, "Channel Mode / Codec: SIGNALLING", 0) >= 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         current_signalling := true;</span><br><span style="color: hsl(120, 100%, 40%);">+                   }</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span>     }</span><br><span> </span><br><span>        if (bssmap.speechOrDataIndicator == '0011'B) {</span><br><span>@@ -1134,7 +1144,7 @@</span><br><span>                * channel, we must now check if the mode of the current</span><br><span>              * channel is compatible. If not we expect the BSC to modify</span><br><span>                  * the mode */</span><br><span style="color: hsl(0, 100%, 40%);">-          exp_modify := f_channel_needs_modify(ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr);</span><br><span style="color: hsl(120, 100%, 40%);">+            exp_modify := f_channel_needs_modify(BSCVTY, ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr);</span><br><span>   }</span><br><span> </span><br><span>        /* Some test situations will involve MGCP transactions on a media</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23807">change 23807</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23807"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If30e2cec65da91cb5899ee29e2afb6696437a4c9 </div>
<div style="display:none"> Gerrit-Change-Number: 23807 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>