[asterisk-dev] 16khz/8khz Translation path

Kevin P. Fleming kpfleming at digium.com
Mon Sep 27 10:59:52 CDT 2010


On 09/27/2010 10:40 AM, Moises Silva wrote:

> Another thing that could be useful for both, Digium and Sangoma
> transcoder cards is a max use counter. Since the number of transcoders
> is limited, it'd be nice if Asterisk could know that certain translators
> have reached its limit and do not even try to use them (ie, disable
> them) so other codecs are preferred if available. 

We've already added an API so that translators can temporarily 'disable'
themselves; the software G.729 codec does this, for the exact reasons
you mention. I'm not sure if the driver for the TC400 board does, but it
certainly could.

> I may be talking gibberish here though since I am not sure at what point
> the legs decide the codec to use, they may not even know or check if
> there is translators available and there would be always a race between
> check and use.

Right; since the API is under the control of the translator, there's no
race condition. During the process of building a translation path, if
that path would consume the last available channel, the translator
disables itself from *future* consideration. Since the lock on the
entire translator list is held during this time, other translation paths
can't be built using this translator. It's not perfect, but it does
work, and it was added with only minimal changes to the code :-)

> Currently, as far as I remember, when a translator fails to be created
> (in the case the hw limit was reached), Asterisk starts sending tons of
> warnings to the CLI about unexpected frame format or something like
> that, but does not hangup the call. I believe that was tested with
> Asterisk 1.4, can somebody confirm what would be the expected behaviour
> here? shouldn't Asterisk hangup the call?

Well, not necessarily, because the call might not require that codec...
but properly handling this without hanging up the call would require
mid-call codec negotiation to be performed.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list