US president telephones Erdogan over terror attacks