Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 1 | /* 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 Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 7 | * 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 Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 9 | * (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 Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 14 | * GNU Affero General Public License for more details. |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 15 | * |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 16 | * 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 Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 18 | * |
| 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 Welte | f142c97 | 2011-05-24 13:25:38 +0200 | [diff] [blame^] | 31 | #include <stdint.h> |
| 32 | #include <openbsc/gsm_data.h> |
| 33 | #include <openbsc/mncc.h> |
| 34 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 35 | /* map a TRAU mux map entry */ |
| 36 | int trau_mux_map(const struct gsm_e1_subslot *src, |
| 37 | const struct gsm_e1_subslot *dst); |
Harald Welte | 26aa6a1 | 2009-02-19 15:14:23 +0000 | [diff] [blame] | 38 | int trau_mux_map_lchan(const struct gsm_lchan *src, |
| 39 | const struct gsm_lchan *dst); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 40 | |
| 41 | /* unmap a TRAU mux map entry */ |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 42 | int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 43 | |
| 44 | /* we get called by subchan_demux */ |
| 45 | int trau_mux_input(struct gsm_e1_subslot *src_e1_ss, |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 46 | const uint8_t *trau_bits, int num_bits); |
Harald Welte | 45b407a | 2009-05-23 15:51:12 +0000 | [diff] [blame] | 47 | |
| 48 | /* add a trau receiver */ |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 49 | int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref); |
Harald Welte | 45b407a | 2009-05-23 15:51:12 +0000 | [diff] [blame] | 50 | |
| 51 | /* send trau from application */ |
Harald Welte | da7ab74 | 2009-12-19 22:23:05 +0100 | [diff] [blame] | 52 | int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame); |