[asterisk-dev] temporary file names for monitor files

Sherwood McGowan sherwood.mcgowan at gmail.com
Fri May 30 05:48:43 CDT 2008


Tzafrir Cohen wrote:
> On Thu, May 29, 2008 at 05:24:48PM -0500, John Lange wrote:
>   
>> Does it make sense to write a patch for Asterisk so that while a
>> recording is in progress, the file has a '.part' extension on the file
>> name to differentiate it from files in which recording has finished.
>>
>> The idea here is that if you want to move your recordings off to another
>> place once you have finished you can write a simple "cron" to do it
>> without having to worry if the recording has completed or not.
>>
>> I realize this could be done through dialplan logic but seems to me that
>> this is a more logical way to tackle this problem.
>>
>> Thoughts?
>>     
>
> Renaming at the end of a call?
>
> All to similar to the task of the mixmonitor script. Couldn't this be
> implemented that way?
>
>   
As I read it (pardon me if I'm misunderstanding your question), he wants 
the .tmp or .part to be removed from the filename after the file is 
finished being written to, thereby allowing a simpler method of knowing 
when the file is completed being written to.

I haven't tested in depth, but I believe that the file is created but 
does not have data in it until after the call is completed, but still we 
don't want to modify/copy/move the file until after it's finished being 
written to. Since you're not sure when the file is done being modified 
by Asterisk, the only thing you can do is check for a modification time 
that is more than x seconds/minutes in the past and then do what you 
wish to do to the file.

However, your reminder of the mixmonitor script is good, I think I'll 
take a peek into the code and try to get an idea of two.

Sherwood McGowan



More information about the asterisk-dev mailing list