[Asterisk-Users] Codec negotiation

Tamas J thomasj at eworld.hu
Sun Nov 21 05:56:35 MST 2004


Saturday, November 20, 2004, 7:03:53 PM, Steven wrote:
SC> On Sat, 2004-11-20 at 18:48 +0100, Tamas J wrote:
>> Hello!
>> 
>> I would like to know wether it is possible to have end-to-end codec
>> negotiation in iax2?
>> What I mean is...
>> 
>> In case the user dials a number available through PSTN, let's force to
>> use alaw (the client is in LAN) to overcome unneeded transcoding:
>> iaxphone->1st asterisk -> PSTN
>> 
>> In case the same user dials a number available throug a chain of IAX2
>> peers (e.g. 2 peers), try to negotiate the codec end-to-end to consume
>> less resources for transcoding on asterisk servers (of course, in that
>> case we don't want to use g711, but ilbc, speex or gsm).
>> iaxphone->1st asterisk->2nd asterisk->PSTN
>> Or maybe:
>> iaxphone->1st asterisk->2nd asterisk->iaxpohone
>> 
>> Is there a way to do that? If yes, how?

If 1st asterisk ->> 2nd asterisk is a link that
If 1st asterisk ->> negotiates the ILBC, gsm,
SC> or speex, when the call transfers, it should negotiate the codec. Of
SC> course part of the interesting effect here is that unless there is NAT
SC> or something similar in the way, IAX is going to try and get out of each
SC> section if it can. So you may end up with the end result being iaxphone
->> iaxphone and they might be negotiating with each other.
Thanks for the fast response!
Yes, when the call is transfered, it's logical that parties can
negotiate codecs. However is there a way to negotiate end-to-end
without call transfer?

Is it possible to make this?
iaxComm -> asterisk -> E1 PSTN
              +------> IAX operator
When the softphone dials to local PSTN number, let's choose alaw or
ulaw codec (to avoid speex/ilbc/gsm -> alaw/ulaw transcoding) and if
the call goes out through IAX, let's choose low bandwidth codec (there
should be a preferred one, e.g. softphone and iax trunk use speex).
What I would like is to avoid unneeded transcoding and save on CPU
resources.

What I tryed is to put for sofphone:
disallow=all
allow=speex
allow=alaw
allow=ulaw
When the call went to PSTN it used speex. How can I tell to asterisk
to use alaw (or ulaw while iaxComm looks not supporting alaw) in this
case?
I guess when I would exchange the order and put speex to the and, it
will chose ulaw (oops, I tryed and it selected Speex again), but in
this case who will do g711<->speex?

What is my goal with this?
I would like to encode to speex at the softphone's side, thus I can
save CPU power on asterisk box. (and if I put 10-20... more
softphones, I won't run out with CPU, because when it comes to local
call, there won't be transcoding either and when it will go out to iax
peer, it will just pass-through).

Any idea, hint?

Thanks in advance,
        Tamas

ps: sorry for the possible a newbie or/and dumb question...





More information about the asterisk-users mailing list