<div class="gmail_quote">On Mon, Sep 27, 2010 at 10:24 AM, Russell Bryant <span dir="ltr">&lt;<a href="mailto:russell@digium.com">russell@digium.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, 2010-09-27 at 09:20 -0500, David Vossel wrote:<br>
&gt; I have noticed this as well and this needs to be investigated.  It is possible that the second of audio we use to calculate the the least cost translation path is not accurate enough.   If it turns out that G722 is actually somehow more cost efficient than using the libresample library then we need to come up with a way to force lossless codec translations when they are available.<br>

<br>
</div>I think that would be a good thing to put in there regardless.  It<br>
shouldn&#39;t be too hard since you already put in some good hooks for<br>
making the cost calculation take things other than time into account.<br></blockquote><div><br></div><div>In this same note, it&#39;d be nice if translators had a flag to decide whether can be used as a step in the translation path or should only be used when src/dst match. Sangoma has hardware doing direct conversions between g729, ulaw, alaw, gsm and others without going thru linear (as far as asterisk knows). Sometimes Asterisk however will calculate that is faster to transcode between unrelated codecs, like ilbc and ulaw choosing something like:</div>
<div><br></div><div>ilbc -&gt; g729 -&gt; ulaw </div><div><br></div><div>rather than </div><div><br></div><div>ilbc -&gt; linear -&gt; ulaw</div><div><div><br></div><div>Effectively using a g729 resource that could be needed for a real g729 call and not just as a faster translation step.</div>
<div><br></div><div>Our current work around is give horribly bad cost to our translators by faking the amount of time it takes to transcode that second of audio on load. That way Asterisk only uses the translators when there is no other option. But this is a horrible hack :-)</div>
<div><br></div><div>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&#39;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. </div>
<div><br></div><div>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.</div>
<div><br></div><div>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&#39;t Asterisk hangup the call?</div>
<div><br class="Apple-interchange-newline">Moises Silva<br>Senior Software Engineer<br>Sangoma Technologies Inc. | NEW 100 Renfrew Drive, Suite 100, Markham ON L3R 9R6 Canada<br>t. 1 905 474 1990 x128 | e. <a href="mailto:moy@sangoma.com" target="_blank">moy@sangoma.com</a></div>
<br><br><br></div></div>