falconia has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/32669 )


Change subject: lc15,oc2g: fix handling of SID in EFR
......................................................................

lc15,oc2g: fix handling of SID in EFR

Commit 32682c63f672 fixed EFR SID handling in osmo-bts-sysmo,
but that fix was never propagated into osmo-bts-{lc15,oc2g} versions,
which are essentially copies of osmo-bts-sysmo.  Fix that oversight.

Change-Id: I509c1ea374e640d819952d58592b12fa884ad9d8
---
M src/osmo-bts-lc15/tch.c
M src/osmo-bts-oc2g/tch.c
2 files changed, 25 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/69/32669/1

diff --git a/src/osmo-bts-lc15/tch.c b/src/osmo-bts-lc15/tch.c
index 65cd8aa..fdbf995 100644
--- a/src/osmo-bts-lc15/tch.c
+++ b/src/osmo-bts-lc15/tch.c
@@ -101,12 +101,8 @@
        /* new L1 can deliver bits like we need them */
        cur = msgb_put(msg, GSM_EFR_BYTES);
        memcpy(cur, l1_payload, GSM_EFR_BYTES);
-       enum osmo_amr_type ft;
-       enum osmo_amr_quality bfi;
-       uint8_t cmr;
-       int8_t sti, cmi;
-       osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti);
-       lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan);
+
+       lchan_set_marker(osmo_efr_check_sid(l1_payload, payload_len), lchan);

        return msg;
 }
@@ -259,7 +255,10 @@
                *payload_type = GsmL1_TchPlType_Efr;
                rc = rtppayload_to_l1_efr(l1_payload, rtp_pl,
                                          rtp_pl_len);
-               /* FIXME: detect and save EFR SID */
+               if (rc && lchan->ts->trx->bts->dtxd)
+                       is_sid = osmo_efr_check_sid(rtp_pl, rtp_pl_len);
+               if (is_sid)
+                       dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, -1);
                break;
        case GSM48_CMODE_SPEECH_AMR:
                if (use_cache) {
diff --git a/src/osmo-bts-oc2g/tch.c b/src/osmo-bts-oc2g/tch.c
index bcfdced..fce100f 100644
--- a/src/osmo-bts-oc2g/tch.c
+++ b/src/osmo-bts-oc2g/tch.c
@@ -101,12 +101,8 @@
        /* new L1 can deliver bits like we need them */
        cur = msgb_put(msg, GSM_EFR_BYTES);
        memcpy(cur, l1_payload, GSM_EFR_BYTES);
-       enum osmo_amr_type ft;
-       enum osmo_amr_quality bfi;
-       uint8_t cmr;
-       int8_t sti, cmi;
-       osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti);
-       lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan);
+
+       lchan_set_marker(osmo_efr_check_sid(l1_payload, payload_len), lchan);

        return msg;
 }
@@ -259,7 +255,10 @@
                *payload_type = GsmL1_TchPlType_Efr;
                rc = rtppayload_to_l1_efr(l1_payload, rtp_pl,
                                          rtp_pl_len);
-               /* FIXME: detect and save EFR SID */
+               if (rc && lchan->ts->trx->bts->dtxd)
+                       is_sid = osmo_efr_check_sid(rtp_pl, rtp_pl_len);
+               if (is_sid)
+                       dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, -1);
                break;
        case GSM48_CMODE_SPEECH_AMR:
                if (use_cache) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32669
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I509c1ea374e640d819952d58592b12fa884ad9d8
Gerrit-Change-Number: 32669
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <[email protected]>
Gerrit-MessageType: newchange

Reply via email to