aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/tch.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-31 14:39:32 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-31 14:39:32 +0200
commita19912db347af14dd7eec0fea5c897875f1ddf5a (patch)
tree6ef9d8eaa4c9873c28244e87141df5b05565eb07 /src/osmo-bts-sysmo/tch.c
parenteececf5fa96875e93d622299408423766c6e35d0 (diff)
sysmobts: Enable the direct RTP mode for firmware >= 3.11
We need to patch the CMR due wanting to support systems that still have Audiocodes hardware in their chain. I have manually tested and could listen to my own voice on: TCH/H & AMR 5.9 & PTSN & BSC TCH/F & FR1 & Other subscriber & NITB TCH/F & EFR & Other subscriber & NITB TCH/H & HR1 & Other subscriber & NITB TCH/H & AMR 5.9 & Other subscriber & NITB The tests were done using the Nokia E71, a Blackberry curve and for the PTSN a HTC 8S were used.
Diffstat (limited to 'src/osmo-bts-sysmo/tch.c')
-rw-r--r--src/osmo-bts-sysmo/tch.c10
1 files changed, 10 insertions, 0 deletions
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;