Thomas Edison was an early proponent of "hello" being used to answer telephones, but the man who invented the phone, Alexander Graham Bell, preferred the use of "ahoy" as a receptive greeting. Though Bell favored "ahoy," "hello" was the first widely used greeting for answering a telephone, meaning that technically, nothing was said before "hello" became the telephone greeting.
The first telephone operating manuals included the use of the word "hello" as the proper greeting when picking up a telephone. "What is wanted?" was another early option, though not as widely used or suggested, but "hello" ended up winning out in the long run.