path: root/src/osmo-bts-litecell15/tch.c
diff options
authorMax <msuraev@sysmocom.de>2016-09-30 11:59:38 +0200
committerMax <msuraev@sysmocom.de>2016-09-30 19:13:08 +0200
commit5f2e2de84f5c7d3b0c9da54a4f51a95b26adc339 (patch)
treec63895a2c7bbaadaa7886640fa4175b2a7f4b89b /src/osmo-bts-litecell15/tch.c
parent067ef3f1ce1b7474a553bb8e54ff1543c4012828 (diff)
DTX: send AMR voice alongside with ONSET
When ONSET event happens (either via Marker bit or due to unmarked talkspurt) we should first send Onset event to L1 and than send voice data in response to the same PH-RTS.ind. Change-Id: I2a7b89430ca49eee4a350c5f980bd6bcbc386347
Diffstat (limited to 'src/osmo-bts-litecell15/tch.c')
1 files changed, 7 insertions, 5 deletions
diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c
index bcb1edda..e246ffb1 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -211,7 +211,9 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
* \param[in] rtp_pl buffer containing RTP payload
* \param[in] rtp_pl_len length of \a rtp_pl
* \param[in] marker RTP header Marker bit (indicates speech onset)
- * \returns true if encoding result can be sent further to L1, false otherwise
+ * \returns 0 if encoding result can be sent further to L1 without extra actions
+ * positive value if data is ready AND extra actions are required
+ * negative value otherwise
* This function prepares a msgb with a L1 PH-DATA.req primitive and
* queues it into lchan->dl_tch_queue.
@@ -220,7 +222,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.
-bool l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
+int 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, bool marker)
uint8_t *payload_type;
@@ -269,7 +271,7 @@ bool l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
LOGP(DRTP, LOGL_NOTICE, "%s SPEECH frame without"
" Marker: ONSET forced\n",
get_value_string(osmo_amr_type_names, ft));
- return true;
+ return rc;
LOGP(DRTP, LOGL_DEBUG, "%s SPEECH frame with Marker\n",
get_value_string(osmo_amr_type_names, ft));
@@ -289,14 +291,14 @@ bool 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",
- return false;
+ return -EBADMSG;
*len = rc + 1;
DEBUGP(DRTP, "%s RTP->L1: %s\n", gsm_lchan_name(lchan),
osmo_hexdump(data, *len));
- return true;
+ return 0;
static int is_recv_only(uint8_t speech_mode)