[asterisk-users] Setting system time via Asterisk

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Sep 12 21:03:40 MST 2006


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 at local.xorcom.com
icq#16849755          iax:tzafrir at local.xorcom.com
+972-50-7952406          jabber:tzafrir at jabber.org
tzafrir.cohen at xorcom.com     http://www.xorcom.com


More information about the asterisk-users mailing list