- About VoIP
- What is VoIP and what it can do for you
- Introduction to VoIP (video)
- Why should you switch to VoIP services?
- Analog Telephony
- Digital Telephony
- What is SIP?
- How to start with VoIP telephony
- Web based VoIP
- How to choose a right VoIP provider?
- Wi-Fi network and VoIP
- VoIP Codecs
- Free sip account
- Confidential calls
- VPN: UDP or TCP?
- Mobile VoIP
- VoIP on your mobile
- Asterisk IP-PBX
- Who we are?
- How to start
- Free SIP account
- Configs
VoIP Codecs
VoIP Codecs – general overview
Codecs are generally understood to be various mathematical models used to digitally encode (and compress) analog audio information.
Many of these models take into account the human brain’s ability to form an impression from incomplete information. We’ve all seen optical illusions; likewise, voice-compression algorithms take advantage
of our tendency to interpret what we believe we should hear, rather than what we actually hear.
“According to research at an English university, it doesn’t matter in what order the letters in a word are, the
olny iprmoetnt tihng is taht frist and lsat ltteres are in the rghit pclae. The rset can be a toatl mses and you
can sitll raed it wouthit a porbelm. Tihs is bcuseae we do not raed ervey lteter by istlef, but the wrod as a
wlohe.” (The source of this quote is unknown―see http://www.bisso.com/ujg_archives/000228.html.) We do
the same thing with sound―if there is enough information, our brain can fill in the gaps.
The purpose of the various encoding algorithms is to strike a balance between bandwidth efficiency and voice quality. On an audio CD, quality is far more important than saving bandwidth, so the audio is quantized at 16 bits
(x2 times for stereo as there are left and a right channels), with a sampling rate of 44,100 Hz. Considering that the CD was invented in the late 1970′s, this was quite impressive stuff back then. The telephone network does not require this level of quality (and needs to optimize bandwidth), so telephone signals are encoded using 8 bits, at a sampling frequency of 8,000 Hz.
Originally, the term codec referred to a COder/DECoder: a device that converts between analog and digital. Now, the term seems to relate more to COmpression/DECompression.
Bandwidth requirements for different VoIP codecs you can find on this page.
G.711 (ulaw/alaw)
G.711 is the fundamental codec of the PSTN
. In fact, if someone refers to PCM with respect to a telephone network, you are allowed to think of G.711. Two companding methods are used: μlaw in North America and alaw in the rest of the world. Either one delivers an 8-bit word transmitted 8,000 times per second. If you do the math, you will see that this requires 64,000 bits to be transmitted per second. Many people will tell you that G.711 is an uncompressed codec. This is not exactly true, as companding is considered a form of compression. What is true is that G.711 is the base codec from which all of the others are derived. G.711 imposes minimal (almost zero) load on the CPU.
G.711 codec has 64 Kbps for Data bitrate (DSP output rage without IP headers) and do not require a license. Actual bandwidth requirements may vary from network type and protocols used. Approximate requirements for average Internet connection TCP/IP with packet overheads is 80 Kbit/s per each active line for each direction. Complete comparison table with different codec and payloads you can find here.
G.726
G.726 codec has been around for some time (it used to be G.721, which is now obsolete), and it is one of the original compressed codecs. It is also known as Adaptive Differential Pulse-Code Modulation (ADPCM), and it can run at several bitrates. The most common rates are 16 Kbps, 24 Kbps, and 32 Kbps. Most popular rate for this codec is ADPCM-32 rate. G.726 offers quality nearly identical to G.711, but it uses only half the bandwidth. This
is possible because rather than sending the result of the quantization measurement, it sends only enough information to describe the difference between the current sample and the previous one. G.726 fell from favor in the 1990′s due to its inability to carry modem and fax signals, but because of its bandwidth and CPU performance ratio it is now
making a comeback. G.726 is especially attractive because it does not require a lot of computational work from the system.
G.726 codec has 16/24/32/40 Kbps for Data bitrate, most popular and commonly used is 32 Kbps. License is not required. For bandwidth requirements please see this page.
G.723.1
G.723.1 official name is Dual rate speech coder for multimedia communications transmitting at 5.3 and 6.3 kbit/s. Note that this is a completely different codec from G.723.
G.723.1 can operate at 6.3 kbit/s (using 24 byte frames) using a MPC-MLQ algorithm or 5.3 kbit/s (using 20 byte frames) using an ACELP algorithm. Use of G.723.1 requires a license for the patents that cover the algorithm. The last patent will expire in 2014. The authorized intellectual property rights (IPR) Licensing Administrator for G.723.1 technology is Sipro Lab Telecom.Members of the G.723.1 patent pool are AudioCodes, France Telecom, Université de Sherbrooke, Nippon Telegraph and Telephone Corporation and Nokia.
G.723 bandwidth requirements can be found here.
G.729A
Considering how little bandwidth it uses, G.729A delivers impressive sound quality. It does this through the use of Conjugate-Structure Algebraic-Code-Excited Linear Prediction (CS-ACELP). Because of patents, you can’t use G729A without paying a licensing fee; however, it is extremely popular and well supported on many different phones and systems. To achieve its impressive compression ratio, this codec requires an equally impressive amount of effort from the CPU. For example on Asterisk system, the use of heavily compressed codecs will quickly bog down the CPU.
CELP is a popular method of compressing speech. By mathematically modeling the various ways humans make sounds, a “code book” of sounds can be built. Rather than sending an actual sampled sound, a code corresponding to the sound is determined. CELP codecs take this information (which by itself would produce a very robot-like sound) and attempt to add the personality back in. (Of course, there is much more to it than that.) Jason Woodward’s Speech Coding page is a source of helpful information for the non-mathematically inclined. This is fairly heavy stuff, though, so wear your thinking cap.
GSM
GSM is the “darling” codec of almost all Asterisk/trixbox setups. This codec does not come encumbered with a licensing requirement the way that G.729A does, and it offers outstanding performance with respect to the demand it places on the CPU. The sound quality is generally considered to be of a lesser grade than that produced by G.729A, but much of this comes down to personal opinion. You must try it out.
iLBC
The Internet Low Bitrate Codec (iLBC) provides an attractive mix of low bandwidth usage and quality, and it is especially well suited to sustaining reasonable quality on lossy network links. Naturally, Asterisk supports it (and support elsewhere is growing), but it is not as popular as the ITU codecs and, thus, may not be compatible with common IP telephones and commercial VoIP systems. IETF RFCs 3951 and 3952 have been published in support of iLBC, and iLBC is on the IETF standards track. Because iLBC uses complex algorithms to achieve its high levels of compression, it has a fairly high CPU cost in Asterisk.
While you are allowed to use iLBC without paying royalty fees, the holder of the iLBC patent, Global IP Sound (GIPS), wants to know whenever you use it in a commercial application. The way you do that is by downloading and printing a copy of the iLBC license, signing it, and returning it to GIPS.
iLBC operates at 13.3 Kbps (30 ms frames) and 15.2 Kbps (20 ms frames).
Speex
Speex is a variable bitrate (VBR) codec, which means that it is able to dynamically modify its bitrate to respond to changing network conditions. It is offered in both narrowband and wideband versions, depending on whether you want telephone quality or better. Speex is a totally free codec, licensed under the Xiph.org variant of the BSD license.
Speex can operate at anywhere from 2.15 to 22.4 Kbps, due to its variable bitrate.
Please see also typical payload and bandwidth requirements for most popular codecs in VoIP industry
If you are looking for G.729 and/or G.723 for your Asterisk I’d recommend to check this site – you will find there as binaries to build from source as well as ready codec_g729/723*.so files (already compiled on different platforms).
Some notes:
Troubleshooting
- Noise or metalic sound with codec_g723
Configure /etc/asterisk/codecs.conf [g723] sendrate=63 or 53 as described at the top of this page. - Distorted sound
Disable VAD and CNG in phone and/or your VOIP provider. - show translation – codec is not loaded
Bump asterisk verbosity level with -vv and watch for messages right after ‘loading module codec_g729…’ - Module codec_g72… does not provide a description
Choose proper version of the codec to match your Asterisk version. TRUNK is for SVN TRUNK – the next yet unrealeased major version of Asterisk. - Module codec_g72… was not compiled with the same compile-time options as this version of Asterisk.
Try new 1.4 and/or TRUNK builds. - loader.c… /usr/lib/asterisk/modules/codec_g72…: cannot restore segment prot after reloc: Permission denied
Execute:
$ chcon -t textrel_shlib_t /usr/lib/asterisk/modules/codec_g72[39]*.so
This happens when SELinux is enabled and Asterisk process cannot load the codec because of ELF TEXTREL in shared library. This is how IPP works and that is fine. - loader.c… /usr/lib/asterisk/modules/codec_g72…: cannot enable executable stack as shared object requires: Permission denied
Execute:
$ execstack -c /usr/lib/asterisk/modules/codec_g72[39]*.so - Error loading module codec_g72…: cannot open shared object file: No such file or directory
Check
$ ldd codec_g729.so
$ strace -o trace.log -efile -f asterisk
send ldd output and trace.log file to Asterisk G.729 Google group. - Error loading module codec_g72…: wrong ELF class: ELFCLASS32
Use x86_64 binaries because you’re running 64-bit OS. - $ ldd codec_g729.so: not a dynamic executable
You are running 32-bit, see Notes - note #2 - Asterisk crashing at startup
If Pentium4 codec is not working, try -no-sse builds, try Pentium3. Try ICC builds. Doesn’t work – try Pentium and Debug builds. - Asterisk still crashing at startup
Compile asterisk with CFLAGS=-g
Run asterisk in gdb (with original and -debug version of the codec):
$ gdb /usr/sbin/asterisk
(gdb) r -cvvv
when it crashes do:
(gdb) set disassembly-flavor intel
(32-bit gdb 6.x) disassemble $eip $eip+20
(32-bit gdb 7.x) disassemble $eip, $eip+20
(64-bit gdb 6.x) disassemble $rip $rip+20
(64-bit gdb 7.x) disassemble $rip, $rip+20
(gdb) info registers
(gdb) info threads
(gdb) bt
(gdb) l
(gdb) q
Send an output to Asterisk G.729 Google group together with the result of ‘cat /proc/cpuinfo’. - Why these Illegal instruction errors?
For in-depth technical information read http://gcc.gnu.org/PR32893 and http://bugs.gentoo.org/show_bug.cgi?id=151394.
| Asterisk G.729 |
Recent articles
- Plain explain: IP-phone
- Plain explain: What is SIP termination and what is SIP origination?
- US fixed VoIP market to see steady growth
- Save money with VoIP and unified communications
- IP telephony can help level the playing field for small businesses
- The loss of a landline means big change in communications
- Ubuntu (Linux) on your phone? Yes! And now officially!
- QoS For FaceTime, bandwidth requirements and Firewall config
- Merry Christmas and Happy New Year!
- How to Configure Axvoice Equipment?
- Cloud VoIP vs. on-premise VoIP: Choosing the right one for your business
- 26 terabits per second data transmission achieved
- A fully functional VoIP Client (SIP) finally released (free download)
- Fundamentals of SIP from Cisco :-)
- WebRTC from Google: making real-time communication free to implement
- What is VoIP termination
- Introduction to Voice over IP (VoIP)
- Linux: how to check OS version installed
- Hey!
- How to configure Internet tel. and SIP settings on Nokia phone (E52)
- TCP vs UDP – you must know this
- Google voice / Google talk and Asterisk configuration
- VoIP or IP Telephony?
- Asterisk 10.0.0-rc1 Now Available!
- SIP based VoIP behind NAT
- VoIP Quick start guide
- History: Kellogg Field Phone (World War I)
- Running VoIP via VPN (SSL) – voice quality
- Skype App directory
- G.711: u-law or a-law?
- Wi-Fi access point/router optimization for VoIP and other real time apps
- Agri-Cube grows mass quantities of vegetables in a one-car parking spot
- Quick Comparison of freeware IP-PBX platforms: Asterisk vs Open SER
- Microsoft enabling the ability to eavesdrop on VoIP conversations
- Nimbuzz growing even without Skype
- Skype protocol hack
- Call DSN number
- How to make your VoIP calls private and confidential
- Think on solutions: VoIP phone system
- Asterisk and Google Voice
- VoIP Codec: Payload size
- Nokia SIP settings
- The QoS Dilemma
- VoIP calls over satellite links
- VoIP for Facebook!
- VoIP client behind a VPN with DD-WRT
- Digital Telephony
- Analog Telephony
- Mobile VoIP – the future of mobile communications
- Sip on Android
VoIP SIP IP telephony tags
android Asterisk bandwidth bandwidth requirements best effort cellular codec delay encryption options facebook free calls g273 g726 g729 google gsm high latency How it works ilbc IPsec issues jitter listen to voip mobile Nimbuzz nokia order packet payload. g711 privacy protocol analyzer pstn QoS - Quality of Service QoS protocols real-time applications record voip calls satellite link sipdroid SIP protocol Skype speex TLS voice quality voip voip becomes socialQuick navigation
- Android (6)
- Apple (1)
- Asterisk (22)
- Cloud VoIP (1)
- FaceTime (1)
- Google Voice (6)
- History (2)
- IT news (2)
- Mobile VoIP (16)
- Symbian (1)
- Non VoIP news (2)
- Open source (10)
- Prioritization and traffic shaping (9)
- QoS – Quality of Service (11)
- SIP protocol (32)
- Cisco (2)
- SIP termination (2)
- SMS to email (1)
- Softphone VoIP (1)
- Ubuntu (1)
- Uncategorized (1)
- VoIP calls quality (24)
- VoIP industry news (4)
- VoIP over SSL VPN (1)
- VoIP over VPN (8)
- VoIP service (2)
- VoIP via VPN (1)
More to read on VoIP
- About
- About Mark Spencer
- Asterisk SIP Media NAT
- Browser-based VoIP: web page code to call over IP (to your VoIP account)
- Choosing the right provider
- Cisco ATA186 notes
- Free sip account
- Grandstream Budgetone configuration manual
- How to start with VoIP telephony
- Multiplexing RTP Data and Control Packets on a Single Port
- On-line payments
- VoIP Codecs
- VPN: UDP or TCP?
- What is VoIP and what it can do for you
- Why should you switch to VoIP services?
Blogroll
- Asterisk™: The Definitive Guide (new window) “Asterisk has been emblematic of the way that open source software has changed business—and changed the world”
- Blog Jon FreeSWITCH VOIP SIP Asterisk Linux Open Source
- Business.com Business.com is one of the Web’s largest directories for business products and services
- Ubuntu how-to www.ubuntuka.com Miscellaneous Ubuntu Tips, Tricks and Hints
Our Twitter – latest
- Introduction to Voice over IP (VoIP) - One important step into adopting VoIP is... voip-sip.org/introduction-t… 5 months ago
- How to configure Internet tel. and SIP... voip-sip.org/how-to-configu… 5 months ago
- Hey! - To all people who has an experience with Asterisk and Linux - quote of the day: "I have not failed.... voip-sip.org/hey/ 5 months ago
- What is VoIP termination - Many people keep asking me - what is VoIP Termination?... voip-sip.org/what-is-voip-t… 5 months ago
- How to configure Internet tel. and SIP... voip-sip.org/how-to-configu… 5 months ago

