blob: 7d061783eb2e5abced33ad372ed18b5ab28a773b [file] [log] [blame]
Philipp Maier8bda7a72018-01-17 14:32:23 +01001#pragma once
2
3#include <osmocom/mgcp_client/mgcp_common.h>
4#include <osmocom/mgcp_client/mgcp_client.h>
5#include <osmocom/gsm/protocol/gsm_04_08.h>
6
7/*! This struct organizes the connection infromation one connection side
8 * (either remote or local). It is used to pass parameters (local) to the FSM
9 * and get responses (remote) from the FSM as pointer attached to the FSM
10 * event.
11 *
12 * When modifiying a connection, the endpoint and call_id members may be left
13 * unpopulated. The call_id field is ignored in this case. If an endpoint
14 * identifier is supplied it is checked against the internal state to make
15 * sure it is correct. */
16struct mgcp_conn_peer {
17 /*!< RTP connection IP-Address (optional, string e.g. "127.0.0.1") */
18 char addr[INET_ADDRSTRLEN];
19
20 /*!< RTP connection IP-Port (optional) */
21 uint16_t port;
22
23 /*!< RTP endpoint */
24 char endpoint[MGCP_ENDPOINT_MAXLEN];
25
26 /*!< CALL ID (unique per connection) */
27 unsigned int call_id;
28};
29
30struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt,
31 uint32_t parent_evt, struct mgcp_conn_peer *conn_peer);
32int mgcp_conn_modify(struct osmo_fsm_inst *fi, uint32_t parent_evt, struct mgcp_conn_peer *conn_peer);
33void mgcp_conn_delete(struct osmo_fsm_inst *fi);