aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-02 19:06:13 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-02 19:06:13 +0100
commite97155a2af793aa709f897e8766cccd20e86964c (patch)
tree11a710ac1ea1619ae5494431c0763f467d6f05d9
parent21262335907f2aa621742e87d596e4278b0f3d86 (diff)
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.
-rw-r--r--openbsc/src/mgcp/mgcp_protocol.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 435ceeee2..ddcbfafcb 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -382,7 +382,6 @@ static int allocate_port(struct mgcp_endpoint *endp, struct mgcp_rtp_end *end,
int i;
if (range->mode == PORT_ALLOC_STATIC) {
- end->local_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), range->base_port);
end->local_alloc = PORT_ALLOC_STATIC;
return 0;
}
@@ -795,12 +794,14 @@ struct mgcp_config *mgcp_config_alloc(void)
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);
+ end->local_port = 0;
+ }
end->packets = 0;
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->local_alloc = -1;
}