[asterisk-users] Different codecs for reading and writing

Alex Balashov abalashov at evaristesys.com
Sat Aug 1 16:26:15 CDT 2009


Elliot Murdock wrote:

> Thank you...do you know if IAX can do this?
> 
> The reason for doing is this is to get over the adsl upload/download
> discrepancy.  While G711 gives terrific quality, it is not always that
> feasible for the upload direction, which has much more limited
> bandwidth.  Accordingly, it would be possible to use G729 for upload,
> but keep the higher quality codec, G711, for download.

I do not know a great deal about IAX so I will defer to the experts for 
the definitive word on whether it is possible from the point of view of 
its formal protocol mechanics.

However, poking around the various configuration options for IAX peers 
on voip-info.org and a few other places suggests that there is no option 
to do that with IAX, either.  It's not really something 99.9% of VoIP 
users want to do.  :-)

As far as the asymmetric upstream/downstream rates on ADSL, are you sure 
that you're solving the right problem?  How many calls are you trying to 
run over such a circuit?  If it's one or two or three, it's no big deal 
either way to do with G.711;  it's 64 kbps (8 kB/s), or ~80ish kbps with 
Layer 2 framing overhead (for Ethernet;  it may be a little more once 
PPP(oE) headers + ATM AAL5 encapsulation + other stuff frequently in use 
in DSL transport and aggregation architecture is factored in).

Personally, I'd recommend that you just use some low-bitrate codec in 
both directions.  If it's a good codec, you won't take a tragically 
significant hit on the quality on the receive side either, and if it's a 
bad codec, then the feasibility of conversation with the far end is 
going to be impacted because they can't hear you well.

Opinions on which codec to use vary, but the only low-bit rate codec 
I've ever used that I've been even remotely satisfied with in terms of 
conversational quality is G.729.  It really provides by far the most 
optimal intersection of bit rate and quality;  it trims the call down to 
8 kbps (8x less than clear-channel G.711!) and still sounds quite good. 
  It uses some rather advanced CELP (code-excited linear prediction) 
techniques to refer to forms out of a table to achieve that effect.

The downside - and it probably has to do with why G.729 is so good - is 
that all implementations are subject to royalties on software patents, 
so you can't have it for free with Asterisk;  at least, you can't have 
it legally.  It comes built into most commercial VoIP gear because the 
G.729 licensing cost is just baked into the retail price of the unit. 
But with open-source stuff, it costs money.

However, your mileage may vary;  you may want to try Speex or iLBC or 
whatever the cool kids are using.  The downside there is that not a lot 
of VoIP trunking providers' gear supports these.  For the most part, the 
commercial part of the ecosystem (i.e. beyond Asterisk) deals in 
G.711u/A and G.729A, although the G.722 wideband codec (for 
"high-definition" voice) is starting to get some rather serious attention.

Cheers,

-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775



More information about the asterisk-users mailing list