[asterisk-users] Paging for Praying

bilal ghayyad bilmar_gh at yahoo.com
Fri Dec 28 18:06:42 CST 2012


Dear Steve;

Thanks a lot for your help.

Specifically what I need is the following:

1) One wave file to be paged at the Phones. In the 5 times, the same file will be used.

2) Praying time need to be obtained from text (or database). So, it is not always the same time. What actually is needed to be obtained from the text file or the database is the time of the pray for each date (for example, if today is 28 of December so the query will be for this date and then it is required to check if the time is same as the current time to page the wave file on the Phones).

I have one more question:

What was u meaning by call file and why it is required to place them in the 'astspooldir.'?

Regards
Bilal

> 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.



More information about the asterisk-users mailing list