mgcp: Only use early bind for the BTS socket.

Simplify the code by onlt allowing one way to allocate
a socket.
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index d1da401..81741ac 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -91,7 +91,6 @@
 	char *audio_name;
 	int audio_payload;
 	int audio_loop;
-	int early_bind;
 	int rtp_base_port;
 	int endp_dscp;
 
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 9bb315a..8b99022 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -428,11 +428,8 @@
 
 	/* 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 @@
 		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);
 
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index c109491..ffb94d9 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -56,7 +56,6 @@
 		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 @@
       "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 @@
 	}
 
 	/* 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;
+	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;
-			}
+		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;
 		}
 	}