While it wasn’t a general greeting, “halloo” was already used as a verb meaning “to call for a hunting” in the 14th century.
also as an exclamation of surprise, like “halloo, what’s this?”
“hello” is still occasionally used in this sense today.
found the german
idk if you’re joking but not German; it was indeed halloo or holloo in English before hello became standard
“halloo, what’s this?”
“haaaallooooo” is used a lot by Germans as a slow exclamation to mean “hey idiot, what are you doing?”
It’s used this way in American English sometimes, as in a teen issuing a counterpoint “HellOOOOoooo”
Apparently “ahoy” was a common greeting before the telephone was invented, to the point that Alexander Graham Bell suggested it for use when answering the phone.
Ahoy was common enough that the Simpsons had their oldest phone user answer with "Ahoy hoy?"
I think that gag was referencing Graham Bell’s suggestion.