From f1a168dc2086bca48d920c45171cb6cbff9211fa Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 5 Aug 2010 03:22:24 +0800 Subject: mgcp: Only use early bind for the BTS socket. Simplify the code by onlt allowing one way to allocate a socket. --- openbsc/src/mgcp/mgcp_protocol.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'openbsc/src/mgcp/mgcp_protocol.c') diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c index 9bb315a49..8b990221a 100644 --- a/openbsc/src/mgcp/mgcp_protocol.c +++ b/openbsc/src/mgcp/mgcp_protocol.c @@ -428,11 +428,8 @@ static struct msgb *handle_create_con(struct mgcp_config *cfg, struct msgb *msg) /* bind to the port now */ port = rtp_calculate_port(ENDPOINT_NUMBER(endp), cfg->rtp_base_port); - if (cfg->early_bind) { - endp->bts_end.local_port = port; - endp->net_end.local_port = port; - } else if (mgcp_bind_rtp_port(endp, port) != 0) - goto error2; + endp->bts_end.local_port = port; + endp->net_end.local_port = port; /* assign a local call identifier or fail */ endp->ci = generate_call_id(cfg); @@ -760,11 +757,6 @@ void mgcp_free_endp(struct mgcp_endpoint *endp) endp->local_options = NULL; } - if (!endp->cfg->early_bind) { - bsc_unregister_fd(&endp->local_rtp); - bsc_unregister_fd(&endp->local_rtcp); - } - mgcp_rtp_end_reset(&endp->bts_end); mgcp_rtp_end_reset(&endp->net_end); -- cgit v1.2.3