but why is it "oba" ? my dictionary says that telephone is male
Yes, and so is "oba".
"oba" is used for neuter nouns (apart from 'dzieci') and masculine not-personal. Oba drzewa, oba telefony, oba psy.
"obaj" (Nominative)/"obu" (Accusative) is used for masculine personal. Obaj mężczyźni. Widzę obu mężczyzn.
The declension of oba is here: https://en.wiktionary.org/wiki/oba#Declension_2
What is wrong with: "I am buying both telephones." ???