You need a bit more hardware (see other posts), but most modems from the late 1990s until laptops stopped coming with a modem worked this way - using the CPU which was probably slower than a pi to do the work. Such models basically never worked in linux (I'm not sure why), they didn't have the best reputation as far as quality but they worked.