There are some small plastic boxes that are used on elevator phones, that do exactely waht you need.
They do not need power, they take voltage from the line.
I rememeber one brand “hotdialer”, do not know if it still around.
That was a very basic unit, with dip switches under the cover for programing.
Very nice ,since did not loose the programing (very hard to loose suitcase plugs)
Best luck to you.