There is a device made for such a aplication. It is called FXO to TXS conveter, and works exactly likr you describe it.
The cost is bellow $50.00, and it is sold on e-bay almost daily.
Make a search for FXO to FXS converter.
Also, they mention ATA 186 on the ad.
You should not have trouble finfing it on e-bay.
Here is one item number::
Item number: 3042976655