Hi,
The problem is fixed on fop 2.21. You can patch your current checkdir.php and replace this line:
$res = $db->consulta("SELECT concat(firstname,' ',lastname) as name,company,picture FROM visual_phonebook WHERE phone1 LIKE '%%%s'OR phone2 LIKE '%%%s' LIMIT 1",$clid_significant,$clid_significant);
with:
$res = $db->consulta("SELECT concat(firstname,' ',lastname) AS name,company,picture FROM visual_phonebook WHERE phone1 LIKE '%%%s'OR phone2 LIKE '%%%s' ORDER BY LENGTH(CONCAT(phone1,phone2)) LIMIT 1",$clid_significant,$clid_significant);