Philipp Maier | 39c609b | 2017-09-27 15:51:34 +0200 | [diff] [blame] | 1 | /* (C) 2017 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> |
| 2 | * All Rights Reserved |
| 3 | * |
| 4 | * Author: Philipp Maier |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 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 |
| 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 |
| 14 | * GNU Affero General Public License for more details. |
| 15 | * |
| 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/>. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #pragma once |
| 22 | |
Philipp Maier | fa85d18 | 2017-11-22 13:26:03 +0100 | [diff] [blame] | 23 | #include <osmocom/mgcp_client/mgcp_common.h> |
| 24 | |
Philipp Maier | 66d2ef8 | 2017-12-13 11:01:06 +0100 | [diff] [blame^] | 25 | /* MGCP state handler context. This context information stores all information |
| 26 | * to handle the direction of the RTP streams via MGCP. There is one instance |
| 27 | * of this context struct per subscriber connection. |
| 28 | * (see also struct osmo_bsc_sccp_con) */ |
Philipp Maier | 39c609b | 2017-09-27 15:51:34 +0200 | [diff] [blame] | 29 | struct mgcp_ctx { |
| 30 | /* FSM instance, which handles the connection switching procedure */ |
| 31 | struct osmo_fsm_inst *fsm; |
| 32 | |
Philipp Maier | 66d2ef8 | 2017-12-13 11:01:06 +0100 | [diff] [blame^] | 33 | /* RTP endpoint number. This number number identifies the endpoint |
| 34 | * on the MGW on which the BTS and NET connection is created. This |
| 35 | * endpoint number is assigned and released automatically. */ |
Philipp Maier | 39c609b | 2017-09-27 15:51:34 +0200 | [diff] [blame] | 36 | uint16_t rtp_endpoint; |
| 37 | |
Philipp Maier | fa85d18 | 2017-11-22 13:26:03 +0100 | [diff] [blame] | 38 | /* RTP connection identifiers */ |
| 39 | char conn_id_bts[MGCP_CONN_ID_LENGTH]; |
| 40 | char conn_id_net[MGCP_CONN_ID_LENGTH]; |
| 41 | |
Philipp Maier | 39c609b | 2017-09-27 15:51:34 +0200 | [diff] [blame] | 42 | /* Copy of the pointer and the data with context information |
| 43 | * needed to process the AoIP and MGCP requests (system data) */ |
| 44 | struct mgcp_client *mgcp; |
Philipp Maier | 39c609b | 2017-09-27 15:51:34 +0200 | [diff] [blame] | 45 | struct osmo_bsc_sccp_con *conn; |
| 46 | enum gsm48_chan_mode chan_mode; |
| 47 | bool full_rate; |
| 48 | struct gsm_lchan *lchan; |
| 49 | struct gsm_lchan *ho_lchan; |
| 50 | struct msgb *resp; |
| 51 | }; |
| 52 | |
| 53 | struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, |
| 54 | enum gsm48_chan_mode chan_mode, bool full_rate); |
| 55 | void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); |
| 56 | void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); |
| 57 | void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan); |
| 58 | void mgcp_free_ctx(struct mgcp_ctx *mgcp_ctx); |