Need urgent help

Hi. i am quite new in asterisk. i am tring to develop a messaging system which will work in following way:

when a user call to a specific extention, asterisk will call a agi script which will
do the following: it will take the caller id and search a SQL Server DB with that caller id and extract message for that caller id from database and read back to the caller.

Can any one provide me any PHP agi script which can read the caller id , search a SQL server with that caller id and read back to the caller. please help me anyone… :cry:

It is possible to do what you want. You’re going to need a TTS engine such as Festival, Flite, or Cepstral. If you are looking for someone to write the script for you, you may want to try the jobs forum.
If you are writing the script yourself and need help, post here where you are struggling and someone may be able to help.

AGI information can be found here:

The Asterisk book is here (Chapter 9 discusses AGI’s):

dear davevg,
thanks for the help. i already read those docs. if there is any document which describe AGI scripting with php in more details with example please send me the link. and if i want AGI to read a value stored in variable which command should i use. Example: i have a variable $cli in which caller name is stored.

i wrote following statement and getting error:

echo “SAY TEXT $cli \n”;

I’m pretty sure all of the Nerd Vittles agi scripts are PHP. (I don’t use them, nor much PHP) So if you want an example, may want to look at one of their scripts. This is probably an example which is the closest to what you are trying to do (DB Lookup and Text to Speech).

Thanks man. i need this kind of example script. i think now i can modify this according to my requirement. thanks again