laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28134 )
Change subject: sms_queue: Use local variable rather than 9x pointer de-ref in function
......................................................................
sms_queue: Use local variable rather than 9x pointer de-ref in function
Change-Id: Idf6eb9ec6603a0643033396ed9227e4319724145
---
M src/libmsc/sms_queue.c
1 file changed, 10 insertions(+), 9 deletions(-)
Approvals:
keith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index a47f8e0..ff4940a 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -584,6 +584,7 @@
void *handler_data, void *signal_data)
{
struct gsm_network *network = handler_data;
+ struct gsm_sms_queue *smq = network->sms_queue;
struct sms_signal_data *sig_sms = signal_data;
struct gsm_sms_pending *pending;
struct vlr_subscr *vsub;
@@ -591,7 +592,7 @@
/* We got a new SMS and maybe should launch the queue again. */
if (signal == S_SMS_SUBMITTED || signal == S_SMS_SMMA) {
/* TODO: For SMMA we might want to re-use the radio connection. */
- sms_queue_trigger(network->sms_queue);
+ sms_queue_trigger(smq);
return 0;
}
@@ -604,26 +605,26 @@
* sms that are not in our control as we just have a channel
* open anyway.
*/
- pending = sms_find_pending(network->sms_queue, sig_sms->sms->id);
+ pending = sms_find_pending(smq, sig_sms->sms->id);
if (!pending)
return 0;
switch (signal) {
case S_SMS_DELIVERED:
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_ACK);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_ACK);
/* Remember the subscriber and clear the pending entry */
vsub = pending->vsub;
vlr_subscr_get(vsub, __func__);
db_sms_delete_sent_message_by_id(pending->sms_id);
- sms_pending_free(network->sms_queue, pending);
+ sms_pending_free(smq, pending);
/* Attempt to send another SMS to this subscriber */
sms_send_next(vsub);
vlr_subscr_put(vsub, __func__);
break;
case S_SMS_MEM_EXCEEDED:
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_NOMEM);
- sms_pending_free(network->sms_queue, pending);
- sms_queue_trigger(network->sms_queue);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_NOMEM);
+ sms_pending_free(smq, pending);
+ sms_queue_trigger(smq);
break;
case S_SMS_UNKNOWN_ERROR:
/*
@@ -637,12 +638,12 @@
* should flag the SMS as bad.
*/
if (sig_sms->paging_result) {
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_ERR);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_ERR);
/* BAD SMS? */
db_sms_inc_deliver_attempts(sig_sms->sms);
sms_pending_failed(pending, 0);
} else {
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_TIMEOUT);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_TIMEOUT);
sms_pending_failed(pending, 1);
}
break;
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28134
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Idf6eb9ec6603a0643033396ed9227e4319724145
Gerrit-Change-Number: 28134
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28137 )
Change subject: sms: Make default SMS validity period configurable via VTY
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28137
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ie2c81c1d5795dd9aaf07b9766013f20b01abc762
Gerrit-Change-Number: 28137
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 19 May 2022 19:34:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: keith.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28136 )
Change subject: smpp: Parse and use SMPP-provided validity period
......................................................................
Patch Set 6: Verified+1 Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28136
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Iad9f2697f045ed3bc0eb74c3a9730861f82e6c48
Gerrit-Change-Number: 28136
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-Comment-Date: Thu, 19 May 2022 19:34:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28135 )
Change subject: sms_queue: Make deletion of messages from DB VTY-configurable
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28135
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Id6174875d5c01c40d987077651b27ae1acbcaa93
Gerrit-Change-Number: 28135
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 19 May 2022 19:34:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/28133 )
Change subject: sms: Give smsc its own VTY config node
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28133
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ie8e0ab1a9f979337ff06544b9ab3820954d9804a
Gerrit-Change-Number: 28133
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 19 May 2022 19:34:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/28166 )
Change subject: coding: fix decoding of AHS_SID_UPDATE frames (BER ~50%)
......................................................................
coding: fix decoding of AHS_SID_UPDATE frames (BER ~50%)
As was demonstrated in [1], there is a TCH/AHS specific problem in
libosmocoding causing unexpected BER ~50% in decoded AHS_SID_UPDATE
frames. The reason is that A[H]S_SID_UPDATE employs quite tricky
interleaving algorithm, which is different from the algorithm used
by normal TCH/AHS speech frames or A[F]S_SID_UPDATE frames.
+---------+--------------------+---------+--------------------+
| in-band | SID marker | in-band | coded data |
+---------+--------------------+---------+--------------------+
| 16 bits | 212 bits | 16 bits | 212 bits |
* AHS_SID_UPDATE is interleaved over 456 bits (4 Normal Bursts):
** both halves (228 bits each) contain coded in-band data (16 bits),
** the first half contains the identification marker (212 bits),
** the second half contains the encoded SID_UPDATE (212 bits).
The first half (containing the SID marker) is carried by even bits
of the first two bursts and odd bits of the last two bursts. The
marker allows us to detect that it's an AHS_SID_UPDATE.
The other half is carried by even bits of the last two bursts and
odd bits of the first two bursts. However, the current code does
not use odd bits of the first two bursts at all, so buffer cB[]
in gsm0503_tch_ahs_decode_dtx() contains only 114 out of 228 bits.
This patch changes the logic, so that gsm0503_tch_ahs_decode_dtx()
would not split AHS_SID_UPDATE onto two frames anymore like its
TCH/AFS equivalent does, but attempt to deinterleave the second
half and attempt to decode the payload immediately.
Change-Id: I8686d895e96fa0e606c1898b6574cc80a8f46983
Related: [1] I434157e2091a306c039123cea08d84bd8533c937
Related: SYS#5853
---
M src/coding/gsm0503_coding.c
M tests/dtx/dtx_gsm0503_test.ok
2 files changed, 17 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/28166/1
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index e81bf02..26ca6c4 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -2676,20 +2676,24 @@
/* Determine the DTX frame type (SID_UPDATE, ONSET etc...) */
if (dtx) {
- const enum gsm0503_amr_dtx_frames dtx_prev = *dtx;
-
osmo_sbit2ubit(cBd, cB, 456);
*dtx = gsm0503_detect_ahs_dtx_frame(n_errors, n_bits_total, cBd);
+ /* TODO: detect and handle AHS_SID_UPDATE + AHS_SID_UPDATE_INH */
switch (*dtx) {
- case AMR_OTHER:
- /* NOTE: The AHS_SID_UPDATE frame is splitted into
- * two half rate frames. If the id marker frame
- * (AHS_SID_UPDATE) is detected the following frame
- * contains the actual comfort noised data part of
- * (AHS_SID_UPDATE_CN). */
- if (dtx_prev != AHS_SID_UPDATE)
- break;
+ case AHS_SID_UPDATE:
+ /* cB[] contains 16 bits of coded in-band data and 212 bits containing
+ * the identification marker. We need to unmap/deinterleave 114 odd
+ * bits from the last two blocks, 114 even bits from the first two
+ * blocks and combine them together. */
+ gsm0503_tch_burst_unmap(&iB[0 * 114], &bursts[2 * 116], NULL, 0);
+ gsm0503_tch_burst_unmap(&iB[1 * 114], &bursts[3 * 116], NULL, 0);
+ gsm0503_tch_burst_unmap(&iB[2 * 114], &bursts[0 * 116], NULL, 1);
+ gsm0503_tch_burst_unmap(&iB[3 * 114], &bursts[1 * 116], NULL, 1);
+ gsm0503_tch_hr_deinterleave(cB, iB);
+
+ /* cB[] is expected to contain 16 bits of coded in-band data and
+ * 212 bits containing the coded data (53 bits coded at 1/4 rate). */
*dtx = AHS_SID_UPDATE_CN;
osmo_conv_decode_ber(&gsm0503_tch_axs_sid_update,
@@ -2715,7 +2719,6 @@
tch_amr_reassemble(tch_data, sid_first_dummy, 39);
len = 5;
goto out;
- case AHS_SID_UPDATE:
case AHS_ONSET:
case AHS_SID_FIRST_INH:
case AHS_SID_UPDATE_INH:
diff --git a/tests/dtx/dtx_gsm0503_test.ok b/tests/dtx/dtx_gsm0503_test.ok
index 750b440..edf74ec 100644
--- a/tests/dtx/dtx_gsm0503_test.ok
+++ b/tests/dtx/dtx_gsm0503_test.ok
@@ -17,10 +17,10 @@
Running test_gsm0503_tch_afhs_decode_dtx(at offset=0): testing detection/decoding of AHS_SID_UPDATE
==> gsm0503_tch_ahs_decode_dtx() yields 'AMR_OTHER (audio)' (rc=-1, BER 109/212)
Running test_gsm0503_tch_afhs_decode_dtx(at offset=232): testing detection/decoding of AHS_SID_UPDATE
- ==> gsm0503_tch_ahs_decode_dtx() yields 'AHS_SID_UPDATE (marker)' (rc=0, BER 0/212)
-Running test_gsm0503_tch_afhs_decode_dtx(at offset=464): testing detection/decoding of AHS_SID_UPDATE
- ==> gsm0503_tch_ahs_decode_dtx() yields 'AHS_SID_UPDATE_CN (audio)' (rc=5, BER 106/212)
+ ==> gsm0503_tch_ahs_decode_dtx() yields 'AHS_SID_UPDATE_CN (audio)' (rc=5, BER 0/212)
====> tch_data[] = { 6003ccb270 }
+Running test_gsm0503_tch_afhs_decode_dtx(at offset=464): testing detection/decoding of AHS_SID_UPDATE
+ ==> gsm0503_tch_ahs_decode_dtx() yields 'AMR_OTHER (audio)' (rc=-1, BER 111/212)
Running test_gsm0503_tch_afhs_decode_dtx(at offset=0): testing tagging of FACCH/F
==> gsm0503_tch_afs_decode_dtx() yields 'AMR_OTHER (audio)' (rc=-1, BER 456/456)
Running test_gsm0503_tch_afhs_decode_dtx(at offset=0): testing tagging of FACCH/H
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28166
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8686d895e96fa0e606c1898b6574cc80a8f46983
Gerrit-Change-Number: 28166
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange