Thailand and Cambodia have agreed to an immediate ceasefire. It aims to end fighting along the border between the two countries sparked by competing territorial claims.