<html><body style="font-family: Helvetica,Arial,sans-serif; font-size: 12px;">A means to set system clock with DTMF RADIO COMMANDS.<br><br>First I want to point out several things.<br>Read the warnings at the bottom.<br>This is not a perfect thing, but a framework to meet a end need.<br>You will likely need to make adjustments to it for your particular circumstance(s).<br><br>It was intended for Acid users who have no internet connection on their system but can be adapted to fit many situations.<br>While there are more than a dozen ways to do the same thing, <br>I
chose this one to show to the group for the simplicity of
implementation to those that are not as linux savvy, but have learned
asterisk somewhat.<br><br>If you are in the US and have had the same
system running for many years without updating the zoneinfo files, you
should do that and copy the new timezone file to your /etc/localtime<br>because
the Daylight savings time that changed a few years ago has probably
been giving you some frustration on the time change twice or four times a
year.<br><br>SO, I am implementing this from the phone patch.<br><br>By
default, (*6) +A+ HHMM is all the dtmf you would need to enter the time
in 24hr format. example *6A1345 will set the clock to 1:45pm<br><br>I
chose 'A' as the dialing catch since it is unlikely to be in your normal
phone extensions and this is intended for no internet service installs.<br><br>In extensions.conf<br>just under [radio] <br><br>[radio]<br>exten = _Axxxx,1,Goto(set_time_clock|${EXTEN:1}|1) ;set time, send to subscript without leading digit<br><br>(place the rest at the end of extensions.conf file....)<br><br>[set_time_clock]; by kb8jnm<br>exten =_X.,1,Wait(5)<br>exten =_X.,2,Playback(rpt/thetimeis)<br>exten =_X.,3,SayAlpha(${EXTEN}) ; Read back Dialed Number for time<br>exten =_X.,4,Wait(10) ; allow 10 seconds to hang-up (*0 ) if not correct<br>exten =_X.,5,System(date +%T -s \"${EXTEN:0:2}:${EXTEN:2:2}:00\") ;format 'HH:MM:00' - 24hr format<br>exten =_X.,6,System(reboot)<br>exten =_X.,7,Hangup<br><br>Warnings:<br>Adjusting
the timeclock on a live system can have unknown affect on things that
are running relying on timers. So at a minimum, shutdown links before
adjusting the clock.<br>If you have much a time slippage in your clock, adjust it more often or when it gets 2 minutes or so out of time.<br><br>I am thinking of you folks that have unconnected mountain top systems you can't get to if a problem arises.<br>So,
To avoid many unexpected problems that can occur in system timers
mis-match, the system will reboot right after setting the clock. I
suggest you leave that in place unless you have good reason to take it
out. But you have been warned.<br><br>If you like it... great... if you don't like it... make it better and shove it out to the group for others to improve on.<br>Probably better to hand the extension data off to a shell script, shutdown asterisk, set-clock, restart asterisk & exit.<br>But this is simple and with the full reboot, resets 'all' system timers before 'any' can be a problem. Unless you change that.<br><br>But it is a bit belated reply to Steve/ KB8BIW's request last year.<br><br>73,<br>...mike/kb8jnm</body></html>