Asterisk 13 - call recording file update rate


I have a question/doubt.
Is it possible to force asterisk to save the recordings to the ulaw file in a faster rate?
We are implementing a live speech analysing tool, but to make it more efficient, we would need the ulaw file to be updated in a faster rate. Right now the ulaw files are being updated in different rates (sometimes after a few seconds, sometimes close to 60 seconds).
i don’t know how it works internally, is it buffer size related? As soon as the buffer reaches a specific size it is written to the file? Or maybe it is something else?

How can I change that rate to make it faster?

Thanks in advance,

Any thoughts on that?

Asterisk itself doesn’t buffer. It writes the data out using fwrite to the file[1]. The underlying operating system could buffer it though and only really write it out every so often.


1 Like

Oh, good to know. We will take a look on that.

In particular, fwrite is a, user space, C library routine that, by default, buffers output and only writes it when a buffer is full. The kernel will then buffer it for some time, before physically writing to the disk, however, requests from other processes will be satisfied from that buffer, so it will be invisible, unless the machine crashes before the physical write.

I have the same issue - I have downgraded to asterisk 11 and the file is filled up more smoothly - every second or so. OS is the same (debian 9.3), and it is the same box - I’ve only used packages for ast 11 from debian 8 - So I dont really see this as caused by something external to asterisk, but by some change in asterisk way of writing the file