mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
At the moment the MGCP request handling and message parsing is not clearly separated. The function mgcp_parse_header() in mgcp_msg.c is also responsible for resolving an endpoint. This leads to unclear layer separation. We eventually end up in a situation where we can not execute any request handler without beeing able to resolve an endpoint, however this is necessary if we want to implement wildcarded DLCX resquests. In the current situation a wildcarded DLCX is not possible to implement as we always have to resolve a an to get to the trunk which we need to iterate. However, we just can't resolve a free endpoint in a situation where all endpoints on te trunk are in use. We have to refactor the request handler so that the parsing in mgcp_msg only extracts us the endpoint name. The resolving is then done in mgcp_handle_message() in mgcp_protocol.c. Then we are able to decide what to do if we are unable to resolve an endpoint but still be able to resolve the trunk. This patch does not change the behaviour of osmo-mgw yet, but it lays the foundation for request handler implementations that can still perform useful actions if no endpoint but a trunk has been resolved. A wilcarded DLCX is such a case. It does not need an endpoint, just the trunk. Change-Id: I9f519d8a0ee8a513fa1e74acf3ee7dbc0991cdde Related: SYS#5535
29 lines
685 B
C
29 lines
685 B
C
#pragma once
|
|
|
|
/* Internal structure while parsing a request */
|
|
struct mgcp_parse_data {
|
|
struct mgcp_config *cfg;
|
|
char *epname;
|
|
char *trans;
|
|
char *save;
|
|
};
|
|
|
|
/* Local connection options */
|
|
struct mgcp_lco {
|
|
char *string;
|
|
char *codec;
|
|
int pkt_period_min; /* time in ms */
|
|
int pkt_period_max; /* time in ms */
|
|
};
|
|
|
|
char *get_lco_identifier(const char *options);
|
|
int check_local_cx_options(void *ctx, const char *options);
|
|
|
|
struct mgcp_rtp_end;
|
|
struct mgcp_endpoint;
|
|
void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
|
|
struct mgcp_rtp_end *rtp);
|
|
|
|
uint32_t mgcp_rtp_packet_duration(const struct mgcp_endpoint *endp,
|
|
const struct mgcp_rtp_end *rtp);
|