http service for asterisk

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

http service for asterisk

Postby system32 » Wed Dec 09, 2015 4:31 am

hello all

how i can execute asterisk commands (example: sip show peers) with http request..

Code: Select all
<?php

    $aster = exec("/usr/sbin/asterisk -rx 'sip show peers'");
    echo $aster;

?>


and output is :

Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
system32
Newsterisk
 
Posts: 13
Joined: Wed Mar 11, 2015 7:13 am

Re: http service for asterisk

Postby david55 » Wed Dec 09, 2015 4:52 am

That error normally means Asterisk isn't running, although it could be mis-reporting of a permissions problem.

This is access from a daemon, not specifically HTTP access.

What is wrong with using AMI for this?
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: http service for asterisk

Postby system32 » Wed Dec 09, 2015 7:42 am

thanks for reply

i think too that it's permission problem..

AMI ? its not problem but i want with this way..
system32
Newsterisk
 
Posts: 13
Joined: Wed Mar 11, 2015 7:13 am

Re: http service for asterisk

Postby ambiorixg12 » Wed Dec 09, 2015 2:47 pm

ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: http service for asterisk

Postby _alx_ » Thu Dec 10, 2015 2:12 am

Check if apache uses asterisk or root user to execute.
_alx_
Oldsterisk
 
Posts: 57
Joined: Fri Oct 16, 2015 1:48 am

Re: http service for asterisk

Postby system32 » Thu Dec 10, 2015 4:30 am

thanks all its apache permission group problem.

all done
system32
Newsterisk
 
Posts: 13
Joined: Wed Mar 11, 2015 7:13 am


Return to Asterisk Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest