[asterisk-users] Help with a bug
A J Stiles
asterisk_list at earthshod.co.uk
Thu Apr 24 04:20:54 CDT 2014
On Wednesday 23 Apr 2014, CDR wrote:
> Dear friends
> I filed a bug
> but I am wondering if somebody can figure a workaround. I am stuck
> trying to deliver an application.
> The case is this: A Record is executed and an immediate Playback
> follows. Asterisk returns an error, saying that the file does not
> exist, but a few seconds later, it does.
> It does not help if after the Record application I do SHELL(sync).
> Asterisk has not flushed the file out to the OS and it already
> returned. Maybe the application record should have a parameter about
> this behavior. For some application is fine, for some others is not.
You have run up against a race condition. Not unusual in asynchronous
As a workaround, I would advise handing over starting the recording to an AGI
script. But don't do the usual
fork && exit
Instead, start the recording; and then just loop, until *either* a "-e" test
shows that the recording file definitely exists within the file system, or you
have waited far too long.
Note: Originating address only accepts e-mail from list! If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .
More information about the asterisk-users