China and the Philippines have agreed to set up hotlines to de-escalate tensions in the South China Sea.