The short answer: G729
The long one…
The most commonly used codecs are:
This is a PSTN quality codec, which is supported by 99% of all devices and providers (but often disabled to reduce traffic).
It has very good quality but the highest bandwidth usage (64 kbps + ~20 kbps overhead ≈ 84 kbps in one direction).
It comes in two flavors: G711u (ulaw) used in the USA and G711a (alaw) used mostly in Europe and other countries.
Do not use this codec if you have voice quality issues or limited traffic .
This codec is free, without any licensing fees.
The quality is a little worse compared to G711 but it is often used because it reduces traffic (~8 kbps + ~20 kbps overhead ≈ 28 kbps in one direction).
It takes a lot of CPU power to transcode to/from another codec, so the total call count on the server is greatly reduced using this codec with transcoding.
This codec is not free and is charged per channel.
It is the best option for a medium-size company: it has acceptable quality for low traffic.
The quality is a little worse again compared to G729, and it uses less traffic. It is not free. Avoid it if you can.
This is an acceptable codec for poor networks. The quality is worse compared to G729. Avoid using it if you can.
G722, iLBC, Speex, etc. are used by closed services, such as Skype. Most hardware does not support them so do not bother looking at them.
The difference in voice quality is quite noticeable. Instead of sounding like you are talking into a tin can, it now sounds like the other person is in the same room.
You can hear more subtle nuances in the person’s voice and certain letters and syllables that are hard to distinguish on regular calls become much easier.
Read the manual for your device to check which codecs it supports.
H263 and H264 are the most popular.
Make sure the same codec is used on both devices that are communicating.
If your system, provider or device does not support T38, you should use G711 for transmitting and receiving faxes.