aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-06-10 15:33:42 +0200
committerMax <msuraev@sysmocom.de>2016-06-10 15:49:18 +0200
commit725f2283861dcd495eb2ea87784022cdc04ea02a (patch)
treeaa5aefc31b449ebf0bffdcc4853b6d49a5887d30
parentf43d24598d5c8769ed94d86e57e7deec8075c93c (diff)
DTXd: store/repeat last SID
Store last SID received over RTP and repeat is if necessary (no new SID or SPEECH frames) according to codec-specific scheduling rules. Change-Id: I42c417ec2e66d58edf790c73fc0518f2c0860c28 Related: OS#1563
-rw-r--r--src/common/tch.c124
-rw-r--r--src/osmo-bts-litecell15/l1_if.c4
-rw-r--r--src/osmo-bts-litecell15/l1_if.h4
-rw-r--r--src/osmo-bts-litecell15/tch.c66
-rw-r--r--src/osmo-bts-sysmo/l1_if.c4
-rw-r--r--src/osmo-bts-sysmo/l1_if.h4
-rw-r--r--src/osmo-bts-sysmo/tch.c66
7 files changed, 201 insertions, 71 deletions
diff --git a/src/common/tch.c b/src/common/tch.c
index 03db563c..597cb951 100644
--- a/src/common/tch.c
+++ b/src/common/tch.c
@@ -19,6 +19,9 @@
*
*/
+#include <stdbool.h>
+
+#include <osmocom/codec/codec.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/l1sap.h>
@@ -48,35 +51,118 @@ int add_l1sap_header(struct gsm_lchan *lchan, struct msgb *rmsg,
return l1sap_up(trx, l1sap);
}
-struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan)
+static inline bool fn_chk(uint8_t *t, uint32_t fn)
+{
+ uint8_t i;
+ for (i = 0; i < ARRAY_SIZE(t); i++)
+ if (fn % 104 == t[i])
+ return false;
+ return true;
+}
+
+static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn)
+{
+ /* 3GPP TS 45.008 ยง 8.3 */
+ uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 },
+ h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 },
+ h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 };
+ if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) {
+ if (lchan->type == GSM_LCHAN_TCH_F)
+ return fn_chk(f, fn);
+ else
+ return fn_chk(lchan->nr ? h1 : h0, fn);
+ }
+ return false;
+}
+
+static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg)
+{
+ uint8_t *l1_payload = get_payload_addr(msg);
+ if (lchan->tch.last_sid.len) {
+ memcpy(l1_payload, lchan->tch.last_sid.buf,
+ lchan->tch.last_sid.len);
+ set_payload_size(msg, lchan->tch.last_sid.len + 1);
+ return true;
+ }
+ return false;
+}
+
+/* store the last SID frame in lchan context */
+void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length,
+ uint32_t fn, bool update)
+{
+ size_t copy_len = OSMO_MIN(length + 1,
+ ARRAY_SIZE(lchan->tch.last_sid.buf));
+
+ lchan->tch.last_sid.len = copy_len;
+ lchan->tch.last_sid.fn = fn;
+ lchan->tch.last_sid.is_update = update;
+
+ memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len);
+}
+
+struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn)
{
struct msgb *msg;
- uint8_t *l1_payload;
msg = l1p_msgb_alloc();
if (!msg)
return NULL;
- l1_payload = get_payload_addr(msg);
-
switch (lchan->tch_mode) {
case GSM48_CMODE_SPEECH_AMR:
- set_payload_type(msg, lchan);
- if (lchan->tch.last_sid.len) {
- memcpy(l1_payload, lchan->tch.last_sid.buf,
- lchan->tch.last_sid.len);
- set_payload_size(msg, lchan->tch.last_sid.len + 1);
+ /* according to 3GPP TS 26.093 A.5.1.1: */
+ if (lchan->tch.last_sid.is_update) {
+ /* SID UPDATE should be repeated every 8th frame */
+ if (fn - lchan->tch.last_sid.fn < 7) {
+ msgb_free(msg);
+ return NULL;
+ }
} else {
- /* FIXME: decide if we should send SPEECH_BAD or
- * SID_BAD */
-#if 0
- *payload_type = GsmL1_TchPlType_Amr_SidBad;
- memset(l1_payload, 0xFF, 5);
- msu_param->u8Size = 5 + 3;
-#else
- /* send an all-zero SID */
- set_payload_size(msg, 8);
-#endif
+ /* 3rd frame after SID FIRST should be SID UPDATE */
+ if (fn - lchan->tch.last_sid.fn < 3) {
+ msgb_free(msg);
+ return NULL;
+ }
+ }
+ if (repeat_last_sid(lchan, msg))
+ return msg;
+ else {
+ LOGP(DL1C, LOGL_NOTICE, "Have to send AMR frame on TCH "
+ "(FN=%u) but SID buffer is empty - sent NO_DATA\n",
+ fn);
+ osmo_amr_rtp_enc(get_payload_addr(msg), 0, AMR_NO_DATA,
+ AMR_GOOD);
+ return msg;
+ }
+ break;
+ case GSM48_CMODE_SPEECH_V1:
+ /* unlike AMR, FR & HR schedued based on absolute FN value */
+ if (dtx_sched_optional(lchan, fn)) {
+ msgb_free(msg);
+ return NULL;
+ }
+ if (repeat_last_sid(lchan, msg))
+ return msg;
+ else {
+ LOGP(DL1C, LOGL_NOTICE, "Have to send V1 frame on TCH "
+ "(FN=%u) but SID buffer is empty - sent nothing\n",
+ fn);
+ return NULL;
+ }
+ break;
+ case GSM48_CMODE_SPEECH_EFR:
+ if (dtx_sched_optional(lchan, fn)) {
+ msgb_free(msg);
+ return NULL;
+ }
+ if (repeat_last_sid(lchan, msg))
+ return msg;
+ else {
+ LOGP(DL1C, LOGL_NOTICE, "Have to send EFR frame on TCH "
+ "(FN=%u) but SID buffer is empty - sent nothing\n",
+ fn);
+ return NULL;
}
break;
default:
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 1054abab..0ef83afb 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -415,12 +415,12 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
- msg->data, msg->len);
+ msg->data, msg->len, u32Fn);
}
/* no message/data, we generate an empty traffic msg */
if (!nmsg)
- nmsg = gen_empty_tch_msg(lchan);
+ nmsg = gen_empty_tch_msg(lchan, u32Fn);
/* no traffic message, we generate an empty msg */
if (!nmsg) {
diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h
index 0c8843bd..deeb6521 100644
--- a/src/osmo-bts-litecell15/l1_if.h
+++ b/src/osmo-bts-litecell15/l1_if.h
@@ -88,10 +88,10 @@ struct gsm_lchan *l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer)
/* tch.c */
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len);
+ uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t u32Fn);
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg);
int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer);
-struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan);
+struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t u32Fn);
/* ciphering */
int l1if_set_ciphering(struct lc15l1_hdl *fl1h,
diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c
index a7babf4a..ab5b8154 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -26,7 +26,7 @@
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
-
+#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -54,6 +54,8 @@
#include "lc15bts.h"
#include "l1_if.h"
+extern void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload,
+ size_t length, uint32_t fn, bool update);
extern int add_l1sap_header(struct gsm_lchan *lchan, struct msgb *rmsg,
struct gsm_bts_trx *trx, uint8_t chan_nr,
uint32_t fn);
@@ -133,8 +135,17 @@ void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan)
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
break;
+ case GSM48_CMODE_SPEECH_V1:
+ if (lchan->type == GSM_LCHAN_TCH_F)
+ *payload_type = GsmL1_TchPlType_Fr;
+ else
+ *payload_type = GsmL1_TchPlType_Hr;
+ break;
+ case GSM48_CMODE_SPEECH_EFR:
+ *payload_type = GsmL1_TchPlType_Efr;
+ break;
default:
- return;
+ *payload_type = GsmL1_TchPlType_NA;
}
}
@@ -173,11 +184,16 @@ static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len
* \param[in] payload_len length of \a rtp_payload
* \returns number of \a l1_payload bytes filled
*/
-static int rtppayload_to_l1_fr(uint8_t *l1_payload, const uint8_t *rtp_payload,
- unsigned int payload_len)
+static int rtppayload_to_l1_fr(uint8_t *l1_payload, uint8_t *rtp_payload,
+ unsigned int payload_len, struct gsm_lchan *lchan,
+ uint32_t fn)
{
/* new L1 can deliver bits like we need them */
memcpy(l1_payload, rtp_payload, GSM_FR_BYTES);
+
+ if (osmo_fr_check_sid(l1_payload, payload_len))
+ save_last_sid(lchan, l1_payload, payload_len, fn, false);
+
return GSM_FR_BYTES;
}
@@ -197,10 +213,17 @@ static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, uint8_t payload_le
}
static int rtppayload_to_l1_efr(uint8_t *l1_payload, const uint8_t *rtp_payload,
- unsigned int payload_len)
+ unsigned int payload_len,
+ struct gsm_lchan *lchan, uint32_t fn)
{
memcpy(l1_payload, rtp_payload, payload_len);
-
+ enum osmo_amr_type ft;
+ enum osmo_amr_quality bfi;
+ uint8_t cmr;
+ int8_t sti, cmi;
+ osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti);
+ if (ft == AMR_GSM_EFR_SID)
+ save_last_sid(lchan, l1_payload, payload_len, fn, false);
return payload_len;
}
@@ -231,8 +254,9 @@ static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len
* \param[in] payload_len length of \a rtp_payload
* \returns number of \a l1_payload bytes filled
*/
-static int rtppayload_to_l1_hr(uint8_t *l1_payload, const uint8_t *rtp_payload,
- unsigned int payload_len)
+static int rtppayload_to_l1_hr(uint8_t *l1_payload, uint8_t *rtp_payload,
+ unsigned int payload_len, struct gsm_lchan *lchan,
+ uint32_t fn)
{
if (payload_len != GSM_HR_BYTES) {
@@ -243,6 +267,9 @@ static int rtppayload_to_l1_hr(uint8_t *l1_payload, const uint8_t *rtp_payload,
memcpy(l1_payload, rtp_payload, GSM_HR_BYTES);
+ if (osmo_hr_check_sid(l1_payload, payload_len))
+ save_last_sid(lchan, l1_payload, payload_len, fn, false);
+
return GSM_HR_BYTES;
}
@@ -291,7 +318,7 @@ int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi)
*/
static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
uint8_t payload_len,
- struct gsm_lchan *lchan)
+ struct gsm_lchan *lchan, uint32_t fn)
{
struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
enum osmo_amr_type ft;
@@ -361,14 +388,9 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
}
#endif
- if (ft == AMR_SID) {
- /* store the last SID frame in lchan context */
- unsigned int copy_len;
- copy_len = OSMO_MIN(payload_len+1,
- ARRAY_SIZE(lchan->tch.last_sid.buf));
- lchan->tch.last_sid.len = copy_len;
- memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len);
- }
+ if (ft == AMR_SID)
+ save_last_sid(lchan, l1_payload, payload_len, fn,
+ sti ? true : false);
return payload_len+1;
}
@@ -388,7 +410,7 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
* pre-fill the primtive.
*/
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len)
+ uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn)
{
uint8_t *payload_type;
uint8_t *l1_payload;
@@ -405,22 +427,22 @@ void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
if (lchan->type == GSM_LCHAN_TCH_F) {
*payload_type = GsmL1_TchPlType_Fr;
rc = rtppayload_to_l1_fr(l1_payload,
- rtp_pl, rtp_pl_len);
+ rtp_pl, rtp_pl_len, lchan, fn);
} else{
*payload_type = GsmL1_TchPlType_Hr;
rc = rtppayload_to_l1_hr(l1_payload,
- rtp_pl, rtp_pl_len);
+ rtp_pl, rtp_pl_len, lchan, fn);
}
break;
case GSM48_CMODE_SPEECH_EFR:
*payload_type = GsmL1_TchPlType_Efr;
rc = rtppayload_to_l1_efr(l1_payload, rtp_pl,
- rtp_pl_len);
+ rtp_pl_len, lchan, fn);
break;
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
rc = rtppayload_to_l1_amr(l1_payload, rtp_pl,
- rtp_pl_len, lchan);
+ rtp_pl_len, lchan, fn);
break;
default:
/* we don't support CSD modes */
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index d6d0cdd1..56c0f700 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -409,12 +409,12 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
- msg->data, msg->len);
+ msg->data, msg->len, u32Fn);
}
/* no message/data, we generate an empty traffic msg */
if (!nmsg)
- nmsg = gen_empty_tch_msg(lchan);
+ nmsg = gen_empty_tch_msg(lchan, u32Fn);
/* no traffic message, we generate an empty msg */
if (!nmsg) {
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index bb1d5a52..25dfb994 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -108,10 +108,10 @@ struct gsm_lchan *l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer)
/* tch.c */
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len);
+ uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t u32Fn);
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg);
int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer);
-struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan);
+struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t u32Fn);
/* ciphering */
int l1if_set_ciphering(struct femtol1_hdl *fl1h,
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c
index 910c7fea..d8ba16f3 100644
--- a/src/osmo-bts-sysmo/tch.c
+++ b/src/osmo-bts-sysmo/tch.c
@@ -23,7 +23,7 @@
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
-
+#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -51,6 +51,8 @@
#include "femtobts.h"
#include "l1_if.h"
+extern void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload,
+ size_t length, uint32_t fn, bool update);
extern int add_l1sap_header(struct gsm_lchan *lchan, struct msgb *rmsg,
struct gsm_bts_trx *trx, uint8_t chan_nr,
uint32_t fn);
@@ -122,8 +124,17 @@ void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan)
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
break;
+ case GSM48_CMODE_SPEECH_V1:
+ if (lchan->type == GSM_LCHAN_TCH_F)
+ *payload_type = GsmL1_TchPlType_Fr;
+ else
+ *payload_type = GsmL1_TchPlType_Hr;
+ break;
+ case GSM48_CMODE_SPEECH_EFR:
+ *payload_type = GsmL1_TchPlType_Efr;
+ break;
default:
- return;
+ *payload_type = GsmL1_TchPlType_NA;
}
}
@@ -174,8 +185,9 @@ static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len
* \param[in] payload_len length of \a rtp_payload
* \returns number of \a l1_payload bytes filled
*/
-static int rtppayload_to_l1_fr(uint8_t *l1_payload, const uint8_t *rtp_payload,
- unsigned int payload_len)
+static int rtppayload_to_l1_fr(uint8_t *l1_payload, uint8_t *rtp_payload,
+ unsigned int payload_len, struct gsm_lchan *lchan,
+ uint32_t fn)
{
#ifdef USE_L1_RTP_MODE
/* new L1 can deliver bits like we need them */
@@ -187,6 +199,10 @@ static int rtppayload_to_l1_fr(uint8_t *l1_payload, const uint8_t *rtp_payload,
/* step1: reverse the bit-order of each payload byte */
osmo_revbytebits_buf(l1_payload, payload_len);
#endif /* USE_L1_RTP_MODE */
+
+ if (osmo_fr_check_sid(l1_payload, payload_len))
+ save_last_sid(lchan, l1_payload, payload_len, fn, false);
+
return GSM_FR_BYTES;
}
@@ -219,13 +235,20 @@ static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, uint8_t payload_le
}
static int rtppayload_to_l1_efr(uint8_t *l1_payload, const uint8_t *rtp_payload,
- unsigned int payload_len)
+ unsigned int payload_len,
+ struct gsm_lchan *lchan, uint32_t fn)
{
#ifndef USE_L1_RTP_MODE
#error We don't support EFR with L1 that doesn't support RTP mode!
#else
memcpy(l1_payload, rtp_payload, payload_len);
-
+ enum osmo_amr_type ft;
+ enum osmo_amr_quality bfi;
+ uint8_t cmr;
+ int8_t sti, cmi;
+ osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti);
+ if (ft == AMR_GSM_EFR_SID)
+ save_last_sid(lchan, l1_payload, payload_len, fn, false);
return payload_len;
#endif
}
@@ -265,8 +288,9 @@ static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len
* \param[in] payload_len length of \a rtp_payload
* \returns number of \a l1_payload bytes filled
*/
-static int rtppayload_to_l1_hr(uint8_t *l1_payload, const uint8_t *rtp_payload,
- unsigned int payload_len)
+static int rtppayload_to_l1_hr(uint8_t *l1_payload, uint8_t *rtp_payload,
+ unsigned int payload_len, struct gsm_lchan *lchan,
+ uint32_t fn)
{
if (payload_len != GSM_HR_BYTES) {
@@ -282,6 +306,9 @@ static int rtppayload_to_l1_hr(uint8_t *l1_payload, const uint8_t *rtp_payload,
osmo_revbytebits_buf(l1_payload, GSM_HR_BYTES);
#endif /* USE_L1_RTP_MODE */
+ if (osmo_hr_check_sid(l1_payload, payload_len))
+ save_last_sid(lchan, l1_payload, payload_len, fn, false);
+
return GSM_HR_BYTES;
}
@@ -366,7 +393,7 @@ int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi)
*/
static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
uint8_t payload_len,
- struct gsm_lchan *lchan)
+ struct gsm_lchan *lchan, uint32_t fn)
{
struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
enum osmo_amr_type ft;
@@ -450,14 +477,9 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
}
#endif
- if (ft == AMR_SID) {
- /* store the last SID frame in lchan context */
- unsigned int copy_len;
- copy_len = OSMO_MIN(payload_len+1,
- ARRAY_SIZE(lchan->tch.last_sid.buf));
- lchan->tch.last_sid.len = copy_len;
- memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len);
- }
+ if (ft == AMR_SID)
+ save_last_sid(lchan, l1_payload, payload_len, fn,
+ sti ? true : false);
return payload_len+1;
}
@@ -477,7 +499,7 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
* pre-fill the primtive.
*/
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len)
+ uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn)
{
uint8_t *payload_type;
uint8_t *l1_payload;
@@ -494,24 +516,24 @@ void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
if (lchan->type == GSM_LCHAN_TCH_F) {
*payload_type = GsmL1_TchPlType_Fr;
rc = rtppayload_to_l1_fr(l1_payload,
- rtp_pl, rtp_pl_len);
+ rtp_pl, rtp_pl_len, lchan, fn);
} else{
*payload_type = GsmL1_TchPlType_Hr;
rc = rtppayload_to_l1_hr(l1_payload,
- rtp_pl, rtp_pl_len);
+ rtp_pl, rtp_pl_len, lchan, fn);
}
break;
#if defined(L1_HAS_EFR) && defined(USE_L1_RTP_MODE)
case GSM48_CMODE_SPEECH_EFR:
*payload_type = GsmL1_TchPlType_Efr;
rc = rtppayload_to_l1_efr(l1_payload, rtp_pl,
- rtp_pl_len);
+ rtp_pl_len, lchan, fn);
break;
#endif
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
rc = rtppayload_to_l1_amr(l1_payload, rtp_pl,
- rtp_pl_len, lchan);
+ rtp_pl_len, lchan, fn);
break;
default:
/* we don't support CSD modes */