Http service for asterisk

hello all

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

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

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?

thanks for reply

i think too that it’s permission problem…

AMI ? its not problem but i want with this way…

Use AMI and also read about wiki.asterisk.org/wiki/display/ … AE85B7546F

Check if apache uses asterisk or root user to execute.

thanks all its apache permission group problem.

all done