aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-litecell15/tch.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-09-16 19:46:00 +0200
committerMax <msuraev@sysmocom.de>2016-09-23 17:03:00 +0200
commit70460814ce3600b9491dea6b1f541144283dcfb1 (patch)
tree9af2c692e0ee85edcae6251c148c0fd6b57cd72d /src/osmo-bts-litecell15/tch.c
parent527dd402c714c3ee0832fa2057b219075f8f7646 (diff)
DTX: fix SID logic
Previously receiving SID via RTP always caused it's transmission to L1 regardless of the time which might have resulted in excess traffic. Fix this by only saving SID data and transmitting it later on as necessary according to 3GPP TS 26.093 A.5.1.1. Change-Id: Ifcdc5c60d0238b704a94f6778d4e00f2b087b090 Fixes: OS#1801
Diffstat (limited to 'src/osmo-bts-litecell15/tch.c')
-rw-r--r--src/osmo-bts-litecell15/tch.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c
index 4fdf6a65..6ac27631 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -270,8 +270,10 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
}
#endif
- if (ft == AMR_SID)
+ if (ft == AMR_SID) {
save_last_sid(lchan, l1_payload, payload_len, fn, sti);
+ return -EALREADY;
+ }
return payload_len+1;
}
@@ -279,9 +281,9 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
#define RTP_MSGB_ALLOC_SIZE 512
/*! \brief function for incoming RTP via TCH.req
- * \param rs RTP Socket
* \param[in] rtp_pl buffer containing RTP payload
* \param[in] rtp_pl_len length of \a rtp_pl
+ * \returns true if encoding result can be sent further to L1, false otherwise
*
* This function prepares a msgb with a L1 PH-DATA.req primitive and
* queues it into lchan->dl_tch_queue.
@@ -290,7 +292,7 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
* yet, as things like the frame number, etc. are unknown at the time we
* pre-fill the primtive.
*/
-void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
+bool l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn)
{
uint8_t *payload_type;
@@ -324,6 +326,8 @@ void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
*payload_type = GsmL1_TchPlType_Amr;
rc = rtppayload_to_l1_amr(l1_payload, rtp_pl,
rtp_pl_len, lchan, fn);
+ if (-EALREADY == rc)
+ return false;
break;
default:
/* we don't support CSD modes */
@@ -334,13 +338,14 @@ void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
if (rc < 0) {
LOGP(DRTP, LOGL_ERROR, "%s unable to parse RTP payload\n",
gsm_lchan_name(lchan));
- return;
+ return false;
}
*len = rc + 1;
DEBUGP(DRTP, "%s RTP->L1: %s\n", gsm_lchan_name(lchan),
osmo_hexdump(data, *len));
+ return true;
}
static int is_recv_only(uint8_t speech_mode)