[asterisk-users] Restarting Asterisk using a script - Thanks to all -

Aurimas Skirgaila a.skirgaila at gmail.com
Mon Mar 29 02:36:30 CDT 2010


Hi,

1) It would be nice to find out the root reason that forces you to
restart the Asterisk. I do run Aheeva with decently high uptimes.

2) Both "a" and "b" methods of Jose P. Espinal are functional, but if
I'm having a failure, I up to grab the putty and investigate what's
going on there :) How often are you having them?

3) what's the another service related to Aheeva, that requires to be restarted?



>
> Hi there,


a. You could (maybe) use PHP and send some command via POST, and (after

secure/validating the command) use 'exec()' function in php, or


'system()' function.


Note: that would require to have a webserver with php installed on it.

And allowing the user under which the webserver runs, to restart


asterisk via sudoers file.


b. You could use a shellscript that sends the command via SSH.


In order to avoid password prompt, you could generate a RSA (or DSA) key


pair on the machine that will send the command, and copy the rsa_key.pub

content on your asterisk box 'authorized_keys'.


That would allow you to execute the command remotely via SSH without


having to insert the password manually.


Note: you could consider using a very limited user on the asterisk box,

and with sudoers file allowing it just to restart Asterisk.




Regards,


Amine Mrichcha wrote:

> Hi All,

>


> I do have asterisk installed for a call center and I would like to know

> if it is possible to create a scipt and execute it from a PC connected

> to the Network without accessing the server. This script should restart


> asterisk and another service related to aheeva.

>

> The problem now is that each time I have to access using PUTY to the

> server to start and run services manually.


>

> Service asterisk restart

>

> Any help would be appreciated, sorry if it is a newbie question.


>

> Regards,

>

> Am

>


-- 

Jose P. Espinal


http://www.eSlackware.com <http://www.eslackware.com/>

IRC: Khratos @ #asterisk / -doc / -bugs





-- 
Mvh,
Aurimas Skirgaila
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100329/6816314e/attachment.htm 


More information about the asterisk-users mailing list