Asterisk Playback & Record at the same time


we are using Asterisk to record and playback. Both services are working well independently but it seems we can’t start playback of a file while we are still recording it, even if the file is already in the hard disk.

Is it possible to playback while recording the same audio file? Or is there a way to enable it?


what do you mean play a file while it is stll recording?



i don’t think you can play the recorded file while its still open mmm… and you need to end the record before starting another action

be more specific…

Thanks Cavicchi.

I mean start recording from a call and while the file is being record I would like to start playback from another call. I am using Asterisk as a record and playback platform.

Is it possible?


I don’t think you can originate a call in the meanwhile… its a sequential language…
and even if you call at the same time asterisk while someone is recording… you should know the name of the file…

i think that if you explain what u would like to do… it would be really easier to understand

There is whisper. You can do lot of things with it.
Depends what exactly you want.
But it is possible:
Somebody makes record, somebody else listen it (with whisper).
It is not exactly playback, but - as I mentioned - depends what you need.
When you record - system does not writes immediately frames on disk - there are buffers - and this could block playback during record.

Infact I originate 2 calls.In my scenario I have 2 different calls accessing two context

; Where I invoke recoding on file with name “name1.wav”

; Where I invoke playback on file with name “name1.wav”

My application logic is able to handle this stuff very well.

If the PLAYACK call arrives when I am still recording I get an error from Asterisk (“name1.slin” not found). If the PLAYBACK is on a different file (e.g. “name2.wav”) and it arrives when I am recoding “name1.waw” the PLAYBACK on “name2.wav” goes well while I am recoding recording “name1.wav”. PLAYBACK on “name1.wav” works when I stop recording.

My guess is that Asteisk does not give the Playback access to a file while the file is being recording. It that how Asterisk works?


I don’t think you can stream the file while its recorded, as bira said, it buffers the record every X seconds appending to xxx.wav so Asterisk gives you permission to open a file while you are still appending in it… cause its not open technically

Logically it will play the file UNTIL the end (the end that he found when he opened it…) if you recorded… 30 secs… then u start playin while still recording… you will hear 30 seconds…

anyway, with playback you should omit the extension Playback(name1);

if your wish is to spy… so yes you should drop this idea and try with ChanSpy cause it will attach to the stream and not to a file

Take a look on ChanSpy - may be it is just what you want.