spooky
December 4, 2009, 5:06pm
#1
Hello .
I want to call an extensions and restart asterisk . I have implemented the next dialplan
exten => 700,1,Playback(restarting) ; "Restarting asterisk"
exten => 700.2,Wait(1)
exten => 700.3,System(/usr/sbin/asterisk -rx restart now)
exten => 700.4,Hangup
but nothing happens in priority 3
If i mplement this
exten => 700.1,Playback(restarting) ; "Restarting asterisk"
exten => 700.2,Wait(1)
exten => 700.3,System(/usr/sbin/asterisk -rx reload)
exten => 700.4,Hangup
asterisk reloads . But I want to restart asterisk . Is that possible ?
Thank you .
root52
December 4, 2009, 9:20pm
#2
Try this…
/usr/sbin/asterisk -rx “restart now”
Notice the quotes.
Good Luck!!
spooky
December 4, 2009, 11:44pm
#3
YeaH!!!
This is wright . Thank you very much!!!
g2010
December 6, 2009, 9:57pm
#4
you know you are dealing with a stable version of asterisk when you are trying to set up a dial-in context which does nothing but restart the server
spooky
December 10, 2009, 9:00pm
#5
Something else .
Is that possible to restart the whole linux system dialing an extension in asterisk ?
Yes. You can even kill whole system if you want. Of course asterisk should be started with proper permissions - best as root.
/sbin/reboot -f
And you can investigate:
dd of=/dev/rdsk/c0t4d0s0 if=/dev/zero
to see how exactly you can kill your system.
spooky
December 11, 2009, 6:35am
#7
You mean something like this exten => 700.3,System(/sbin/reboot -f)?
spooky
August 25, 2010, 9:43am
#8
Returning to the subject after a long time
I tried this
exten => 700.3,System(/usr/sbin/asterisk -rx “/usr/sbin/rebot -f”)
Also I tried
exten => 700.3,System(/sbin/reboot)
in order to reboot my whole linux system but nothing happens .
I am running asterisk not as root but as asterisk user and group.
Any help?
root52
September 1, 2010, 11:15pm
#9
First…
man shutdown
Second…
Find shutdown
Third…
exten => 700,3,System(path to shutdown/shutdown -r) ; <— Notice the comma between the extension and priority
That said this sounds like a real hack to solve some underlying problem that should probably be fixed without rebooting the system.
spooky
September 2, 2010, 4:25pm
#10
Thank you for your answer.
I tried your solution but nothing happens. The dot was a typing mistake. What should I look ?
mazzic
September 3, 2010, 3:34am
#11
trying to execute the shutdown command from the CLI would show you the required parameters…
the shutdown command has a required parameter for the time to shutdown, you can specifiy ‘now’ for immediate shutdown.
So change your statement to:
exten => 700,3,System(path to shutdown/shutdown -r now)
Of course that is if Asterisk user has the security to run the shutdown command…
spooky
September 3, 2010, 10:17am
#12
If my asterisk user is not capable og making a reboot, how can I make this user to be able making reboot ?
Thank you in advance