Ringing old phones from amplified audio - Amplification issues

Thank you all for your advice and references! I found the easiest way through it in this article: Generating rings | Details | Hackaday.io

I gave up the audio signal amplification and moved to creating a square wave with a L298N. The Arduino sends a constant DC voltage to either driver’s output, which becomes an AC square wave that I can amplify with the transformer (9VAC-220VAC). With 5V input voltage, I get 60VAC at output, which is more than enough to trigger the ring of the 3 phones.

I will explore a bit how lower can I get this voltage by reducing the voltage I send to the driver’s enable pin. But I guess that’s the right way forward. It’s still quite a high voltage, even when the current of my power supply is lower than 1A. So it should be handled with caution.

This is the code I am using to generate the square wave with the L298N, in case it’s useful to somebody else in the future:

const int ENA = 5;  // PWM capable pin
const int IN1 = 2;
const int IN2 = 3;

const unsigned long halfPeriodMs = 25;  // 25ms -> 20 Hz

void setup() {
pinMode(ENA, OUTPUT); 
pinMode(IN1, OUTPUT); 
pinMode(IN2, OUTPUT); 
digitalWrite(ENA, HIGH);  // or analogWrite(ENA, 200) to limit amplitude 
}  

void square() { 
// Forward 
digitalWrite(IN1, HIGH); 
digitalWrite(IN2, LOW); 
delay(halfPeriodMs);  

// Reverse 
digitalWrite(IN1, LOW); 
digitalWrite(IN2, HIGH); 
delay(halfPeriodMs); 
}  

void loop() { 
square(); 
}