[asterisk-users] Paging for Praying

Steve Edwards asterisk.org at sedwards.com
Thu Dec 27 19:02:43 CST 2012


Please don't top-post.

On Thu, Dec 27, 2012 at 1:29 PM, bilal ghayyad <bilmar_gh at yahoo.com> 
wrote:

How can I have Paging on Asterisk to call for pray?

The pray is 5 times in a day and there is a timing for pray (actually it 
can be existed in a text file or database for the next 2 or 5 years).

[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Bharat 
Lalcheta

However, its easy to build a script in php or perl or any other language 
which check time from file or database and generate call file which 
execute paging in asterisk. Just put this script in cron. Thats it...

From: Danny Nicholas <danny at debsinc.com>

I would set up 5 shell files called pray1.sh, pray2.sh, etc and then set 
up 5 entries in /etc/crontab to run them at the specified time daily. The 
file pray1.sh should look something like this:

#!/bin/sh
cp /pray1/*.call /tmp
mv /tmp/*.call /var/spool/asterisk/outgoing

the entry in /etc/crontab would look like this

0 8 *** root /usr/bin/pray1.sh

This would run pray1.sh at 8 am daily.

On Thu, 27 Dec 2012, bilal ghayyad wrote:

> Thanks a lot for your kindly reply and help.
>
> Really I did not understand why you need to place them in the 
> /var/spool/asterisk/outgoing?

The appropriate solution needs a lot more detail to be useful.

Is this just to remind you or is this the foundation of a new product for 
thousands of customers?

Is there a message or verse associated with each of the 5 reminders or is 
'time to pray' sufficient?

Is there a penalty associated with missing a prayer like eternal 
damnation? (AMI is more robust than call files.)

The answers would help guide you in deciding if a simple cron based shell 
script generating call files or a database driven AMI daemon is the best 
approach.

In answer to your specific question, the call files need to be "mv'ed"
into /v/s/a/o/ because:

) You need to use mv instead of cp because mv is an 'atomic' function* 
meaning it happens all at once so that Asterisk will not try to read an 
incomplete file.

) This is the default value of 'astspooldir.' You can specify a different 
location in asterisk.conf if needed.

*) Assuming the source and destination are on the same filesystem.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list