Asterisk DB


I’m currently doing a project with asterisk to do a reminder calls by writing AGI scripts. Where I’m trying to connect a php page and on submit insert the contents into DB. And then trying to pass the stored db values to the AGI script to make the calls for the reminder.

Does asterisk have a DB? So that I can do the insert from my PHP page to asterisk DB and then call the variables in the AGI script.

Any help would be great!


Yes, Asterisk has a db and you can use it with php through agi, I suggest you to use the class phpagi, , look for the methods whose name starts with DATABASE.


Marco Bruni

It’s like Greek and Latin to me now :cry:
In general terms, I’m visualizing as if I’m connecting to MySql db to create a db called asterisk and table name Client_details.

Once the DB and Table has been created, filling-up the fields in my PHP page like, Name of candidate, Upload csv, enter text and upload wav file and on clicking submit, the details will be copied to db ( asterisk ) and table ( Client_details ) in their respective columns ( name, csv_file, text, wav_file ) created with unique ID for each client.

Once the above process is done, I need to write an AGI script to connect to the this DB with details and by passing the PHP variables. Such that it’ll schedule the call to be forwarded to the people who have been entered in the DB.

I wanted to know whether this kinda of DB process is possible with asterisk.

This is what I want to do.

Any Help!

Is there any particular reason you’re not using asterisk+mysql if you’re more comfortable with that?

More info:

The reason, this is first time I’m trying asterisk to use DB contents read from PHP page. All I have done using asterisk, is write dialplan for SIP communication between softphones installed.

I usually work with PHP and MySql most of time, so I thought maybe I could use the same method for PHP and DB connection through MySQL. Later, use AGI scripts to call the DB variables to make calls to the clients using asterisk.

Sure it is, Asterisk is able to connect to Mysql directly in the dial plan with func_odbc or through an agi script written in you favourite language.
Sorry for my previous answer, I thought you were referring to the Asterisk internal database :smile:


Marco Bruni

Personally, I would rather use MySQL… the AsteriskDB, though robust, is a bit… archaic.

Yeah, that’s what I’m trying to do too. First install phpmyadmin for MySQL GUI and then using php code, on submit copy the contents into the MySQL table and then through AGI scripts access the MySql database.