Un-top-posting...

On 28 April 2011 07:19, virendra bhati <[email protected]> wrote:

As per you suggestion I write small php scripts but didn't get result. Below is the php script and output of programs too.

$priline = system('/usr/sbin/asterisk -rnx "pri show spans"',$pri);

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?)

On Thu, 28 Apr 2011, Tiago Geada wrote:

The error is pretty straight forward. It is telling you that no Asterisk service is running in that machine

Or...

The user that is executing the PHP script does not have write access to /var/run/asterisk.ctl.

Is the user executing the PHP script the same user executing the Asterisk process?

Changing the permission on /var/run/asterisk.ctl or executing 'sudo /usr/sbin/asterisk -rnx "pri show spans"' may help.

Personally, I think the 'system()' approach is a 'quick and dirty hack' and you really should be using AMI.

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       [email protected]      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to