blob: 9936ba18440c2c993538bf0cd4a556b13a50881a [file] [log] [blame]
Harald Welte1fa60c82009-02-09 18:13:26 +00001/* Simple TRAU frame reflector to route voice calls */
2
3/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
4 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
Harald Welte9af6ddf2011-01-01 15:25:50 +01007 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
Harald Welte1fa60c82009-02-09 18:13:26 +00009 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Harald Welte9af6ddf2011-01-01 15:25:50 +010014 * GNU Affero General Public License for more details.
Harald Welte1fa60c82009-02-09 18:13:26 +000015 *
Harald Welte9af6ddf2011-01-01 15:25:50 +010016 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Harald Welte1fa60c82009-02-09 18:13:26 +000018 *
19 */
20
21/* The "TRAU mux map" defines which particular 16kbit sub-slot (in which E1
22 * timeslot on which E1 interface) should be directly muxed to which other
23 * sub-slot. Entries in the mux map are always bi-directional.
24 *
25 * The idea of all this is to directly switch voice channels in the BSC
26 * from one phone to another. We do this right now since we don't support
27 * any external interface for voice channels, and in the future as an
28 * optimization to routing them externally.
29 */
30
Harald Weltef142c972011-05-24 13:25:38 +020031#include <stdint.h>
32#include <openbsc/gsm_data.h>
33#include <openbsc/mncc.h>
34
Harald Welte1fa60c82009-02-09 18:13:26 +000035/* map a TRAU mux map entry */
36int trau_mux_map(const struct gsm_e1_subslot *src,
37 const struct gsm_e1_subslot *dst);
Harald Welte26aa6a12009-02-19 15:14:23 +000038int trau_mux_map_lchan(const struct gsm_lchan *src,
39 const struct gsm_lchan *dst);
Harald Welte1fa60c82009-02-09 18:13:26 +000040
41/* unmap a TRAU mux map entry */
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020042int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref);
Harald Welte1fa60c82009-02-09 18:13:26 +000043
44/* we get called by subchan_demux */
45int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020046 const uint8_t *trau_bits, int num_bits);
Harald Welte45b407a2009-05-23 15:51:12 +000047
48/* add a trau receiver */
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020049int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref);
Harald Welte45b407a2009-05-23 15:51:12 +000050
51/* send trau from application */
Harald Welteda7ab742009-12-19 22:23:05 +010052int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame);