I have installed Asterisk using the Ast@Home image for a client that is VoIP-a-phobic. Hence the system cannot be connected to their LAN at all - don't ask why! I have tested the clock at my installation lab, and all is fine, but they might want to set/check it. I know there is the SayUnixTime command, and it works fine to say the time. Is there a good dialplan command to test it? Best I've come across is System, but this exits non-zero. Any ideas? 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. If I then copy/paste into the shell, the command works. Is there some weird brackets or something the System command is expecting - the voip-info.org is up and down a lot at the mo. Thanks Mike
Asterisk runs as the asterisk user not as root for security reasons. Asterisk does not have permissions to set the date. to test commands from the console do an "su asterisk" first. you will then have the same permissions as your script. --- Mike Sander <mike@corporatebankinginternational.com> wrote:> I have installed Asterisk using the Ast@Home image > for a client that is > VoIP-a-phobic. > > Hence the system cannot be connected to their LAN at > all - don't ask why! > > I have tested the clock at my installation lab, and > all is fine, but they > might want to set/check it. > > I know there is the SayUnixTime command, and it > works fine to say the time. > > Is there a good dialplan command to test it? Best > I've come across is > System, but this exits non-zero. Any ideas? > > 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. > > If I then copy/paste into the shell, the command > works. > > Is there some weird brackets or something the System > command is expecting > - the voip-info.org is up and down a lot at the mo. > > Thanks > > Mike > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com >http://lists.digium.com/mailman/listinfo/asterisk-users> To UNSUBSCRIBE or update options visit: > >http://lists.digium.com/mailman/listinfo/asterisk-users>__________________________________ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs
On Apr 5, 2005 12:45 AM, Mike Sander <mike@corporatebankinginternational.com> wrote:> I have installed Asterisk using the Ast@Home image for a client that is > VoIP-a-phobic. > > Hence the system cannot be connected to their LAN at all - don't ask why! > > I have tested the clock at my installation lab, and all is fine, but they > might want to set/check it. > > I know there is the SayUnixTime command, and it works fine to say the time. > > Is there a good dialplan command to test it? Best I've come across is > System, but this exits non-zero. Any ideas? > > 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'. Peter -- Peter Bowyer Email: peter@bowyer.org Tel: +44 1296 768003 VoIP: sip:peter@bowyer.org
On Tue, Apr 05, 2005 at 09:45:54AM +1000, Mike Sander wrote:> I have installed Asterisk using the Ast@Home image for a client that is > VoIP-a-phobic. > > Hence the system cannot be connected to their LAN at all - don't ask why!Does it have a lan connection at all? If so, you could use ntpd. Setting the clock manually can have some side-effects and some services may require running.> > I have tested the clock at my installation lab, and all is fine, but they > might want to set/check it. > > I know there is the SayUnixTime command, and it works fine to say the time. > > Is there a good dialplan command to test it? Best I've come across is > System, but this exits non-zero. Any ideas? > > exten 456,1,Background(Please-set-time-mmddhhmm) > exten _.,1,System (date ${EXTEN}) >Before passing input blindly to system, you need to sanitize it. E.g: Any chance someone could dial a ';'? If so, that one can run an arbitrary shell command (as Asterisk's user). -- Tzafrir Cohen | New signature for new address and | VIM is http://tzafrir.org.il | new homepage | a Mutt's tzafrir@cohens.org.il | | best ICQ# 16849755 | Space reserved for other protocols | friend
--On Tuesday, April 05, 2005 1:02 PM +0300 Tzafrir Cohen <tzafrir@cohens.org.il> wrote:> Does it have a lan connection at all? If so, you could use ntpd.Agreed. This is present in most Linux distros and is pretty straightforward to set up.