Attention is currently required from: fixeria.
pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-bts/+/38301?usp=email )
Change subject: csd_v110: properly set bit E2 for TCH/F4.8 NT
......................................................................
Patch Set 3: -Code-Review
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38301?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: If8307a9ce0fdc6da45157149ccef7b840ff9d9b3
Gerrit-Change-Number: 38301
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 27 Sep 2024 11:15:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/38305?usp=email )
Change subject: Create transaction for all call indepenant SS messages
......................................................................
Create transaction for all call indepenant SS messages
When an initial call-independent supplementary service message is
received, it is checked whether the message is a REGISTER message.
If it is not, the MSC will reject it by sending a RELEASE COMPLETE
message.
This patch ensures that a transaction is created even if the message
is not a REGISTER message. If the message is not a REGISTER message,
the transaction is freed after sending the RELEASE COMPLETE message.
The release of the transaction immediately releases the BSSMAP
connection, if there are no other ongoing transactions.
Without this patch, the msc_a_fsm would wait 5 seconds for an initial
transaction before releasing the BSSMAP connection.
Related: OS#6427
Change-Id: Ic6765e5d480735e67d97f0f560da24653b26d487
---
M src/libmsc/gsm_09_11.c
1 file changed, 23 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/05/38305/1
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index e293890..7b98734 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -127,24 +127,6 @@
/* Count MS-initiated attempts to establish a NC SS/USSD session */
rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_NC_SS_MO_REQUESTS));
- /**
- * According to GSM TS 04.80, section 2.4.2 "Register
- * (mobile station to network direction)", the REGISTER
- * message is sent by the mobile station to the network
- * to assign a new transaction identifier for call independent
- * supplementary service control and to request or acknowledge
- * a supplementary service.
- */
- if (msg_type != GSM0480_MTYPE_REGISTER) {
- LOGP(DSS, LOGL_ERROR, "Rx %s message for non-existing transaction (tid-%u)\n",
- gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, msg_type),
- gsm48_hdr_trans_id(gh));
- gsm48_tx_simple(msc_a,
- GSM48_PDISC_NC_SS | (tid << 4),
- GSM0480_MTYPE_RELEASE_COMPLETE);
- return -EINVAL;
- }
-
trans = trans_alloc(net, vsub, TRANS_USSD, tid, new_callref++);
if (!trans) {
LOGP(DSS, LOGL_ERROR, " -> No memory for trans\n");
@@ -173,6 +155,29 @@
"Creating new MO SS transaction without prior CM Service Request\n");
else
msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_SS);
+
+ /**
+ * According to GSM TS 04.80, section 2.4.2 "Register
+ * (mobile station to network direction)", the REGISTER
+ * message is sent by the mobile station to the network
+ * to assign a new transaction identifier for call independent
+ * supplementary service control and to request or acknowledge
+ * a supplementary service.
+ */
+ if (msg_type != GSM0480_MTYPE_REGISTER) {
+ LOGP(DSS, LOGL_ERROR, "Rx %s message for non-existing transaction (tid-%u)\n",
+ gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, msg_type),
+ gsm48_hdr_trans_id(gh));
+ gsm48_tx_simple(msc_a,
+ GSM48_PDISC_NC_SS | (tid << 4),
+ GSM0480_MTYPE_RELEASE_COMPLETE);
+
+ /* Terminate transaction */
+ trans_free(trans);
+
+ return -EINVAL;
+ }
+
}
LOG_TRANS(trans, LOGL_DEBUG, "Received SS/USSD msg %s\n",
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38305?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ic6765e5d480735e67d97f0f560da24653b26d487
Gerrit-Change-Number: 38305
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Attention is currently required from: fixeria.
falconia has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-bts/+/38301?usp=email )
Change subject: csd_v110: properly set bit E2 for TCH/F4.8 NT
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
> Hm, then Harald's code in `gsmtap_csd_rlp_process()` should also be wrong.
Yes, it is also wrong!
> Yes, such a flag can be calculated from current TDMA Fn then.
See here:
https://gerrit.osmocom.org/c/osmo-bts/+/38304
I haven't touched the gsmtap code yet, mostly because I don't understand it.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38301?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: If8307a9ce0fdc6da45157149ccef7b840ff9d9b3
Gerrit-Change-Number: 38301
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 27 Sep 2024 10:21:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: falconia.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-bts/+/38301?usp=email )
Change subject: csd_v110: properly set bit E2 for TCH/F4.8 NT
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
> Unfortunately this approach cannot work because bit E7 simply does not exist in NT mode: [...
Hm, then Harald's code in `gsmtap_csd_rlp_process()` should also be wrong.
> The only correct solution is to extend the internal API to csd_v110_rtp_encode() and pass a flag that indicates alignment with TDMA multiframe structure.
Yes, such a flag can be calculated from current TDMA Fn then.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38301?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: If8307a9ce0fdc6da45157149ccef7b840ff9d9b3
Gerrit-Change-Number: 38301
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Comment-Date: Fri, 27 Sep 2024 07:09:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/osmo-bts/+/38304?usp=email )
Change subject: csd_v110: set E2 bit correctly for TCH/F4.8 NT
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Disclaimer: I currently have no way to test any CSD functionality or anything else that requires osmo-bts-trx; this patch has been implemented "from theory only". However, the current code is known to be wrong (E2 is always 0), whereas the new code stands at least a chance of being correct. In any case, I would appreciate it if someone can test it. If someone can run a test setup and send me pcap of the RTP output, I can analyze that pcap myself to verify correctness of E-bits.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38304?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I1e0ad58aad3361b3a2b0a47113bd065587636730
Gerrit-Change-Number: 38304
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 27 Sep 2024 03:24:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/38304?usp=email )
Change subject: csd_v110: set E2 bit correctly for TCH/F4.8 NT
......................................................................
csd_v110: set E2 bit correctly for TCH/F4.8 NT
In all classic NT modes below 14.5 kbit/s, V.110 frame bits E2 and E3
are repurposed to indicate the alignment whereby a single 240-bit RLP
frame is composed of 4 pseudo-V.110 frames in switching transport.
(TS 48.020 section 15.1.) In the case of TCH/F9.6, setting both E2
and E3 is easy because all 4 pseudo-V.110 frames go out in the same
clearmode RTP packet as a result of a single channel decoding
operation. However, in the case of TCH/F4.8 there are two separate
channel decoding operations producing two separate RTP packets
20 ms apart. Furthermore, GSM 05.03 section 3.4.1 specifies which
TDMA frame positions hold which half of the RLP frame - therefore,
the correct emission of bit E2 needs to be based on the TDMA frame
number at which the block was received.
Related: OS#6578
Change-Id: I1e0ad58aad3361b3a2b0a47113bd065587636730
---
M include/osmo-bts/csd_v110.h
M src/common/csd_v110.c
M src/common/l1sap.c
M tests/csd/csd_test.c
4 files changed, 23 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/04/38304/1
diff --git a/include/osmo-bts/csd_v110.h b/include/osmo-bts/csd_v110.h
index f6be0ae..b461724 100644
--- a/include/osmo-bts/csd_v110.h
+++ b/include/osmo-bts/csd_v110.h
@@ -18,6 +18,6 @@
extern const struct csd_v110_lchan_desc csd_v110_lchan_desc[256];
int csd_v110_rtp_encode(const struct gsm_lchan *lchan, uint8_t *rtp,
- const uint8_t *data, size_t data_len);
+ const uint8_t *data, size_t data_len, uint32_t fn);
int csd_v110_rtp_decode(const struct gsm_lchan *lchan, uint8_t *data,
const uint8_t *rtp, size_t rtp_len);
diff --git a/src/common/csd_v110.c b/src/common/csd_v110.c
index d6c00b0..d8a8596 100644
--- a/src/common/csd_v110.c
+++ b/src/common/csd_v110.c
@@ -73,8 +73,17 @@
#endif
};
+/* In the case of TCH/F4.8 NT, we have to set bit E2 based on the TDMA
+ * frame number at which we received the block in question. See
+ * GSM 05.03 section 3.4.1 and the mapping tables of GSM 05.02. */
+static const uint8_t tchf48_nt_e2_map[26] = {
+ [4] = 1, /* B1 position */
+ [13] = 1, /* B3 position */
+ [21] = 1, /* B5 position */
+};
+
int csd_v110_rtp_encode(const struct gsm_lchan *lchan, uint8_t *rtp,
- const uint8_t *data, size_t data_len)
+ const uint8_t *data, size_t data_len, uint32_t fn)
{
const struct csd_v110_frame_desc *desc;
ubit_t ra_bits[80 * 4];
@@ -109,9 +118,15 @@
/* E1 .. E3 must set by out-of-band knowledge */
if (lchan->csd_mode == LCHAN_CSD_M_NT) {
/* non-transparent: as per 3GPP TS 48.020, Table 7 */
- df.e_bits[0] = 0; /* E1: as per 15.1.2, shall be set to 0 (for BSS-MSC) */
- df.e_bits[1] = (i >> 1) & 0x01; /* E2: 0 for Q1/Q2, 1 for Q3/Q4 */
- df.e_bits[2] = (i >> 0) & 0x01; /* E3: 0 for Q1/Q3, 1 for Q2/Q4 */
+ /* E1: as per 15.1.2, shall be set to 0 (for BSS-MSC) */
+ df.e_bits[0] = 0;
+ /* E2: 0 for Q1/Q2, 1 for Q3/Q4 */
+ if (desc->num_blocks == 4)
+ df.e_bits[1] = (i >> 1) & 0x01;
+ else
+ df.e_bits[1] = tchf48_nt_e2_map[fn % 26];
+ /* E3: 0 for Q1/Q3, 1 for Q2/Q4 */
+ df.e_bits[2] = (i >> 0) & 0x01;
} else {
/* transparent: as per 3GPP TS 44.021, Figure 4 */
df.e_bits[0] = e1e2e3_map[lchan->csd_mode][0]; /* E1 */
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 5a900f8..68920a4 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1937,7 +1937,7 @@
gsmtap_csd_rlp_process(lchan, true, tch_ind, data, data_len);
- rc = csd_v110_rtp_encode(lchan, &rtp_pl[0], data, data_len);
+ rc = csd_v110_rtp_encode(lchan, &rtp_pl[0], data, data_len, tch_ind->fn);
if (rc < 0)
return;
diff --git a/tests/csd/csd_test.c b/tests/csd/csd_test.c
index 13a6419..235d5f5 100644
--- a/tests/csd/csd_test.c
+++ b/tests/csd/csd_test.c
@@ -115,7 +115,7 @@
data_enc[i] = i & 0x01;
/* encode an RTP frame and print it */
- rc = csd_v110_rtp_encode(&lchan, &rtp[0], &data_enc[0], bit_num);
+ rc = csd_v110_rtp_encode(&lchan, &rtp[0], &data_enc[0], bit_num, 0);
fprintf(stderr, "[i] csd_v110_rtp_encode() returns %d\n", rc);
if (rc != RFC4040_RTP_PLEN)
return;
@@ -139,7 +139,7 @@
fprintf(stderr, "[i] Testing '%s' (IDLE)\n", tc->name);
/* encode an idle RTP frame and print it */
- rc = csd_v110_rtp_encode(&lchan, &rtp[0], &data_enc[0], 0);
+ rc = csd_v110_rtp_encode(&lchan, &rtp[0], &data_enc[0], 0, 0);
fprintf(stderr, "[i] csd_v110_rtp_encode() returns %d\n", rc);
if (rc != RFC4040_RTP_PLEN)
return;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38304?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I1e0ad58aad3361b3a2b0a47113bd065587636730
Gerrit-Change-Number: 38304
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>