blob: ac3283c754f11ebb326406f37f686ae5ff4f7a00 [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
34 /* RTP endpoint number. This number identifies the endpoint
35 * on the MGW on which the RAN and CN connection is created. This
36 * endpoint number is assigned and released automatically. */
37 uint16_t rtp_endpoint;
38
39 /* Set to true, when the context information is no longer needed */
40 bool free_ctx;
41
42 /* RTP connection identifiers */
43 char conn_id_ran[MGCP_CONN_ID_LENGTH];
44 char conn_id_cn[MGCP_CONN_ID_LENGTH];
45
46 /* Copy of the pointer and the data with context information
47 * needed to process the AoIP and MGCP requests (system data) */
48 struct mgcp_client *mgcp;
49 struct gsm_trans *trans;
50 mgcp_trans_id_t mgw_pending_trans;
51};
52
53int msc_mgcp_call_assignment(struct gsm_trans *trans);
54int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr);
55int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr);
56int msc_mgcp_call_release(struct gsm_trans *trans);