Hello; 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). My question is compound from two parts: How can I have Automatic Page? The automatic page should happens by reading the time and check if the time is same as this time, then do the Page. How? Is it by cron? Someone told me that do a cron that call a script which will check the time, if the time came to do th Page, then do a Page. But really I do not know how this can be done and I do not know if this is already existed? Regards Bilal
I dont think this is existed. 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... Regards, Bharat Lalcheta On Thu, Dec 27, 2012 at 1:29 PM, bilal ghayyad <bilmar_gh at yahoo.com> wrote:> Hello; > > 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). > > My question is compound from two parts: > > How can I have Automatic Page? > > The automatic page should happens by reading the time and check if the > time is same as this time, then do the Page. How? Is it by cron? > > Someone told me that do a cron that call a script which will check the > time, if the time came to do th Page, then do a Page. But really I do not > know how this can be done and I do not know if this is already existed? > > Regards > Bilal > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- Bharat Lalcheta -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20121227/d633f56c/attachment.htm>
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. From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Bharat Lalcheta Sent: Thursday, December 27, 2012 2:22 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Paging for Praying I dont think this is existed. 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... Regards, Bharat Lalcheta On Thu, Dec 27, 2012 at 1:29 PM, bilal ghayyad <bilmar_gh at yahoo.com> wrote: Hello; 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). My question is compound from two parts: How can I have Automatic Page? The automatic page should happens by reading the time and check if the time is same as this time, then do the Page. How? Is it by cron? Someone told me that do a cron that call a script which will check the time, if the time came to do th Page, then do a Page. But really I do not know how this can be done and I do not know if this is already existed? Regards Bilal -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Bharat Lalcheta -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20121227/bc6ff759/attachment.htm>
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? Regards Bilal ---------------> > 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. > > > > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] > On Behalf Of Bharat > Lalcheta > Sent: Thursday, December 27, 2012 2:22 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Paging for Praying > > > > I dont think this is existed. > > > > 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... > > > > Regards, > > > > Bharat Lalcheta > > > > > > > > On Thu, Dec 27, 2012 at 1:29 PM, bilal ghayyad <bilmar_gh at yahoo.com> > wrote: > > Hello; > > 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). > > My question is compound from two parts: > > How can I have Automatic Page? > > The automatic page should happens by reading the time and > check if the time > is same as this time, then do the Page. How? Is it by cron? > > Someone told me that do a cron that call a script which will > check the time, > if the time came to do th Page, then do a Page. But really I > do not know how > this can be done and I do not know if this is already > existed? > > Regards > Bilal
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.
> How many customers will be receiving these reminders?* It is required that all the employers at the company to hear this on their IP Phones.> What religion is this targeted to?* Islam.> A call file is a text file that you create. The format is > very specific.* How can I know this format? Because I need to know what should I place in this file so it will execute Paging for this group of Phones?> You can > 'schedule' a call file to be processed in the future by > setting the file's > 'mtime.'* Can you explain for me please? I am fully thanks. Regards Bilal ------------------> > > I have one more question: > > > > What was u meaning by call file and why it is required > to place them in > > the 'astspooldir.'? > > There are 2 methods of originating a call external to > Asterisk: call files > and the Asterisk Manager Interface (AMI). > > A call file is a text file that you create. The format is > very specific. > It could contain (in the context of your needs) the phone > number to dial > and the path of the file to play. A call file is kind of > like a 'message > in a bottle.' You cast it into the sea and hope for the > best. When this > file is "mv'ed" into the directory specified in the Asterisk > astspooldir > variable, Asterisk will read it and try to do what you want. > You can > 'schedule' a call file to be processed in the future by > setting the file's > 'mtime.' > > The Asterisk Manager Interface (AMI) is a TCP connection > between your > program and Asterisk. You can issue commands (like > originate) and receive > responses. AMI is more robust because you can make decisions > based on the > response. > > If robustness is not of primary importance, a script > scheduled by cron to > run after midnight could create the 5 call files for that > day, setting the > 'mtime' of each file before "mv'ing" the file to the > directory specified > by astspooldir -- usually /var/spool/asterisk/outgoing/ > > How many customers will be receiving these reminders? > > What religion is this targeted to?
How many people do you plan to page? because if numbers are high (or variable) you may have an easier life by using some sort of dialer.... if numbers are not very high and two lines are enough, our WombatDialer is free to use. l. 2012/12/29 bilal ghayyad <bilmar_gh at yahoo.com>> > 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). > >-- Loway - home of QueueMetrics - http://queuemetrics.com Test-drive WombatDialer beta @ http://wombatdialer.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130102/bce5a4aa/attachment.htm>
Doesn?t the OP wish to page all phones? So it?s not an issue of dumping dozens of call files all at once. Does paging work? http://www.voip-info.org/wiki/view/Asterisk+cmd+Page http://www.voip-info.org/wiki/view/Asterisk+Paging+and+Intercom Overhead paging might also be something to consider, requiring just one call to page ?everyone.? --Don From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Lenz Emilitri Sent: Wednesday, January 02, 2013 5:15 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Paging for Praying How many people do you plan to page? because if numbers are high (or variable) you may have an easier life by using some sort of dialer.... if numbers are not very high and two lines are enough, our WombatDialer is free to use. l. 2012/12/29 bilal ghayyad <bilmar_gh at yahoo.com> 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). -- Loway - home of QueueMetrics - http://queuemetrics.com Test-drive WombatDialer beta @ http://wombatdialer.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130102/2aaafd0a/attachment.htm>
Thanks for the help. As I see that the call file is used to generate calls, can I use this technique to page the Phones? It is one wave file only that need to be Paged for all the Phones connected on the Asterisk PBX. When I say Paging, I mean that they are going to hear the sound from the speaker (without pickup the handset). By using AMI, then I can build PHP script that will use the AMI to do the Page? Thanks and Regards Bilal> > >> A call file is a text file that you create. The > format is very > >> specific. > > On Tue, 1 Jan 2013, bilal ghayyad wrote: > > > * How can I know this format? Because I need to know > what should I place > > in this file so it will execute Paging for this group > of Phones? > > This may help: > > ??? http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out > > >> How many customers will be receiving these > reminders? > > > * It is required that all the employers at the company > to hear this on > > their IP Phones. > > In my experience, you can't just dump xxx call files into > the outgoing > directory. If you expect more than a dozen or so, you'll > have to move them > in blocks as they are processed. Another good reason to use > AMI. > > >> You can 'schedule' a call file to be processed in > the future by setting > >> the file's 'mtime.' > > > * Can you explain for me please? > > Create a file named fajr containing: > > ??? application:??? playback > ??? channel:??? sip/bilal > ??? data:??? > ??? fajr-in-10-minutes > > Copy the file to a directory we assume is on the same file > system as > /var/spool/asterisk/outgoing/: > > ??? cp\ > ??? ??? fajr\ > ??? ??? > /var/spool/asterisk/tmp/ > > Set the file's 'mtime' > > ??? touch\ > ??? ??? --date='now + 2 > minutes'\ > ??? ??? --time=mtime\ > ??? ??? ??? > /var/spool/asterisk/tmp/fajr > > Move it to the outgoing directory: > > ??? mv\ > ??? ??? > /var/spool/asterisk/tmp/fajr\ > ??? ??? > /var/spool/asterisk/outgoing/ > > Your phone should ring in about 2 minutes. > > You may want to look into setting 'auto-answer' or some sort > of 'overhead > paging' with a very discreet sound file like a short, single > beep. > > Please consider AMI if you are looking for a robust > service.
Thanks for the help and it seems I deleted some of my emails by mistake ! I am sorry if I repeated my question. As I see that the call file is used to generate calls, can I use this technique to page the Phones? It is one wave file only that need to be Paged for all the Phones connected on the Asterisk PBX. When I say Paging, I mean that they are going to hear the sound from the speaker (without pickup the handset). By using AMI, then I can build PHP script that will use the AMI to do the Page? Thanks and Regards Bilal> ------------------------------ >> >> A call file is a text file that you create. The > format is very > >> specific. > > On Tue, 1 Jan 2013, bilal ghayyad wrote: > > > * How can I know this format? Because I need to know > what should I place > > in this file so it will execute Paging for this group > of Phones? > > This may help: > > ??? http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out > > >> How many customers will be receiving these > reminders? > > > * It is required that all the employers at the company > to hear this on > > their IP Phones. > > In my experience, you can't just dump xxx call files into > the outgoing > directory. If you expect more than a dozen or so, you'll > have to move them > in blocks as they are processed. Another good reason to use > AMI. > > >> You can 'schedule' a call file to be processed in > the future by setting > >> the file's 'mtime.' > > > * Can you explain for me please? > > Create a file named fajr containing: > > ??? application:??? playback > ??? channel:??? sip/bilal > ??? data:??? > ??? fajr-in-10-minutes > > Copy the file to a directory we assume is on the same file > system as > /var/spool/asterisk/outgoing/: > > ??? cp\ > ??? ??? fajr\ > ??? ??? > /var/spool/asterisk/tmp/ > > Set the file's 'mtime' > > ??? touch\ > ??? ??? --date='now + 2 > minutes'\ > ??? ??? --time=mtime\ > ??? ??? ??? > /var/spool/asterisk/tmp/fajr > > Move it to the outgoing directory: > > ??? mv\ > ??? ??? > /var/spool/asterisk/tmp/fajr\ > ??? ??? > /var/spool/asterisk/outgoing/ > > Your phone should ring in about 2 minutes. > > You may want to look into setting 'auto-answer' or some sort > of 'overhead > paging' with a very discreet sound file like a short, single > beep. > > Please consider AMI if you are looking for a robust > service. > > -- > Thanks in advance, > ------------------------------------------------------------------------- > Steve Edwards? ? ???sedwards at sedwards.com? > ? ? Voice: +1-760-468-3867 PST > Newline? ? ? ? ? ? ?