Philipp Maier | c66ab2c | 2020-06-02 20:55:34 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Philipp Maier | bea5678 | 2020-07-01 23:18:58 +0200 | [diff] [blame] | 3 | enum mgcp_trunk_type { |
| 4 | MGCP_TRUNK_VIRTUAL, |
| 5 | MGCP_TRUNK_E1, |
| 6 | }; |
| 7 | |
Philipp Maier | c66ab2c | 2020-06-02 20:55:34 +0200 | [diff] [blame] | 8 | struct mgcp_trunk { |
| 9 | struct llist_head entry; |
| 10 | |
| 11 | struct mgcp_config *cfg; |
| 12 | |
| 13 | int trunk_nr; |
Philipp Maier | 04bbb9d | 2020-07-02 21:21:26 +0200 | [diff] [blame] | 14 | enum mgcp_trunk_type trunk_type; |
Philipp Maier | c66ab2c | 2020-06-02 20:55:34 +0200 | [diff] [blame] | 15 | |
| 16 | char *audio_fmtp_extra; |
Philipp Maier | c66ab2c | 2020-06-02 20:55:34 +0200 | [diff] [blame] | 17 | int audio_send_ptime; |
| 18 | int audio_send_name; |
| 19 | int audio_loop; |
| 20 | |
| 21 | int no_audio_transcoding; |
| 22 | |
| 23 | int omit_rtcp; |
| 24 | int keepalive_interval; |
| 25 | |
| 26 | /* RTP patching */ |
| 27 | int force_constant_ssrc; /* 0: don't, 1: once */ |
| 28 | int force_aligned_timing; |
| 29 | bool rfc5993_hr_convert; |
| 30 | |
| 31 | /* spec handling */ |
| 32 | int force_realloc; |
| 33 | |
| 34 | /* timer */ |
| 35 | struct osmo_timer_list keepalive_timer; |
| 36 | |
| 37 | /* When set, incoming RTP packets are not filtered |
| 38 | * when ports and ip-address do not match (debug) */ |
| 39 | int rtp_accept_all; |
| 40 | |
| 41 | unsigned int number_endpoints; |
| 42 | unsigned int vty_number_endpoints; |
| 43 | struct mgcp_endpoint **endpoints; |
| 44 | |
| 45 | /* global rate counters to measure the trunks overall performance and health */ |
| 46 | struct mgcp_ratectr_trunk ratectr; |
| 47 | }; |
| 48 | |
| 49 | struct mgcp_trunk *mgcp_trunk_alloc(struct mgcp_config *cfg, enum mgcp_trunk_type ttype, int nr); |
| 50 | int mgcp_trunk_alloc_endpts(struct mgcp_trunk *tcfg); |
Philipp Maier | 6fbbeec | 2020-07-01 23:00:54 +0200 | [diff] [blame] | 51 | struct mgcp_trunk *mgcp_trunk_by_num(const struct mgcp_config *cfg, enum mgcp_trunk_type ttype, int nr); |
Philipp Maier | c66ab2c | 2020-06-02 20:55:34 +0200 | [diff] [blame] | 52 | struct mgcp_trunk *mgcp_trunk_by_name(const struct mgcp_config *cfg, const char *epname); |
Philipp Maier | 7e9ddc9 | 2020-06-10 15:22:32 +0200 | [diff] [blame] | 53 | int e1_trunk_nr_from_epname(const char *epname); |
Philipp Maier | d19de2e | 2020-06-03 13:55:33 +0200 | [diff] [blame] | 54 | |
| 55 | /* The virtual trunk is always created on trunk id 0 for historical reasons, |
| 56 | * use this define constant as ID when allocating a virtual trunk. Other |
| 57 | * trunks may be assigned with arbritrary id numbers */ |
| 58 | #define MGCP_VIRT_TRUNK_ID 0 |