blob: 436e39ae955c654893cad7c115d521a29163560a [file] [log] [blame]
Philipp Maierc66ab2c2020-06-02 20:55:34 +02001#pragma once
2
3struct mgcp_trunk {
4 struct llist_head entry;
5
6 struct mgcp_config *cfg;
7
8 int trunk_nr;
9 int trunk_type;
10
11 char *audio_fmtp_extra;
12 char *audio_name;
13 int audio_payload;
14 int audio_send_ptime;
15 int audio_send_name;
16 int audio_loop;
17
18 int no_audio_transcoding;
19
20 int omit_rtcp;
21 int keepalive_interval;
22
23 /* RTP patching */
24 int force_constant_ssrc; /* 0: don't, 1: once */
25 int force_aligned_timing;
26 bool rfc5993_hr_convert;
27
28 /* spec handling */
29 int force_realloc;
30
31 /* timer */
32 struct osmo_timer_list keepalive_timer;
33
34 /* When set, incoming RTP packets are not filtered
35 * when ports and ip-address do not match (debug) */
36 int rtp_accept_all;
37
38 unsigned int number_endpoints;
39 unsigned int vty_number_endpoints;
40 struct mgcp_endpoint **endpoints;
41
42 /* global rate counters to measure the trunks overall performance and health */
43 struct mgcp_ratectr_trunk ratectr;
44};
45
46struct mgcp_trunk *mgcp_trunk_alloc(struct mgcp_config *cfg, enum mgcp_trunk_type ttype, int nr);
47int mgcp_trunk_alloc_endpts(struct mgcp_trunk *tcfg);
48struct mgcp_trunk *mgcp_trunk_by_num(const struct mgcp_config *cfg, int index);
49struct mgcp_trunk *mgcp_trunk_by_name(const struct mgcp_config *cfg, const char *epname);