<div class="gmail_quote"><span style="font-family:'Times New Roman';font-size:medium"><pre>Hi,</pre><pre>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.</pre>
<pre>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?</pre>
<pre>3) what's the another service related to Aheeva, that requires to be restarted?</pre><pre><br></pre><pre><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
Hi there,</blockquote><blockquote><br></blockquote><blockquote>a. You could (maybe) use PHP and send some command via POST, and (after </blockquote><blockquote>secure/validating the command) use 'exec()' function in php, or </blockquote>
<blockquote>'system()' function.</blockquote><blockquote><br></blockquote><blockquote>Note: that would require to have a webserver with php installed on it.</blockquote><blockquote>And allowing the user under which the webserver runs, to restart </blockquote>
<blockquote>asterisk via sudoers file.</blockquote><blockquote><br></blockquote><blockquote>b. You could use a shellscript that sends the command via SSH.</blockquote><blockquote><br></blockquote><blockquote>In order to avoid password prompt, you could generate a RSA (or DSA) key </blockquote>
<blockquote>pair on the machine that will send the command, and copy the rsa_key.pub </blockquote><blockquote>content on your asterisk box 'authorized_keys'.</blockquote><blockquote><br></blockquote><blockquote>That would allow you to execute the command remotely via SSH without </blockquote>
<blockquote>having to insert the password manually.</blockquote><blockquote><br></blockquote><blockquote>Note: you could consider using a very limited user on the asterisk box, </blockquote><blockquote>and with sudoers file allowing it just to restart Asterisk.</blockquote>
<blockquote><br></blockquote><blockquote><br></blockquote><blockquote>Regards,</blockquote><blockquote><br></blockquote><blockquote>Amine Mrichcha wrote:</blockquote><blockquote>> Hi All,</blockquote><blockquote>> </blockquote>
<blockquote>> I do have asterisk installed for a call center and I would like to know </blockquote><blockquote>> if it is possible to create a scipt and execute it from a PC connected </blockquote><blockquote>> to the Network without accessing the server. This script should restart </blockquote>
<blockquote>> asterisk and another service related to aheeva.</blockquote><blockquote>> </blockquote><blockquote>> The problem now is that each time I have to access using PUTY to the </blockquote><blockquote>> server to start and run services manually.</blockquote>
<blockquote>> </blockquote><blockquote>> Service asterisk restart</blockquote><blockquote>> </blockquote><blockquote>> Any help would be appreciated, sorry if it is a newbie question.</blockquote><blockquote>
> </blockquote>
<blockquote>> Regards,</blockquote><blockquote>> </blockquote><blockquote>> Am</blockquote><blockquote>> </blockquote><blockquote><br></blockquote><blockquote>-- </blockquote><blockquote>Jose P. Espinal</blockquote>
<blockquote><a href="http://www.eslackware.com/" target="_blank">http://www.eSlackware.com</a></blockquote><blockquote>IRC: Khratos @ #asterisk / -doc / -bugs</blockquote></pre></span><blockquote><br></blockquote><blockquote>
<br></blockquote></div><br clear="all"><br>-- <br>Mvh,<br>Aurimas Skirgaila<br>