[asterisk-dev] res_monitor information

Paulo Garcia paulo.astdev at gmail.com
Wed Feb 17 13:36:46 CST 2010


Thanks, now what I see makes sense.

Paulo

On Wed, Feb 17, 2010 at 9:20 AM, Russell Bryant <russell at digium.com> wrote:

> On 02/16/2010 01:07 PM, Paulo Garcia wrote:
> > Hi,
> >
> > I'm analyzing the way the Monitor application works in Asterisk 1.4. At
> > first it seems very simple, however the code in channel.c (__ast_read
> > function around line 2390):
> >
> > int jump = chan->outsmpl - chan->insmpl - 4 * f->samples;
> > if (jump>= 0) {
> > jump = chan->outsmpl - chan->insmpl;
> > if (ast_seekstream(chan->monitor->read_stream, jump, SEEK_FORCECUR) ==
> -1)
> > ast_log(LOG_WARNING, "Failed to perform seek in monitoring read stream,
> > synchronization between the files may be broken\n");
> > chan->insmpl += jump + f->samples;
> > } else
> > chan->insmpl+= f->samples;
> >
> > seems confusing to me. What is being done here?
> >
> > Is it a way to keep the in and out files synchronized? If yes, how does
> it
> > work? Is it possible that one file can present chunks of silence (80ms
> long
> > for example) if this way of the call doesn't receive samples in the same
> > rate of the other?
>
> You are correct.  This code is intended to keep the input and output
> files in sync.  It does the following:
>
> Is the number of output samples minus the number of input samples
> greater than 4 times the current frame size?  (Note that frames are
> usually 20ms, so an 80ms difference is where the sync would occur.)  If
> so, seek the input file forward by the amount of difference (as I said
> before, most likely at least 80ms).
>
>
> --
> Russell Bryant
> Digium, Inc. | Engineering Manager, Open Source Software
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
> www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>



-- 
--------------
Paulo Garcia
Pika Technologies Inc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20100217/1cfdab4d/attachment.htm 


More information about the asterisk-dev mailing list