Dear friends I filed a bug https://issues.asterisk.org/jira/browse/ASTERISK-23656 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.
How many seconds later does the file show up? Can you just throw in a Wait() (maybe 1 or 2 seconds) and then do the Playback, or would even a second or two of delay be an issue (or does it still not work)? -Josh On Wed, Apr 23, 2014 at 2:23 PM, CDR <venefax at gmail.com> wrote:> Dear friends > I filed a bug > https://issues.asterisk.org/jira/browse/ASTERISK-23656 > 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. > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140423/4da61148/attachment.html>
On Wed, 23 Apr 2014, CDR wrote:> 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.A simple test: exten = *,n,record(foo.wav) exten = *,n,playback(foo) works as expected for me with Asterisk 11.8.1. I notice in the console log you uploaded, you have a file name of '18000000000-industry:sln' The syntax for record says 'filename.format' not 'filename:format' -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
On Wednesday 23 Apr 2014, CDR wrote:> Dear friends > I filed a bug > https://issues.asterisk.org/jira/browse/ASTERISK-23656 > 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 environments. 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. -- AJS Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk .