I'm fairly new to Asterisk, so please bear with me if this is silly question. I'd like to run a script on my server that would take the "Call now to order" banner off my website automatically when I put my phone system on night. I can handle the webserver side of things, but I don't know where to begin on the Asterisk side of things - can a simple script be run to check the value of the day/night condition, or is that value written somewhere that I could check or poll? Any help / ideas are really appreciated. Thanks in advance, Dunc
On Friday 12 October 2007 10:34:39 C. Duncan Hudson wrote:> I'm fairly new to Asterisk, so please bear with me if this is silly > question. I'd like to run a script on my server that would take the > "Call now to order" banner off my website automatically when I put my > phone system on night. I can handle the webserver side of things, but I > don't know where to begin on the Asterisk side of things - can a simple > script be run to check the value of the day/night condition, or is that > value written somewhere that I could check or poll? Any help / ideas > are really appreciated. Thanks in advance,See func_odbc.conf -- Tilghman
C. Duncan Hudson wrote:> I'm fairly new to Asterisk, so please bear with me if this is silly > question. I'd like to run a script on my server that would take the > "Call now to order" banner off my website automatically when I put my > phone system on night. I can handle the webserver side of things, but I > don't know where to begin on the Asterisk side of things - can a simple > script be run to check the value of the day/night condition, or is that > value written somewhere that I could check or poll?Asterisk does not have something like day/night mode built in. But you can easily do that in the dialplan. Maybe you could use some of the examples on these pages as a starting point: http://www.voip-info.org/wiki/view/Asterisk+database http://www.the-asterisk-book.com/unstable/funktionen-db.html http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial Or even http://www.google.com/search?q=asterisk+night+mode (No offense intended!) Asterisk comes with a System() or TrySystem() command ("application") which will run any shell command you want. Regards, Philipp Kempgen -- amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Let's use IT to solve problems and not to create new ones. Asterisk? -> http://www.das-asterisk-buch.de Gesch?ftsf?hrer: Stefan Wintermeyer Handelsregister: Neuwied B 14998
I guess it all depends on how you put your system on night mode. If you use asterisk's database, and manually put it in night mode every day, my guess is that you dial an extension which puts it in nightmode. You could include as part of this the system command to touch a file, and then on your webserver check for existance of that file. That may be opening up more holes than needed between your web server and asterisk. As Tilghman suggested, func_odbc.conf may be better. You could then set and unset by writing it directly to your store's database. On 10/12/07, C. Duncan Hudson <asterisk at dunc-it.com> wrote:> > I'm fairly new to Asterisk, so please bear with me if this is silly > question. I'd like to run a script on my server that would take the > "Call now to order" banner off my website automatically when I put my > phone system on night. I can handle the webserver side of things, but I > don't know where to begin on the Asterisk side of things - can a simple > script be run to check the value of the day/night condition, or is that > value written somewhere that I could check or poll? Any help / ideas > are really appreciated. Thanks in advance, > > Dunc > > _______________________________________________ > --Bandwidth and Colocation Provided by http://www.api-digital.com-- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- Lacy Moore Somewhere I wish I wasn't -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071012/76d3c209/attachment.htm
On Fri, Oct 12, 2007 at 11:34:39AM -0400, C. Duncan Hudson wrote:> I'm fairly new to Asterisk, so please bear with me if this is silly > question. I'd like to run a script on my server that would take the > "Call now to order" banner off my website automatically when I put my > phone system on night. I can handle the webserver side of things, but I > don't know where to begin on the Asterisk side of things - can a simple > script be run to check the value of the day/night condition, or is that > value written somewhere that I could check or poll? Any help / ideas > are really appreciated. Thanks in advance,If your dialplan does not poll the filesystem / database for each call, consider actively flipping a flag in Asterisk. This can be done by setting a value in the Asterisk database or setting a global variable through the manager interface or or a call file. Someone mentioned poking a hole. Unless you use sudo or something euivalent then yes, the ability to generate a call today allows quite too much. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir