Phone Book

Does any one have a way of accessing the Phone book. I want to be able to have dynamic updates to it from an external database, however I do not know how to access the one in FreePBX. I know it is a Berkely DB but cannot find it or see an external way to access it.


ok maybe I’m a bit slow but exactly what are you refering to as the phone book? The directory you get when hitting #, or something else.

The phone book module. It’s records are stored in a berkely db. But I cannot find any way to connect. Was thinking of doing an ODBC connection just as I do now to the mysql database.

I’ve not played with that one for the same reason. The code for it is located at /var/lib/asterisk/agi-bin/pbdirectory. it is very close to the code for /var/lib/asterisk/agi-bin/directory which I’ve made changes to to integrate multiple boxes together into one unified phone/employee directory. but yet different enough that I know my changes will not work as it’s doing a DB connection.

Asterisk uses berkely db v1 (which is very, very old) as it’s internal database, and it’s not designed for concurrent access. Sqlite would have been a MUCH better choice (fwiw, callweaver has already replaced it with sqlite). So the unfortunate answer is there is no really easy way to get at the database.

The only way to update it externally is to use asterisk manager interface, which incidentally is what freepbx does. There’s a PHP class called asteriskmanager which is what we use to do it - I’d suggest you start there.

Greg MacLellan - Core FreePBX Developer
http// - #freepbx

Thanks Greg. I think I will leave that one be then as I have very limited php knowledge and don’t want to mess anything up.

If I can then put in a feature request to have a better phone book. One that runs on mysql that would be easier for add-delete-updates.


creating an external layer to update the phone book through the manager is not a difficult thing. If you have a business need for it and are not strong with php you can also consider contracting to have it done. unless you have some elaborate requirement it would probably not be a significant cost.

Philippe Lindheimer - FreePBX Project Lead
http// - IRC #freepbx