Calling PHPAGI script from PHPAGI script

Hello Guys, :unamused: :question:

I have two AGI script written in PHP. I want to call one PHPAGI script from other PHPAGI script .
Please could you help me on, How to call PHPAGI script from PHPAGI script.

Maybe you can just do it like this in your script1:


Yes, but this ‘exec()’ function can used to execute only simple PHP scripts. The script which i have is specifically for Asterisk Gateway Interface(AGI), It needs to be handle in different context than normal PHP script.

I can call PHPAGI script from “extension.conf” file of asterisk server as bellow.

But i want to call PHPAGI script from other PHPAGI script.

Anyway Thanks for your Reply :smiley:

Not really sure what scenario you would need that. Can probably find a different solution if you can provide examples.

If you look at phpAGI site. There’s a function called “exec_agi()” so that might work.

I myself am looking for an answer for similar problem. The issue for me is, the second script is losing connection to the Speech recognition. I have to keep the ASR intact while going to the second PHPAGI