[mgcp] Do not forward or find the BTS if the endpoint is unused

Forget where the bts and network is located on DLCX and CRCX otherwise
we would have forwarded BTS data to the wrong endpoint and would have
not tried to discover the BTS again.

In the case of early bind we might get data from the BTS before
the CRCX and after DLCX... just ignore it then
diff --git a/openbsc/src/bsc_mgcp.c b/openbsc/src/bsc_mgcp.c
index 4ebf6c8..bb27d56 100644
--- a/openbsc/src/bsc_mgcp.c
+++ b/openbsc/src/bsc_mgcp.c
@@ -234,6 +234,10 @@
 		return -1;
 	}
 
+	/* do not forward aynthing... maybe there is a packet from the bts */
+	if (endp->ci == CI_UNUSED)
+		return -1;
+
 	/*
 	 * Figure out where to forward it to. This code assumes that we
 	 * have received the Connection Modify and know who is a legitimate
@@ -635,6 +639,8 @@
 	}
 	MSG_TOKENIZE_END
 
+	/* initialize */
+	endp->rtp = endp->rtcp = endp->bts_rtp = endp->bts_rtcp = 0;
 
 	/* bind to the port now */
 	endp->rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), rtp_base_port);
@@ -800,6 +806,8 @@
 		bsc_unregister_fd(&endp->local_rtcp);
 	}
 
+	endp->rtp = endp->rtcp = endp->bts_rtp = endp->bts_rtcp = 0;
+
 	return send_response(250, "DLCX", trans_id, source);
 
 error: