[asterisk-dev] asterisk stream

Tilghman Lesher tilghman at meg.abyt.es
Sun Jun 12 11:05:49 CDT 2011

On Sunday 12 June 2011 06:20:36 Yaroslav Panych wrote:
> 2011/6/12 ik <idokan at gmail.com>:
> > I'm trying to figure out how much data the ast_streamfile require
> > prior for flushing data to disk.
> > The thing is, that I'm trying to change MixMonitor to flush the
> > recording in "real-time" while the RTP is available, instead of
> > flushing the data when buffer is full or channel was hangup.
> > 
> > How can I that ?
> Actually ast_streamfile does not cares about buffering and other
> low-level stuffs. This task is delegated to file format subroutines(in
> your case it is ast_filestream->fmt->write which is implemented in
> correspondent module). In most cases this modules are using standard
> libc File I/O (fopen,fread,fwrite,fclose etc). So your task is to
> modify or rewrite those modules to work in manner you require.

Probably the best thing to do, then, would be to add a "sync" request
into the API, so this can be done at a high level.  Doing this constantly
on a low-level will have deleterious effects on filesystem performance.


More information about the asterisk-dev mailing list