Turkey and Armenia have agreed to establish diplomatic relations in order to reopen border crossings that have been closed since 1993.