Philipp Maier | 8bda7a7 | 2018-01-17 14:32:23 +0100 | [diff] [blame] | 1 | #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. */ |
| 16 | struct mgcp_conn_peer { |
Neels Hofmeyr | 8838c62 | 2018-06-26 00:05:53 +0200 | [diff] [blame] | 17 | /*! RTP connection IP-Address (optional, string e.g. "127.0.0.1") */ |
Philipp Maier | 8bda7a7 | 2018-01-17 14:32:23 +0100 | [diff] [blame] | 18 | char addr[INET_ADDRSTRLEN]; |
| 19 | |
Neels Hofmeyr | 8838c62 | 2018-06-26 00:05:53 +0200 | [diff] [blame] | 20 | /*! RTP connection IP-Port (optional) */ |
Philipp Maier | 8bda7a7 | 2018-01-17 14:32:23 +0100 | [diff] [blame] | 21 | uint16_t port; |
| 22 | |
Neels Hofmeyr | 8838c62 | 2018-06-26 00:05:53 +0200 | [diff] [blame] | 23 | /*! RTP endpoint */ |
Philipp Maier | 8bda7a7 | 2018-01-17 14:32:23 +0100 | [diff] [blame] | 24 | char endpoint[MGCP_ENDPOINT_MAXLEN]; |
| 25 | |
Neels Hofmeyr | 8838c62 | 2018-06-26 00:05:53 +0200 | [diff] [blame] | 26 | /*! CALL ID (unique per connection) */ |
Philipp Maier | 8bda7a7 | 2018-01-17 14:32:23 +0100 | [diff] [blame] | 27 | unsigned int call_id; |
Philipp Maier | 704c4f0 | 2018-06-07 18:51:31 +0200 | [diff] [blame] | 28 | |
Neels Hofmeyr | 8838c62 | 2018-06-26 00:05:53 +0200 | [diff] [blame] | 29 | /*! RTP packetization interval (optional) */ |
Philipp Maier | 704c4f0 | 2018-06-07 18:51:31 +0200 | [diff] [blame] | 30 | unsigned int ptime; |
| 31 | |
Neels Hofmeyr | 8838c62 | 2018-06-26 00:05:53 +0200 | [diff] [blame] | 32 | /*! RTP codec list (optional) */ |
Philipp Maier | 704c4f0 | 2018-06-07 18:51:31 +0200 | [diff] [blame] | 33 | enum mgcp_codecs codecs[MGCP_MAX_CODECS]; |
| 34 | |
Neels Hofmeyr | 8838c62 | 2018-06-26 00:05:53 +0200 | [diff] [blame] | 35 | /*! Number of codecs in RTP codec list (optional) */ |
Philipp Maier | 704c4f0 | 2018-06-07 18:51:31 +0200 | [diff] [blame] | 36 | unsigned int codecs_len; |
Philipp Maier | 544448a | 2018-07-26 11:37:44 +0200 | [diff] [blame] | 37 | |
| 38 | /*! RTP payload type map (optional, only needed when payload types are |
| 39 | * used that differ from what IANA/3GPP defines) */ |
| 40 | struct ptmap ptmap[MGCP_MAX_CODECS]; |
| 41 | |
| 42 | /*! RTP payload type map length (optional, only needed when payload |
| 43 | * types are used that differ from what IANA/3GPP defines) */ |
| 44 | unsigned int ptmap_len; |
Neels Hofmeyr | e6d8e91 | 2018-08-23 16:36:48 +0200 | [diff] [blame] | 45 | |
| 46 | /*! If nonzero, send 'X-Osmo-IGN:' header. This is useful e.g. for SCCPlite MSCs where the MSC is |
| 47 | * known to issue incoherent or unknown CallIDs / to issue CRCX commands with a different domain |
| 48 | * name than the BSC. An OsmoMGW will then ignore these and not fail on mismatches. */ |
| 49 | uint32_t x_osmo_ign; |
Philipp Maier | 8bda7a7 | 2018-01-17 14:32:23 +0100 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt, |
| 53 | uint32_t parent_evt, struct mgcp_conn_peer *conn_peer); |
| 54 | int mgcp_conn_modify(struct osmo_fsm_inst *fi, uint32_t parent_evt, struct mgcp_conn_peer *conn_peer); |
| 55 | void mgcp_conn_delete(struct osmo_fsm_inst *fi); |
Neels Hofmeyr | 04da5e5 | 2018-06-12 21:51:23 +0200 | [diff] [blame] | 56 | |
| 57 | const char *mgcp_conn_get_ci(struct osmo_fsm_inst *fi); |