path: root/src/osmo-bts-litecell15/tch.c
diff options
authorMax <msuraev@sysmocom.de>2016-10-26 17:28:42 +0200
committerHarald Welte <laforge@gnumonks.org>2016-10-28 13:42:29 +0000
commitbce25a60f4bbd798b98727e66b25bf343031f7bc (patch)
tree5e71659c7f73d6db41f4897098fd6860c0957422 /src/osmo-bts-litecell15/tch.c
parentefb4a4baeb8ecd13ff41f25d61fd91a1162e6fa9 (diff)
DTX DL: split ONSET state handling
Handle ONSET cause by Voice and FACCH separately. In case of Voice we have RTP payload which we have to cache and send later on in next response to L1 RTS. FACCH have higher priority so it preempts both voice and silence alike - hence we can send ONSET immediately but still have to track previous state in order to get back to it gracefully. This affects lc15 and sysmo hw as there's no FSM-based DTX implementation for other models yet. Note: this requires patch for OpenBSC which adds FACCH buffer to tch.dtx struct. Change-Id: Idba14dcd0cb12cd7aee86391fcc152c49fcd7052 Related: OS#1802
Diffstat (limited to 'src/osmo-bts-litecell15/tch.c')
1 files changed, 4 insertions, 2 deletions
diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c
index b2513887..70764f5f 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -285,10 +285,9 @@ int l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
/* DTX DL-specific logic below: */
switch (lchan->tch.dtx.dl_amr_fsm->state) {
case ST_ONSET_V:
- case ST_ONSET_F:
*payload_type = GsmL1_TchPlType_Amr_Onset;
dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, 0);
- *len = 1;
+ *len = 3;
return 1;
case ST_VOICE:
*payload_type = GsmL1_TchPlType_Amr;
@@ -306,6 +305,9 @@ int l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
*payload_type = GsmL1_TchPlType_Amr;
rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len,
+ /* force STI bit to 0 to make sure resume after FACCH
+ works properly */
+ l1_payload[6 + 2] &= ~16;
return 0;
case ST_SID_F2:
*payload_type = GsmL1_TchPlType_Amr;