While it’s certainly possible to rig up and debug a headphone to USB interface to Audacity system, I think in this case, Google is your friend.
This posting also pops up when I google your question …
… and while it seems a snap with minimal complexity and expense (they even mention Audacity), the one step where they connect to the Mic-In of their laptop is where it falls apart. Mic-In on many laptops is not a generic stereo connection that you can connect to whatever you want to record. It’s usually Mono, not Stereo and it easily overloads and distorts.
They want you to do this.
You can connect the headphone of your cellphone to a computer correctly, but you usually need a USB interface like this.
Instead of my sound mixer and stereo RCA cable, you would connect with a headphone to RCA adapter cable like this.
Of course, if you have one of the new iPhones, that doesn’t work either, you need the analog headphone adapter, too.
With the analog capture method, you have to sit through all your messages in real time. This method works really well when you have a small handful of messages you want to keep. The posting is almost always: “My [personal family member] died and the only record I have is my phone voicemail.”