aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-09-03 15:41:12 +0200
committerHarald Welte <laforge@gnumonks.org>2011-09-03 15:41:12 +0200
commit526b0c62cf891cd728460260bf10a919e9e437d3 (patch)
tree1e38f673a7a79fe7bbd25fb872f37547b40dd1c9 /src/common/bts.c
parentb7bec6d488ac3c36957a717358b91836ba9b2215 (diff)
Add new ORTP based libosmo-trau based voice support
Using osmo-bts-sysmo and this code, it is now possible to do FR and AMR based voice calls on TCH/F. A lot of CPU is wasted in the conversion between the RTP formats and the L1 specific formats for the codec frames. All data needs to be shifted by four bits, and the order of bits needs to be reversed in every byte.
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 35999294..6dd0362c 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -34,6 +34,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/gsm/lapdm.h>
+#include <osmocom/trau/osmo_ortp.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/abis.h>
@@ -48,6 +49,7 @@ void *tall_bts_ctx;
int bts_init(struct gsm_bts *bts)
{
struct gsm_bts_role_bts *btsb;
+ struct gsm_bts_trx *trx;
bts->role = btsb = talloc_zero(bts, struct gsm_bts_role_bts);
@@ -59,6 +61,22 @@ int bts_init(struct gsm_bts *bts)
/* set BTS to dependency */
oml_mo_state_chg(&bts->mo, -1, NM_AVSTATE_DEPENDENCY);
+ /* initialize bts data structure */
+ llist_for_each_entry(trx, &bts->trx_list, list) {
+ int i;
+ for (i = 0; i < ARRAY_SIZE(trx->ts); i++) {
+ struct gsm_bts_trx_ts *ts = &trx->ts[i];
+ int k;
+
+ for (k = 0; k < ARRAY_SIZE(ts->lchan); k++) {
+ struct gsm_lchan *lchan = &ts->lchan[k];
+ INIT_LLIST_HEAD(&lchan->dl_tch_queue);
+ }
+ }
+ }
+
+ osmo_rtp_init(tall_bts_ctx);
+
return bts_model_init(bts);
}