blob: 78d65e42772aadf774b830e16bce10cea04b9784 [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;
Philipp Maierc66ab2c2020-06-02 20:55:34 +020012 int audio_send_ptime;
13 int audio_send_name;
14 int audio_loop;
15
16 int no_audio_transcoding;
17
18 int omit_rtcp;
19 int keepalive_interval;
20
21 /* RTP patching */
22 int force_constant_ssrc; /* 0: don't, 1: once */
23 int force_aligned_timing;
24 bool rfc5993_hr_convert;
25
26 /* spec handling */
27 int force_realloc;
28
29 /* timer */
30 struct osmo_timer_list keepalive_timer;
31
32 /* When set, incoming RTP packets are not filtered
33 * when ports and ip-address do not match (debug) */
34 int rtp_accept_all;
35
36 unsigned int number_endpoints;
37 unsigned int vty_number_endpoints;
38 struct mgcp_endpoint **endpoints;
39
40 /* global rate counters to measure the trunks overall performance and health */
41 struct mgcp_ratectr_trunk ratectr;
42};
43
44struct mgcp_trunk *mgcp_trunk_alloc(struct mgcp_config *cfg, enum mgcp_trunk_type ttype, int nr);
45int mgcp_trunk_alloc_endpts(struct mgcp_trunk *tcfg);
46struct mgcp_trunk *mgcp_trunk_by_num(const struct mgcp_config *cfg, int index);
47struct mgcp_trunk *mgcp_trunk_by_name(const struct mgcp_config *cfg, const char *epname);
Philipp Maierd19de2e2020-06-03 13:55:33 +020048
49/* The virtual trunk is always created on trunk id 0 for historical reasons,
50 * use this define constant as ID when allocating a virtual trunk. Other
51 * trunks may be assigned with arbritrary id numbers */
52#define MGCP_VIRT_TRUNK_ID 0