How i excecute phpagi file through php page?


I have install asterisk in my local centos server. I want to save record voice message through asterisk CLI. but i want to do this from my php page.

to do this i go through in phpagi class. but still i can’t do this.

can anyone do this? please help me. please tell me step by step how i do this

So you want to record in the dial plan and then play them form a php page ? Easiest idea I can think of is each time you record a call save the info on the call into a db (via an AGI) and then have your php fetch this info from the db and have URL’s on the php to where the files are.


  1. you must download phpagi from
  2. extract *.php file in /var/lib/asterisk/agi-bin (this the path when you must locate your scripts!)
  3. create your first simple script and test it!
  4. for test it you can write in extension_custom.conf

and call 9000 from your phone.

  1. Don’t forget to use chmod 755 to execute the scripts!

contact me if you have any question