aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-sysmo')
-rw-r--r--src/osmo-bts-sysmo/femtobts.h10
-rw-r--r--src/osmo-bts-sysmo/tch.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/femtobts.h b/src/osmo-bts-sysmo/femtobts.h
index a2b8deab..b700dfd6 100644
--- a/src/osmo-bts-sysmo/femtobts.h
+++ b/src/osmo-bts-sysmo/femtobts.h
@@ -31,8 +31,14 @@
#endif
#ifdef L1_HAS_RTP_MODE
-/* This is temporarily disabled, as AMR has some bugs in RTP mode */
-//#define USE_L1_RTP_MODE /* Tell L1 to use RTP mode */
+/*
+ * The bit ordering has been fixed on >= 3.10 but I am verifying
+ * this on 3.11.
+ */
+#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(3, 11, 0)
+#warning "Using RTP mode.."
+#define USE_L1_RTP_MODE /* Tell L1 to use RTP mode */
+#endif
#endif
/*
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index c3c6ca33..d101b47a 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -256,6 +256,16 @@ static struct msgb *l1_to_rtppayload_amr(uint8_t *l1_payload, uint8_t payload_le
#ifdef USE_L1_RTP_MODE
cur = msgb_put(msg, amr_if2_len);
memcpy(cur, l1_payload+2, amr_if2_len);
+
+ /*
+ * Audiocode's MGW doesn't like receiving CMRs that are not
+ * the same as the previous one. This means we need to patch
+ * the content here.
+ */
+ if ((cur[0] & 0xF0) == 0xF0)
+ cur[0]= lchan->tch.last_cmr << 4;
+ else
+ lchan->tch.last_cmr = cur[0] >> 4;
#else
u_int8_t cmr;
uint8_t ft = l1_payload[2] & 0xF;