Philipp Maier | 621ba03 | 2017-11-07 17:19:25 +0100 | [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 | |
| 23 | #include <osmocom/mgcp_client/mgcp_client.h> |
| 24 | #include <osmocom/msc/gsm_data.h> |
| 25 | |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 26 | struct ran_conn; |
| 27 | |
Philipp Maier | 621ba03 | 2017-11-07 17:19:25 +0100 | [diff] [blame] | 28 | /* MGCP state handler context. This context information stores all information |
| 29 | * to handle the direction of the RTP streams via MGCP. There is one instance |
Neels Hofmeyr | c036b79 | 2018-11-29 22:37:51 +0100 | [diff] [blame] | 30 | * of this context struct per RAN connection. |
| 31 | * (see also struct ran_conn) */ |
Philipp Maier | 621ba03 | 2017-11-07 17:19:25 +0100 | [diff] [blame] | 32 | struct mgcp_ctx { |
| 33 | /* FSM instance, which handles the connection switching procedure */ |
| 34 | struct osmo_fsm_inst *fsm; |
| 35 | |
Philipp Maier | a2353c6 | 2018-02-08 14:15:59 +0100 | [diff] [blame] | 36 | /* RTP endpoint string. This string identifies the endpoint |
Philipp Maier | 621ba03 | 2017-11-07 17:19:25 +0100 | [diff] [blame] | 37 | * on the MGW on which the RAN and CN connection is created. This |
Philipp Maier | a2353c6 | 2018-02-08 14:15:59 +0100 | [diff] [blame] | 38 | * endpoint number is assigned by the MGW. */ |
| 39 | char rtp_endpoint[MGCP_ENDPOINT_MAXLEN]; |
| 40 | |
| 41 | /* Call id of the current call. Will be derived from the callref |
| 42 | * of the transaction that is valid during the first CRCX. (The |
| 43 | * callref may change throughout the call) */ |
| 44 | unsigned int call_id; |
Philipp Maier | 621ba03 | 2017-11-07 17:19:25 +0100 | [diff] [blame] | 45 | |
| 46 | /* Set to true, when the context information is no longer needed */ |
| 47 | bool free_ctx; |
| 48 | |
| 49 | /* RTP connection identifiers */ |
| 50 | char conn_id_ran[MGCP_CONN_ID_LENGTH]; |
| 51 | char conn_id_cn[MGCP_CONN_ID_LENGTH]; |
| 52 | |
| 53 | /* Copy of the pointer and the data with context information |
| 54 | * needed to process the AoIP and MGCP requests (system data) */ |
| 55 | struct mgcp_client *mgcp; |
| 56 | struct gsm_trans *trans; |
| 57 | mgcp_trans_id_t mgw_pending_trans; |
| 58 | }; |
| 59 | |
Neels Hofmeyr | b16259f | 2018-12-20 02:57:56 +0100 | [diff] [blame] | 60 | int msc_mgcp_try_call_assignment(struct gsm_trans *trans); |
Philipp Maier | 621ba03 | 2017-11-07 17:19:25 +0100 | [diff] [blame] | 61 | int msc_mgcp_call_assignment(struct gsm_trans *trans); |
Neels Hofmeyr | 85cb253 | 2018-12-11 18:59:27 +0100 | [diff] [blame] | 62 | int msc_mgcp_ass_complete(struct ran_conn *conn, uint16_t port, char *addr); |
Neels Hofmeyr | f383d41 | 2018-12-19 17:05:13 +0100 | [diff] [blame] | 63 | int msc_mgcp_ass_fail(struct ran_conn *conn); |
Philipp Maier | 621ba03 | 2017-11-07 17:19:25 +0100 | [diff] [blame] | 64 | int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr); |
| 65 | int msc_mgcp_call_release(struct gsm_trans *trans); |