diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 245528f89..aa9f3956e 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -45,6 +45,7 @@ import from L3_Templates all; import from TELNETasp_PortType all; import from Osmocom_VTY_Functions all; +import from TCCConversion_Functions all; /*********************************************************************** @@ -955,21 +956,30 @@ return boolean { /* 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 @@ runs on MSC_ConnHdlr { * 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