blob: 3c4bc6273c4a7f69ff7938123bf0dcfb71a4c87e [file] [log] [blame]
Philipp Maier621ba032017-11-07 17:19:25 +01001/* (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
26/* MGCP state handler context. This context information stores all information
27 * to handle the direction of the RTP streams via MGCP. There is one instance
28 * of this context struct per subscriber connection.
29 * (see also struct gsm_subscriber_connection) */
30struct mgcp_ctx {
31 /* FSM instance, which handles the connection switching procedure */
32 struct osmo_fsm_inst *fsm;
33
Philipp Maiera2353c62018-02-08 14:15:59 +010034 /* RTP endpoint string. This string identifies the endpoint
Philipp Maier621ba032017-11-07 17:19:25 +010035 * on the MGW on which the RAN and CN connection is created. This
Philipp Maiera2353c62018-02-08 14:15:59 +010036 * endpoint number is assigned by the MGW. */
37 char rtp_endpoint[MGCP_ENDPOINT_MAXLEN];
38
39 /* Call id of the current call. Will be derived from the callref
40 * of the transaction that is valid during the first CRCX. (The
41 * callref may change throughout the call) */
42 unsigned int call_id;
Philipp Maier621ba032017-11-07 17:19:25 +010043
44 /* Set to true, when the context information is no longer needed */
45 bool free_ctx;
46
47 /* RTP connection identifiers */
48 char conn_id_ran[MGCP_CONN_ID_LENGTH];
49 char conn_id_cn[MGCP_CONN_ID_LENGTH];
50
51 /* Copy of the pointer and the data with context information
52 * needed to process the AoIP and MGCP requests (system data) */
53 struct mgcp_client *mgcp;
54 struct gsm_trans *trans;
55 mgcp_trans_id_t mgw_pending_trans;
56};
57
58int msc_mgcp_call_assignment(struct gsm_trans *trans);
59int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr);
60int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr);
61int msc_mgcp_call_release(struct gsm_trans *trans);