Why is this .call file running immediately instead of waiting for set time?

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
Why is this .call file running immediately?

The file name is: 1015.test.call


I put in into /var/spool/asterisk/outgoing at 9:45 am, but it ran immediately instead of waiting until 10:15.


Thanks
 
Why is this .call file running immediately?

The file name is: 1015.test.call


I put in into /var/spool/asterisk/outgoing at 9:45 am, but it ran immediately instead of waiting until 10:15.


Thanks
Code:
[B]How to schedule a Call in the Future [/B]
 
Files with a [B]modified[/B] date in the future are ignored until that time arrives. Create the file in /var/spool/asterisk/tmp, modify the mtime using "touch", and then move it... 
 
 
 
[FONT=monospace]$ date [/FONT]
[FONT=monospace]Mon Mar 19 13:52:30 EDT 2007 [/FONT]
[FONT=monospace]$ touch -d 20080101 /var/spool/asterisk/tmp/blah [/FONT]
[FONT=monospace]$ mv /var/spool/asterisk/tmp/blah . [/FONT]
[FONT=monospace]$ ls -l blah [/FONT]
[FONT=monospace]-rw-r--r--    1 andrew   users           0 Jan  1 00:00 blah [/FONT]
 
 
 
 
 
 
Bash example: to schedule a call in 100 s : 
 
[FONT=monospace]# gives you the current time in seconds since dawn of UNIX [/FONT]
[FONT=monospace]NOW=`date +%s` [/FONT]
[FONT=monospace]# add 100 seconds [/FONT]
[FONT=monospace]let NOW=$NOW+100 [/FONT]
[FONT=monospace]# create a timestamp used by 'touch -t' (no space between %M. %S, but the Wiki wants a space at this place) [/FONT]
[FONT=monospace]TOUCH_TMSP=`date -d "1970-01-01 $NOW sec GMT" +%Y%m%d%H%M. %S` [/FONT]
[FONT=monospace]# and do the touch [/FONT]
[FONT=monospace]touch -t $TOUCH_TMSP blah [/FONT]
 

Members online

No members online now.

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top