Depends on the speed of the modems, and whether or not they support error correction. Even more than that, it depends on the devices you're using, the "loss plan", the quality of the telephone interfaces (the hybrids) of the modems, how good their discriminator circuits are, the links between, the routers and latency and congestion on the network between the devices.
Generally speaking, many modems of 2400 and all modems faster support error correction. The "sweet spot" for a reliable modem connection over VOIP is between 2400-9600 with EC. 1200 and 2400 w/o EC are just about impossible, and 300 is problematic.
Before getting too deep into this, let me lay out a few facts:
A few basic facts about modems:
1) Different modems of different speeds and different "Modernness" use different types of modulation to carry the bits.
2) Almost all common types of modem modulations require constant contact, otherwise, "NO CARRIER" and you're disconnected.
3) The types of modems most of us are used to using are ASYNCHRONOUS in nature, meaning there is nothing providing a clock signal to keep both ends in sync with each other.
A few basic facts about the POTS network:
1) POTS is a circuit-switched networking technology, once the channel path is established, that channel is "nailed up" in constant contact with the far end for the duration of the call.
2) POTS links are either analog or digital in nature. Either way, they are still a direct (though buffered at many points along the way) channel from end to end.
3) Even in the case of a Time Division Multiplexed carrier trunk, such as T1 or T3, you effectively have a direct circuit path through the connection. The carrier itself is synchronous in nature, and while there is possibility of error, all timeslots' data arrives in the order expected.
A few basic facts about VOIP:
1) VOIP is packet-switched, with each packet containing a slice of audio
2) Being packet-switched, there is no continuous circuit, there is no synchronous clocking of the time slices.
3) Because the protocol used is UDP, there is no transmission control to ensure that all packets arrive, or even that they arrive in sequence.
4) Because of the nature of the internet, latency of transmission is not entirely predictable, and routing anomalies or other events on the internet can cause packets to arrive out of sequence, get dropped altogether, or have wildly fluctuating latencies.
So... knowing these things, and using 300 baud as an example, lets see what the demodulated bitstream of a quick burst of Bell 103 / 300 Baud Frequency Shift Keying would look like in binary form:
Code:
0000000000000000000000000000000000000000000001101010011101001011011001000000000000000000000000000
That's basically a pause, with a couple random characters in the middle.
On POTS, this comes through just as you see... but when VOIP acts up, that same sequence may look like:
Code:
000000 000000000000 0000000000000000000 101010010011110011011001000000000000000000000000000
This is a completely different series of bits, even though in this example what we sent was identical. We got a couple dropped packets (so quick it wasn't enough to drop carrier) and we received 2 packets out of sequence.
Now, to compound matters further, the latency delays and/or out-of-sequence packets may not fall directly in synchronicity with the modulation timing, and will cause an impossible change in bitrate that is impossible to recover from, as the receiving modem then thinks it's sync'd to a different time point in the signal, causing ALL data that comes through from that point (at least until the next "big pause") to become total gibberish.
FSK is *very*susceptible to synchronization errors, and as such can be very problematic over such a "lossy" network.
PSK, which is what 1200/2400 use (phase shift keying) actually changes the phase angle of the wave, and can condense multiple bits into a single cycle. At 1200 with no error correction, you end up with a hopeless string of garbage over all but the best of connections. Same for 2400 w/o EC. Then, 2400 with EC, you start to gain some ability to transmit data again, but every time there's a "glitch" the modem has to retrain and try to retransmit the lost data, and will appear to have "locked up" until the error checking mechanism turns out a valid block of data.
As you go up in speed, the modulation changes, and we start seeing things like QAM, TCM, and others. Each of these send more and more bits in the same amount of time, so you actually start getting more and more reliability over VOIP because a single VOIP time slice may contain enough data for a single EC block. Nonetheless, you DO end up getting the same "lock ups" as the EC does its job and continues to retry blocks that didn't come through correctly.
So that brings me to the next piece: Codec.
The codec I typically use is uLaw. uLaw is the same codec that was used on T-carrier channels, 64kbps, 8 bits per sample. It is more than enough to encapsulate all of the analog data that is part of any modulated signal from the types of modems we care about. A more robust codec with more bandwidth isn't necessary, and in fact (due to the greater bandwidth required by the signal, in many cases) could make the issue worse over more distant links. A less robust (more lossy) codec, like some of the cheapo "VOIP in a box" type providers use, things will be far worse because it lacks the resolution to effectively communicate the nuance of more advanced modulations, and may not even get the frequencies "pure" enough on the far end. *shrug*
That also brings us to "loss planning" and hybrids... an imbalanced hybrid (the circuit which takes your 2-wire phone and splits it into a "ear" and "mouth" 4-wire pair) can cause echo on the line. If you put too hot (loud) of a signal into a phone that isn't well engineered or which has a phone or modem with an imbalanced hybrid, that signal will then "echo back" off the remote hybrid, and you'll hear your own voice, delayed echoed, back into your earpiece from the far end. Modems generally do not like this, though better quality, later model modems tend to have echo cancellation built into their hardware. One must "plan the loss" so as to where the transmitted signal is attenuated to an acceptable level on the remote end's VOIP. Worse than that, when dealing with analog conversion to voip, you end up with a connection that looks much like this:
Code:
Originate End Phone/Modem [hybrid] -> [hybrid] Analog Terminal adapter -> network -> voip server -> network -> Analog Terminal Adapter [hybrid] -> [hybrid] Answer End Phone/Modem
So you end up with 4 hybrids on the line instead of 2!!!
So, long story short - If you're doing LOCAL calls, that is, your ATA's are on the local wire with the asterisk server that will switch the call and possibly carry the audio channel, and you don't have a noisy LAN, you can (assuming good loss planning, the right codecs and codec settings) make a station-to-station call inside the house with VOIP and typically get a rather clean connection. But, adding a service that VOIPs across your internet connection to the world at large - that will tend to be problematic, because 9 zillion variables come into play that the modem designers never planned for.
All of my channels here at the house are TDM (T1 carrier into a channel bank that converts them to analog POTS), and I can communicate at any speed, reliably, noise free between any pair of modems. If I use one of my VOIP providers to either take an incoming call, or originate an outgoing call, all bets are off. Some days it will be flawless at any speed, some days it won't work no matter what, most days I can get a passable connection to "Site A", but not to "Site B", and other days I can get good results with "Site B" but not "Site A".
IMO, VOIP is no replacement for POTS - but the average person has become so acclimated to lossy, grainy, noisy cell phone connections, they don't remember what it was like to "Hear a Pin Drop" and are thus more accepting of lossy VOIP call quality as well.
Where your brain smooths over the "glitches", in some cases so much you can't even notice them (they're there, if you look at the waveform level), a modem is far more discerning about accuracy of frequency and timing.
Then, there's the question of rotary dialing - not all VOIP ATA's handle rotary. Some do. Those that do are sometimes hard to identify or find. Those that dont are PLENTIFUL. There are devices that you can get that plug between the phone(modem) and VOIP or POTS jack which take rotary dialing and convert it into DTMF into the forward channel. They're easy to set up, but not inexpensive, usually.
But... if you just want to connect two modems together, and want the simplest method of doing so, there are pre-made devices available that are telephone line emulators, you can often get one that when you pick up the phone on one side, the other side rings immediately, then once the call is established at both ends, it provides the -48vdc talk battery necessary for both ends to communicate with each other.
HTH