aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-litecell15/l1_if.c
diff options
context:
space:
mode:
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/l1_if.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/l1_if.c')
-rw-r--r--src/osmo-bts-litecell15/l1_if.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index cf7ce585..a4378c15 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -441,6 +441,7 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
uint8_t chan_nr;
GsmL1_Prim_t *l1p;
struct msgb *nmsg = NULL;
+ int rc = -1;
chan_nr = l1sap->u.tch.chan_nr;
u32Fn = l1sap->u.tch.fn;
@@ -464,17 +465,20 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
if (!nmsg)
return -ENOMEM;
l1p = msgb_l1prim(nmsg);
- if (!l1if_tch_encode(lchan,
+ rc = l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
msg->data, msg->len, u32Fn,
- l1sap->u.tch.marker)) {
+ l1sap->u.tch.marker);
+ if (rc < 0) {
+ /* no data encoded for L1: smth will be generated below */
msgb_free(nmsg);
nmsg = NULL;
}
}
- /* no message/data, we generate an empty traffic msg */
+ /* no message/data, we might generate an empty traffic msg or re-send
+ cached SID in case of DTX */
if (!nmsg)
nmsg = gen_empty_tch_msg(lchan, u32Fn);
@@ -502,7 +506,7 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
/* send message to DSP's queue */
osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg);
- if (l1sap->u.tch.marker) { /* Send voice after ONSET was sent */
+ if (l1sap->u.tch.marker) { /* DTX: send voice after ONSET was sent */
l1sap->u.tch.marker = 0;
return ph_tch_req(trx, l1sap->oph.msg, l1sap);
}