Lunch Break Buzzer with asterisk on paging system

I need to have my asterisk system act as a lunch / break buzzer. I currently have a paging system (IPbased) which is connected to my asterisk box. I want at a certain time of the day for the asterisk box to play a buzzing sound on my paging system. My paging system is on an extension e.g. 301. I think this is pretty simple.

I’ve been doing a little of my own research and found call files could be of some use, but I need this to be repeated every day.

here is the pseudo code:

if asterisktime == time(“8:00am”, “12:00pm”, “12:30pm”, “5:00pm”)
call extension 301
playback (“buzzing.wav”)
hangup
end if

Could you be of any help on this matter?

Thanks
Ray G

Create your call file in other path like /root/, then create an entry in the crontab to copy the /root/callfile to /var/spool/asterisk/outgoing/

But I want the buzzer to go off everyday at a certain time. Doesn’t a callfile get deleted once its executed? also can you help with the code a little?

=========================================

Just read on crontab, its seems that i can schedule a command - can you please hold my hand a little with this?

thanks

Create a sh for the copy:

copycall.sh:
#!/bin/bash
cp /root/yourcall.call /var/spool/asterisk/outgoing/

Make it executable.(chmod +x copycall.sh) and save it in /root per example.

Then make the crontab:

30 15 * * * /root/copycall.sh

This will execute the copycall.sh every day at 15:30hrs

i think you need to create a copy and move it to the outgoing folder. if you try the cp command into the outgoing folder, chances are it starts getting executed before the file is completely copied so the call fails:

copycall.sh:
#!/bin/bash
cp /root/yourcall.call /root/todays.call
mv /root/todays.call /var/spool/asterisk/outgoing/

[quote=“navaismo”]Create a sh for the copy:

copycall.sh:
#!/bin/bash
cp /root/yourcall.call /var/spool/asterisk/outgoing/

Make it executable.(chmod +x copycall.sh) and save it in /root per example.

Then make the crontab:

30 15 * * * /root/copycall.sh

This will execute the copycall.sh every day at 15:30hrs[/quote]

Two questions:

  1. so to have the system execute the code at certain times e.g. at 8:00am 12:00pm 12:30pm 5:00pm I have to make a new crontab for each time?

00 8 * * * /root/copycall.sh
00 12 * * * /root/copycall.sh
30 12 * * * /root/copycall.sh
00 17 * * * /root/copycall.sh

  1. The code inside the yourcall.call what would it look like?

Thanks for all the help