Starting PhpAGI


Good Day!

Im not good programmer but i really like to be one especially in Asterisk PhpAGI
I have Read a lot about AGI
and @

but this things talk within the Php and AGI already.

my problem is how to go inside this Php and AGI i mean how to setup Php to work with AGI?
Please could you post your config or setting.?
Likewise, What version of PHP to integrate with asterisk CGI or CLI?
PhpAGI is being described that it iis a Class, could you please also elaborate where to put this thing so i can code php and integrate AGI?

Im stock in PHP configuration to support AGI?
What Version of Php is best for Asterisk-1.2.X or Asterisk-1.2.6?
Can I use XAMPP 1.5.1 for this? or inidividual package installation is better?
What else other requirements?

Please Help i really appreciate it


Asterisk AGI scripts communicates via input/output streams or handles, better known as STDIN (standard input), STDOUT (standard output), and STDERR (standard error).

So you could use any language you wanted, you just need to parse the input stream (STDIN) and send output back to the output stream (STDOUT).

It is extremely simple get going, if you choose to use PHP, just then the first line in your script should be “#!/usr/bin/php –q” to indicate you are using PHP to parse this script., and then the rest is just PHP.

However, it may be easier if you read the available documentation for setting up and reading/writing these streams, and to know what AGI variables are being sent from Asterisk… I would suggest a quick look at that free online manual “Asterisk the future of telephony”, it will at least get you going.

If you have any PHP experience at all, you will be up and running in a few minutes.

nope that is my slight porblem AGI programming but i have C/C++ experience.

what verions i need to install PHP CGI or CLI?

Asterisks will fire these programs as if they were fired from a command line, so the CLI is required.

so how to setup this PhpAGI class for Php that will work in Asterisk?
anybody know please help

Try CAGI then which is C API for AGI scripting.
Also AGI scripting in C leads to fast execution as its not interpretted.


thanks for suggesting other lanuage but i have installed php with sybase
support in * box and also my * box can now connect to sybaseASE in W2K
i have also tried running some php codes and access with * server.

So if i start another language i have to install it and do hard googles to make it work with asterisk.

While if i will just know how to Setup PHPAGI CLASS in my Asterisk Box
so Php codes can use it, im on the road of developing as i found out Php
has similarity with C language