[asterisk-users] Entering code to restart the machine
Rodrigo Gonzalez
rjgonzale at gmail.com
Wed Feb 27 09:48:11 CST 2008
Steve Totaro escribió:
> 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
>
If asterisk is not running as root allow asterisk user to reboot adding
to /etc/sudoers for example and...
exten=777,n,system(sudo reboot)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080227/3d3e8f93/attachment.bin
More information about the asterisk-users
mailing list