<span class="Apple-style-span" style="border-collapse: collapse; color: rgb(102, 51, 102); font-family: arial, sans-serif; font-size: 13px; ">Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?) priline=>Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)</span><div>
<font class="Apple-style-span" color="#663366" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; ">I think, you should start asterisk before executing asterisk commands</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; ">regards</span></font></div>
<div><font class="Apple-style-span" color="#663366" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br clear="all"></span></font>Juan.<br>Linux User #441131<br>
<br><br><div class="gmail_quote">On Thu, Apr 28, 2011 at 1:19 AM, virendra bhati <span dir="ltr"><<a href="mailto:virbhati@gmail.com">virbhati@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Hi,<br><br>As per you suggestion I write small php scripts but didn't get result. Below is the php script and output of programs too.<br><br><b>PHP Script:-</b><br><span style="color:rgb(51, 102, 255)"><br>
<?php</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">$priline = system('/usr/sbin/asterisk -rnx "pri show spans"',$pri);</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">$asterisk = system("/etc/init.d/asterisk status", $asterisks);</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">$mysql = system("/etc/init.d/mysql status",$mysqls);</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">echo "priline=>".$priline;</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">echo "<br>";</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">echo "pri=>".$pri;</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">echo "<br>";</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">echo "asterisk=>".$asterisk;</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">echo "<br>";</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">echo "asterisks=>".$asterisks;</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">echo "<br>";</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">echo "mysql=>".$mysql;</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">echo "<br>";</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">echo "mysqls=>".$mysqls;</span><br style="color:rgb(51, 102, 255)"><span style="color:rgb(51, 102, 255)">echo "<br>";</span><br style="color:rgb(51, 102, 255)">
<span style="color:rgb(51, 102, 255)">?></span><br><br><b>Output:-</b><br><br style="color:rgb(102, 51, 102)"><span style="color:rgb(102, 51, 102)">Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
priline=>Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)</span><br style="color:rgb(102, 51, 102)"><span style="color:rgb(102, 51, 102)">pri=>1</span><br style="color:rgb(102, 51, 102)">
<span style="color:rgb(102, 51, 102)">asterisk=></span><br style="color:rgb(102, 51, 102)"><span style="color:rgb(102, 51, 102)">asterisks=>127</span><br style="color:rgb(102, 51, 102)"><span style="color:rgb(102, 51, 102)">mysql=></span><br style="color:rgb(102, 51, 102)">
<span style="color:rgb(102, 51, 102)">mysqls=>127</span><div><div></div><div class="h5"><br><br><br><div class="gmail_quote">On Wed, Apr 27, 2011 at 8:43 PM, Juan David Diaz <span dir="ltr"><<a href="mailto:juanchonk@gmail.com" target="_blank">juanchonk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi:<br><br><div><a href="http://php.net/manual/en/function.system.php" target="_blank">http://php.net/manual/en/function.system.php</a><br>
<br></div><div>Then, the commands you shoul run:<br><br></div><div>/usr/sbin/asterisk -rnx"pri show spans"</div>
<div>/etc/init.d/asterisk status</div><div>/etc/init.d/mysql status</div><div>.</div><div>.</div><div>.</div><div>.</div><div>and so on!!</div><div><br></div><div>good luck!</div><div><br></div><div>Regards.</div><div><br>
</div><div>Juan.<br>Linux User #441131<br>
<br><br><div class="gmail_quote"><div><div></div><div>On Wed, Apr 27, 2011 at 6:22 AM, virendra bhati <span dir="ltr"><<a href="mailto:virbhati@gmail.com" target="_blank">virbhati@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div>
<div dir="ltr">Hi <br><br>How to know status of Asterisk,Mysql. PRI lines and other services from PHP scripts ? <br clear="all"><div dir="ltr"><br>----<br>Thanks and regards<br><br> Virendra Bhati<br><a href="tel:%2B91-9172341457" value="+919172341457" target="_blank">+91-9172341457</a><br>
</div>
<br>
</div>
<br></div></div>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br></div></div>-- <br><div dir="ltr">
<br><br>
<br>-----<div class="im"><br>Thanks and regards<br><br> Virendra Bhati<br><a href="tel:%2B91-9172341457" value="+919172341457" target="_blank">+91-9172341457</a><br></div></div><br>
</div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div>