mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
There is considerable code complexity in place for this ancient hack.
It dates back to 5ea1bc77a3
"
mgcp: Allow to freely control the a=fmtp line for experiments
In case of AMR one can specify the available codecs out-of-band. Allow
to configure this line statically in the configuration file.
"
Looking in mgcp_test.c output, the fmtp-extra tests do not even make
sense: they result in fmtp for pt=126 being added, even though there is
no payload type 126 listed in the SDP...
Related: OS#6313
Change-Id: Icee0cd1f5a751fa760d5a9deca29089e78e7eb93
86 lines
2.4 KiB
C
86 lines
2.4 KiB
C
#pragma once
|
|
|
|
#include <osmocom/gsm/i460_mux.h>
|
|
#include <osmocom/abis/e1_input.h>
|
|
#include <osmocom/mgcp/mgcp_ratectr.h>
|
|
|
|
|
|
#define LOGPTRUNK(trunk, cat, level, fmt, args...) \
|
|
LOGP(cat, level, "trunk:%u " fmt, \
|
|
trunk ? trunk->trunk_nr : 0, \
|
|
## args)
|
|
|
|
enum mgcp_trunk_type {
|
|
MGCP_TRUNK_VIRTUAL,
|
|
MGCP_TRUNK_E1,
|
|
};
|
|
|
|
extern const struct value_string mgcp_trunk_type_strs[];
|
|
static inline const char *mgcp_trunk_type_strs_str(enum mgcp_trunk_type val)
|
|
{ return get_value_string(mgcp_trunk_type_strs, val); }
|
|
|
|
struct mgcp_trunk {
|
|
struct llist_head entry;
|
|
|
|
struct mgcp_config *cfg;
|
|
|
|
unsigned int trunk_nr;
|
|
enum mgcp_trunk_type trunk_type;
|
|
|
|
int audio_send_ptime;
|
|
int audio_send_name;
|
|
|
|
int omit_rtcp;
|
|
int keepalive_interval;
|
|
|
|
/* RTP patching */
|
|
int force_constant_ssrc; /* 0: don't, 1: once */
|
|
int force_aligned_timing;
|
|
bool rfc5993_hr_convert;
|
|
|
|
/* spec handling */
|
|
int force_realloc;
|
|
|
|
/* timer */
|
|
struct osmo_timer_list keepalive_timer;
|
|
|
|
/* When set, incoming RTP packets are not filtered
|
|
* when ports and ip-address do not match (debug) */
|
|
int rtp_accept_all;
|
|
|
|
unsigned int number_endpoints;
|
|
struct mgcp_endpoint **endpoints;
|
|
|
|
/* rate counters and stat items to measure the trunks overall performance and health */
|
|
struct mgcp_ratectr_trunk ratectr;
|
|
struct mgcp_stat_trunk stats;
|
|
|
|
union {
|
|
/* Virtual trunk specific */
|
|
struct {
|
|
unsigned int vty_number_endpoints;
|
|
} v;
|
|
/* E1 specific */
|
|
struct {
|
|
unsigned int vty_line_nr;
|
|
uint8_t ts_usecount[NUM_E1_TS-1];
|
|
struct osmo_i460_timeslot i460_ts[NUM_E1_TS-1];
|
|
/* Note: on an E1 line TS 0 is devoted to framing and
|
|
* alignment and therefore only NUM_E1_TS-1 timeslots
|
|
* are available for traffic. */
|
|
} e1;
|
|
};
|
|
};
|
|
|
|
struct mgcp_trunk *mgcp_trunk_alloc(struct mgcp_config *cfg, enum mgcp_trunk_type ttype, unsigned int nr);
|
|
int mgcp_trunk_equip(struct mgcp_trunk *trunk);
|
|
struct mgcp_trunk *mgcp_trunk_by_num(const struct mgcp_config *cfg, enum mgcp_trunk_type ttype, unsigned int nr);
|
|
struct mgcp_trunk *mgcp_trunk_by_name(const struct mgcp_config *cfg, const char *epname);
|
|
int e1_trunk_nr_from_epname(unsigned int *trunk_nr, const char *epname);
|
|
struct mgcp_trunk *mgcp_trunk_by_line_num(const struct mgcp_config *cfg, unsigned int num);
|
|
|
|
/* The virtual trunk is always created on trunk id 0 for historical reasons,
|
|
* use this define constant as ID when allocating a virtual trunk. Other
|
|
* trunks may be assigned with arbritrary id numbers */
|
|
#define MGCP_VIRT_TRUNK_ID 0
|