AC Milan have signed Parma defender Cristian Zaccardo with Djamel Mesbah going the other way as part of a swap deal.