[asterisk-users] Entering code to restart the machine

Steve Totaro stotaro at totarotechnologies.com
Wed Feb 27 09:37:46 CST 2008


On Wed, Feb 27, 2008 at 10:26 AM, Alex Balashov
<abalashov at evaristesys.com> wrote:
> bilal ghayyad wrote:
>  > Hi All;
>  >
>  > How can I configure Asterisk in that way:
>  >
>  > If I entered code (from my mobile when I call to the
>  > Asterisk or from any Internal Phone), then the machine
>  > do restart. I need this when I am far from the office
>  > and I need to restart the machine and I do not have
>  > Internet connection.
>
>  The safest way is to call an AGI script (or System command or whatever)
>  from the dial plan that uses some IPC mechanism to pass a message to an
>  outside cron job that runs periodically and checks for this flag, and if
>  so, restarts asterisk from the CLI ('asterisk -r -x 'stop now'; sleep
>  10; asterisk).
>
>  The sleep is desirable because the 'stop now' command is asynchronous
>  and Asterisk does not necessarily shut down instantaneously when you
>  issue it.
>
>  --
>  Alex Balashov
>  Evariste Systems
>  Web    : http://www.evaristesys.com/
>  Tel    : (+1) (678) 954-0670
>  Direct : (+1) (678) 954-0671
>  Mobile : (+1) (706) 338-8599
>

The way I read the OP, he wishes to reboot the box, not just restart
asterisk.  In which case, simply having
exten=777,1,Authenticate(whatever)
exten=777,n,System(reboot)

Would be the easiest and somewhat protected way of rebooting.

Thanks,
Steve Totaro



More information about the asterisk-users mailing list