Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Entering code to restart the machine


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
bilmar_gh at yahoo.com
Guest





PostPosted: Wed Feb 27, 2008 4:24 am    Post subject: [asterisk-users] Entering code to restart the machine Reply with quote

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.

Any help?

Regards
Bilal
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
Back to top
atik.khan at gmail.com
Guest





PostPosted: Wed Feb 27, 2008 4:35 am    Post subject: [asterisk-users] Entering code to restart the machine Reply with quote

try System() application in dialplan to execute linux reboot command.

On Wed, Feb 27, 2008 at 5:24 PM, bilal ghayyad <bilmar_gh at yahoo.com> wrote:
Quote:
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.

Any help?

Regards
Bilal


____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
abalashov at evaristes...
Guest





PostPosted: Wed Feb 27, 2008 10:26 am    Post subject: [asterisk-users] Entering code to restart the machine Reply with quote

bilal ghayyad wrote:
Quote:
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
Back to top
stotaro at totarotechn...
Guest





PostPosted: Wed Feb 27, 2008 10:37 am    Post subject: [asterisk-users] Entering code to restart the machine Reply with quote

On Wed, Feb 27, 2008 at 10:26 AM, Alex Balashov
<abalashov at evaristesys.com> wrote:
Quote:
bilal ghayyad wrote:
Quote:
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
Back to top
rjgonzale at gmail.com
Guest





PostPosted: Wed Feb 27, 2008 10:48 am    Post subject: [asterisk-users] Entering code to restart the machine Reply with quote

Steve Totaro escribi?:
Quote:
On Wed, Feb 27, 2008 at 10:26 AM, Alex Balashov
<abalashov at evaristesys.com> wrote:

Quote:
bilal ghayyad wrote:
Quote:
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
Back to top
abalashov at evaristes...
Guest





PostPosted: Wed Feb 27, 2008 11:03 am    Post subject: [asterisk-users] Entering code to restart the machine Reply with quote

Steve Totaro wrote:

Quote:
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)

Ah, yes, you are indubitably correct.

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services