Looking at a Asterisk server which will not be attached to the Internet - and the user will be pretty computer illiterate. Has anyone seen a script or some mechanism to set the server time by using an extension, and entering the date/time via the keypad? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060910/70fa2381/attachment.htm
You could probably build one easily. Create a context in extensions.conf that answers the call, asks them the time, saves the digits as a variable, then passes these variables as arguments to a shell script using the System() application. Create a shell script that takes it's arguments and uses them to set the clock. On September 10, 2006 19:51, Gary Eck wrote:> Looking at a Asterisk server which will not be attached to the Internet - > and the user will be pretty computer illiterate. Has anyone seen a script > or some mechanism to set the server time by using an extension, and > entering the date/time via the keypad? Thanks!-- Tim St. Pierre IP telephony specialist sip://5101@communicatefreely.net Toronto: 647 722 6930 Toll-Free 1 888 488 6940 tim@communicatefreely.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20060911/2c8d8357/attachment.pgp
Gary Eck wrote:> Looking at a Asterisk server which will not be attached to the Internet > - and the user will be pretty computer illiterate. > Has anyone seen a script or some mechanism to set the server time by > using an extension, and entering the date/time via the keypad? > Thanks!A more accurate system is to use the government's dial time service. You call the service with a modem and use special software to set the time. There is source code at that web site that will supposedly compile and run on linux. This is independent of Asterisk. It needs a regular dial up modem and a one minute long distance call to Colorado. http://tf.nist.gov/service/acts.htm
On Sun, Sep 10, 2006 at 06:51:30PM -0500, Gary Eck wrote:> Looking at a Asterisk server which will not be attached to > the Internet - and the user will be pretty computer illiterate. > Has anyone seen a script or some mechanism to set the server time by > using an extension, and entering the date/time via the keypad? > Thanks!This can be implemented by a call to date (prefferebly with hwclock --systohc later on). However both of those should run as root. You can use Read to get the date and time (with fields separated by '#': separate Reads). And then pass the resulting numbers to a script via System or AGI. That script will do basic sanity tests and call date/hwclock via sudo. BTW: one of the things you must do is make sure no '*' get from the number to the sudo-d commands. Read already takes care of the '#'. -- Tzafrir Cohen sip:tzafrir@local.xorcom.com icq#16849755 iax:tzafrir@local.xorcom.com +972-50-7952406 jabber:tzafrir@jabber.org tzafrir.cohen@xorcom.com http://www.xorcom.com