PHP and AGI


#1

OK - I have created an AGI script in PHP - however, when the dialplan runs through it - I simply get a statement that the script ran and returns 0 with nothing in the PHP script running at all! Anyone have any suggestions? Is AGI and PHP not working - is there something that needs to be installed?

My original Asterisk install was @home 2.1 then updated over time to the current 1.2.7.1 and all other updates.

Thanks!


#2

If you’re using the phpagi project, then there is a config file in /etc/asterisk called phpagi.conf. It doesn’t contain much, but make sure the debug tag is set to true.

This will print a whole bunch of debug stuff to the screen.

If you’re not using phpagi, i’d recommend it. It works very well.

Dan


#3

php works fine. If you are using AAH as mentioned, go take a look at some of the AMP AGI scripts (or FreePBX now) as a quick place to grab a template and see what they are doing. (I can’t recall - I know several are perl, but I know as at a minimum that the latest FreePBX changed dialplan.agi to php so you could look at that if nothing else.

In any event - works just fine, I have several php agi scripts.

p


#4

Thanks! I will look at the FreePBX examples as well as mess around with the debug in the config file - didn’t know it existed.

Thanks!