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_vty.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'openbsc/src/mgcp/mgcp_vty.c') diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c index c109491b1..ffb94d934 100644 --- a/openbsc/src/mgcp/mgcp_vty.c +++ b/openbsc/src/mgcp/mgcp_vty.c @@ -56,7 +56,6 @@ static int config_write_mgcp(struct vty *vty) vty_out(vty, " bts ip %s%s", g_cfg->bts_ip, VTY_NEWLINE); vty_out(vty, " bind ip %s%s", g_cfg->source_addr, VTY_NEWLINE); vty_out(vty, " bind port %u%s", g_cfg->source_port, VTY_NEWLINE); - vty_out(vty, " bind early %u%s", !!g_cfg->early_bind, VTY_NEWLINE); vty_out(vty, " rtp base %u%s", g_cfg->rtp_base_port, VTY_NEWLINE); vty_out(vty, " rtp ip-dscp %d%s", g_cfg->endp_dscp, VTY_NEWLINE); if (g_cfg->audio_payload != -1) @@ -150,9 +149,8 @@ DEFUN(cfg_mgcp_bind_early, "bind early (0|1)", "Bind all RTP ports early") { - unsigned int bind = atoi(argv[0]); - g_cfg->early_bind = bind == 1; - return CMD_SUCCESS; + vty_out(vty, "bind early is deprecated, remove it from the config.\n"); + return CMD_WARNING; } DEFUN(cfg_mgcp_rtp_base_port, @@ -311,16 +309,14 @@ int mgcp_parse_config(const char *config_file, struct mgcp_config *cfg) } /* early bind */ - if (g_cfg->early_bind) { - for (i = 1; i < g_cfg->number_endpoints; ++i) { - struct mgcp_endpoint *endp = &g_cfg->endpoints[i]; - int rtp_port; - - rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), g_cfg->rtp_base_port); - if (mgcp_bind_rtp_port(endp, rtp_port) != 0) { - LOGP(DMGCP, LOGL_FATAL, "Failed to bind: %d\n", rtp_port); - return -1; - } + for (i = 1; i < g_cfg->number_endpoints; ++i) { + struct mgcp_endpoint *endp = &g_cfg->endpoints[i]; + int rtp_port; + + rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), g_cfg->rtp_base_port); + if (mgcp_bind_rtp_port(endp, rtp_port) != 0) { + LOGP(DMGCP, LOGL_FATAL, "Failed to bind: %d\n", rtp_port); + return -1; } } -- cgit v1.2.3