[asterisk-users] Call file in the future

Gordon Henderson gordon+asterisk at drogon.net
Sat Jan 17 13:49:16 CST 2009


On Sat, 17 Jan 2009, randulo wrote:

> On Sat, Jan 17, 2009 at 7:52 PM, didier.cuffaut <didier.cuffaut at neuf.fr> wrote:
>> May i have some comment/opinion on these two ways below to place a call file
>> in the future ? (from the wiki and the asterisk book but added typos and
>> stupidity come from me)
>>
>> The best is ?  (and should work ?)
>
> This is just me, but if I were going to program calls in the future I
> would just name them with the time (2009-01-17-20-08.call for four
> minutes from now, for example) and put them in a directory. The I'd
> have a cron job running that looked once per minute in that dir and
> did the mv if found file with that name.
>
> Does that make sense?

Not to me.

Cron jobs can be delayed, servers can be rebooted and you're suggesting a 
solution for a problem that already has a solution - ie. set the access 
time of the file in the future which is what didier.cuffaut is trying to 
do.

For didier.cuffaut: the Asterisk command System() calls the system routine 
system() which will fork a shell which will then fork to execute your 
command. It's more efficient to put all the commands in one script and 
then use System() to execute that file.

   System(/path/to/script 100)

Although personally, I'd probably write a C (or php or perl) program to 
make things as efficient as possible than use a shell script (or shell 
commands), to avoid all the forking, but maybe that's just me.

Gordon



More information about the asterisk-users mailing list