mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-03 13:33:29 +00:00
mgcp: Keep the local_port like it was set on allocation
Do not reset statically allocated local_port. The port might be different to the calculation of endpoint number and base port. This might be the case for the coming remote transcoding.
This commit is contained in:
@@ -382,7 +382,6 @@ static int allocate_port(struct mgcp_endpoint *endp, struct mgcp_rtp_end *end,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (range->mode == PORT_ALLOC_STATIC) {
|
if (range->mode == PORT_ALLOC_STATIC) {
|
||||||
end->local_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), range->base_port);
|
|
||||||
end->local_alloc = PORT_ALLOC_STATIC;
|
end->local_alloc = PORT_ALLOC_STATIC;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -795,12 +794,14 @@ struct mgcp_config *mgcp_config_alloc(void)
|
|||||||
|
|
||||||
static void mgcp_rtp_end_reset(struct mgcp_rtp_end *end)
|
static void mgcp_rtp_end_reset(struct mgcp_rtp_end *end)
|
||||||
{
|
{
|
||||||
if (end->local_alloc == PORT_ALLOC_DYNAMIC)
|
if (end->local_alloc == PORT_ALLOC_DYNAMIC) {
|
||||||
mgcp_free_rtp_port(end);
|
mgcp_free_rtp_port(end);
|
||||||
|
end->local_port = 0;
|
||||||
|
}
|
||||||
|
|
||||||
end->packets = 0;
|
end->packets = 0;
|
||||||
memset(&end->addr, 0, sizeof(end->addr));
|
memset(&end->addr, 0, sizeof(end->addr));
|
||||||
end->rtp_port = end->rtcp_port = end->local_port = 0;
|
end->rtp_port = end->rtcp_port = 0;
|
||||||
end->payload_type = -1;
|
end->payload_type = -1;
|
||||||
end->local_alloc = -1;
|
end->local_alloc = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user