mgcp: Attempt to separate the RTP/RTCP port for the Network and for the BTS

We plan to have two different ports for the network and for the
BTS to avoid detecting the BTS and to dynamically allocate the
port to have old data not go to a new socket.
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index 8ffc266..88a331c 100644
--- a/openbsc/src/mgcp/mgcp_network.c
+++ b/openbsc/src/mgcp/mgcp_network.c
@@ -290,15 +290,15 @@
 {
 	struct mgcp_config *cfg = endp->cfg;
 
-	if (create_bind(cfg->source_addr, &endp->local_rtp, endp->rtp_port) != 0) {
+	if (create_bind(cfg->source_addr, &endp->local_rtp, endp->bts_end.local_port) != 0) {
 		LOGP(DMGCP, LOGL_ERROR, "Failed to create RTP port: %s:%d on 0x%x\n",
-		       cfg->source_addr, endp->rtp_port, ENDPOINT_NUMBER(endp));
+		       cfg->source_addr, endp->bts_end.local_port, ENDPOINT_NUMBER(endp));
 		goto cleanup0;
 	}
 
-	if (create_bind(cfg->source_addr, &endp->local_rtcp, endp->rtp_port + 1) != 0) {
+	if (create_bind(cfg->source_addr, &endp->local_rtcp, endp->bts_end.local_port + 1) != 0) {
 		LOGP(DMGCP, LOGL_ERROR, "Failed to create RTCP port: %s:%d on 0x%x\n",
-		       cfg->source_addr, endp->rtp_port + 1, ENDPOINT_NUMBER(endp));
+		       cfg->source_addr, endp->bts_end.local_port + 1, ENDPOINT_NUMBER(endp));
 		goto cleanup1;
 	}
 
@@ -310,7 +310,7 @@
 	endp->local_rtp.when = BSC_FD_READ;
 	if (bsc_register_fd(&endp->local_rtp) != 0) {
 		LOGP(DMGCP, LOGL_ERROR, "Failed to register RTP port %d on 0x%x\n",
-			endp->rtp_port, ENDPOINT_NUMBER(endp));
+			endp->bts_end.local_port, ENDPOINT_NUMBER(endp));
 		goto cleanup2;
 	}
 
@@ -319,7 +319,7 @@
 	endp->local_rtcp.when = BSC_FD_READ;
 	if (bsc_register_fd(&endp->local_rtcp) != 0) {
 		LOGP(DMGCP, LOGL_ERROR, "Failed to register RTCP port %d on 0x%x\n",
-			endp->rtp_port + 1, ENDPOINT_NUMBER(endp));
+			endp->bts_end.local_port + 1, ENDPOINT_NUMBER(endp));
 		goto cleanup3;
 	}
 
@@ -339,6 +339,7 @@
 
 int mgcp_bind_rtp_port(struct mgcp_endpoint *endp, int rtp_port)
 {
-	endp->rtp_port = rtp_port;
+	endp->bts_end.local_port = rtp_port;
+	endp->net_end.local_port = rtp_port;
 	return bind_rtp(endp);
 }