[Asterisk-Users] Set system time over the phone

Roman Volf volfman at keystreams.com
Mon Apr 4 23:48:02 MST 2005


Another way is to do:

exten 456,1,Background(Please-set-time-mmddhhmm)
exten _.,1,System (echo ${EXTEN} > /tmp/datetime )


Then have a cron job that runs every minute to check if file exists. For 
example:


#!/bin/bash

if [ -f /tmp/datetime ] 
then
  date `cat /tmp/datetime`
  rm -f /tmp/datetime
fi



This should work fine.



Roman Volf
Keystreams Internet Solutions
volfman at keystreams.com



Matt Riddell wrote:

> Peter Bowyer wrote:
>
>>> exten 456,1,Background(Please-set-time-mmddhhmm)
>>> exten _.,1,System (date ${EXTEN})
>>>
>>> If I dial 456 I get the message, so I type 04021305 (2nd April, 13:05).
>>>
>>> On the console Asterisk reports the command Dial 04021305 exits 
>>> non-zero.
>>
>>
>> You need 'Read' instead of 'Background'.
>
>
> No, because his next line is _.,1 so it will actually use the extension.
>
> His problem is just one of permissions.  Maybe he should use a suid 
> prog to set the date.
>



More information about the asterisk-users mailing list