[asterisk-users] Asterisk codecs retranslation

Nicholas Campion campnic at gmail.com
Mon Apr 23 08:20:43 MST 2007


It looks like the section you want to look at is channel.c:set_format (line
2808).  My understanding is that chan->nativeformats is set to the format
that the channel was created in (GSM for instance) and fmt is set to the
codec we are trying to accept audio from or write audio to.  The important
line is "res = ast_translator_best_choice(&fmt, &native);" this is where the
channel object is trying to determine what the best translation path
(sequence of translations) is for fmt to native (the channels format).
translate.c:ast_translator_best_choice (line 787) determines what the
sequence of translations will be, but if (*dst) & (*srcs) (the codecs are
common/ the same), then you can see that it returns that the codecs are
already matching.  (See the comment on 802:"/* We are done, this is a common
format to both. */")

I had no prior knowledge of this problem.  Looking at the source code is
really the only way to get more than comments which are someones
understanding.

Good luck,
Nick

On 4/23/07, Alexandr Olekhnovich <a.olekhnovich at gmail.com> wrote:
>
> It's your understanding and mine, but I need to know exactly. It's not
> easy to check.
>
> On 4/23/07, Nicholas Campion < campnic at gmail.com> wrote:
> >
> > No.  My understanding is that codec translation only takes place when
> > the codecs are not the same OR if asterisk is recording the conversation.
> > (The second situation may not require conversion either)
> >
> > On 4/23/07, Alexandr Olekhnovich <a.olekhnovich at gmail.com> wrote:
> >
> > > Hello, everyone.
> > > I'm interested in one thing: as I know asterisk retranslates the media
> > > stream with the next way
> > > 1. Gets the frame with the UA1's codec
> > > 2. Retranslates it to slan
> > > 3. Ratranslates slan to UA2's codec
> > > 4. Send the frame
> > > It seems to me, that it follows these steps anyway, the question is:
> > > Will Asterisk retranslate the frame ua1->slin->au2, if the codecs of
> > > the 1-st user and the 2-nd are the same? I need him do not touch the frames,
> > > just retransmit them as is.
> > >
> > > --
> > > Best Regards
> > > Alexander Olekhnovich
> > > _______________________________________________
> > > --Bandwidth and Colocation provided by Easynews.com --
> > >
> > > asterisk-users mailing list
> > > To UNSUBSCRIBE or update options visit:
> > >   http://lists.digium.com/mailman/listinfo/asterisk-users
> > >
> > >
> >
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >   http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> >
>
>
> --
> Best Regards
> Alexander Olekhnovich
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070423/ee898a04/attachment.htm


More information about the asterisk-users mailing list