[App_rpt-users] Set time remotely-SOLVED w/ radio dtmf !

mike at midnighteng.com mike at midnighteng.com
Wed Mar 22 08:13:06 UTC 2017


A means to set system clock with DTMF RADIO COMMANDS.

First I want to point out several things.
Read the warnings at the bottom.
This is not a perfect thing, but a framework to meet a end need.
You will likely need to make adjustments to it for your particular
circumstance(s).

It was intended for Acid users who have no internet connection on
their system but can be adapted to fit many situations.
While there are more than a dozen ways to do the same thing, 
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.

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
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.

SO, I am implementing this from the phone patch.

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

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.

In extensions.conf
just under [radio] 

[radio]
exten = _Axxxx,1,Goto(set_time_clock|${EXTEN:1}|1)   ;set time, send
to subscript without leading digit

(place the rest at the end of extensions.conf file....)

[set_time_clock]; by kb8jnm
exten =_X.,1,Wait(5)
exten =_X.,2,Playback(rpt/thetimeis)
exten =_X.,3,SayAlpha(${EXTEN})       ; Read back Dialed Number
for time
exten =_X.,4,Wait(10)                  ; allow 10
seconds to hang-up (*0 ) if not correct
exten =_X.,5,System(date +%T -s "${EXTEN:0:2}:${EXTEN:2:2}:00")
;format 'HH:MM:00' - 24hr format
exten =_X.,6,System(reboot)
exten =_X.,7,Hangup

Warnings:
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.
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.

I am thinking of you folks that have unconnected mountain top systems
you can't get to if a problem arises.
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.

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.
Probably better to hand the extension data off to a shell script,
shutdown asterisk, set-clock, restart asterisk & exit.
But this is simple and with the full reboot, resets 'all' system
timers before 'any' can be a problem. Unless you change that.

But it is a bit belated reply to Steve/ KB8BIW's request last year.

73,
...mike/kb8jnm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.keekles.org/pipermail/app_rpt-users/attachments/20170322/eef1d5c9/attachment.html>


More information about the App_rpt-users mailing list