U.S. President Barack Obama and Philippine President Rodrigo Duterte shook hands and had a brief chat on Wednesday, officials said.