2009-02-09 18:13:26 +00:00
|
|
|
/* Simple TRAU frame reflector to route voice calls */
|
|
|
|
|
|
|
|
/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2011-01-01 14:25:50 +00:00
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2009-02-09 18:13:26 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-01 14:25:50 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2009-02-09 18:13:26 +00:00
|
|
|
*
|
2011-01-01 14:25:50 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-02-09 18:13:26 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* The "TRAU mux map" defines which particular 16kbit sub-slot (in which E1
|
|
|
|
* timeslot on which E1 interface) should be directly muxed to which other
|
|
|
|
* sub-slot. Entries in the mux map are always bi-directional.
|
|
|
|
*
|
|
|
|
* The idea of all this is to directly switch voice channels in the BSC
|
|
|
|
* from one phone to another. We do this right now since we don't support
|
|
|
|
* any external interface for voice channels, and in the future as an
|
|
|
|
* optimization to routing them externally.
|
|
|
|
*/
|
|
|
|
|
2011-05-24 11:25:38 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <openbsc/gsm_data.h>
|
|
|
|
#include <openbsc/mncc.h>
|
|
|
|
|
2014-02-20 10:18:00 +00:00
|
|
|
struct decoded_trau_frame;
|
|
|
|
|
2009-02-09 18:13:26 +00:00
|
|
|
/* map a TRAU mux map entry */
|
|
|
|
int trau_mux_map(const struct gsm_e1_subslot *src,
|
|
|
|
const struct gsm_e1_subslot *dst);
|
2009-02-19 15:14:23 +00:00
|
|
|
int trau_mux_map_lchan(const struct gsm_lchan *src,
|
|
|
|
const struct gsm_lchan *dst);
|
2009-02-09 18:13:26 +00:00
|
|
|
|
|
|
|
/* unmap a TRAU mux map entry */
|
2011-04-18 15:04:00 +00:00
|
|
|
int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref);
|
2009-02-09 18:13:26 +00:00
|
|
|
|
|
|
|
/* we get called by subchan_demux */
|
|
|
|
int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
|
2011-04-18 15:04:00 +00:00
|
|
|
const uint8_t *trau_bits, int num_bits);
|
2009-05-23 15:51:12 +00:00
|
|
|
|
|
|
|
/* add a trau receiver */
|
2011-04-18 15:04:00 +00:00
|
|
|
int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref);
|
2009-05-23 15:51:12 +00:00
|
|
|
|
|
|
|
/* send trau from application */
|
2009-12-19 21:23:05 +00:00
|
|
|
int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
2013-12-05 13:37:11 +00:00
|
|
|
/* switch trau muxer to new lchan */
|
|
|
|
int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan);
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
/* callback invoked if we receive TRAU frames */
|
|
|
|
int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len, void *_priv);
|
2013-12-06 15:59:10 +00:00
|
|
|
|
|
|
|
/* TRAU frame transcoding */
|
|
|
|
struct msgb *trau_decode_fr(uint32_t callref,
|
|
|
|
const struct decoded_trau_frame *tf);
|
|
|
|
struct msgb *trau_decode_efr(uint32_t callref,
|
|
|
|
const struct decoded_trau_frame *tf);
|
|
|
|
void trau_encode_fr(struct decoded_trau_frame *tf,
|
|
|
|
const unsigned char *data);
|
|
|
|
void trau_encode_efr(struct decoded_trau_frame *tf,
|
|
|
|
const unsigned char *data);
|