Where does FreePBX get its outbound caller ID from?

Recently I had to enter about 100 extensions for a customer in a day, so I did it by directly interacting with the FreePBX database tables. Everything worked fine, except the outbound caller ID part.

The table ‘users’ in the database ‘asterisk’ has the field where apparently FreePBX stores outbound caller ID information. The information in sip_additional.conf stays to its default value and has nothing to do with actual outbound caller ID.

But if I change the caller ID info in the ‘users’ table, it doesn’t change, and for outbound calls it stays the same old ID what was originally entered from the GUI, though after updating the table, you can see the new caller ID in the GUI.

Is there any text file where it stores this information? Nowhere else in the database I could find this callerID info? Then where is FreePBX getting this info from?

I can’t tell you where it is but from the many other posts around bulk loading of extensions, editing the tables directly is the WRONG way to go about it.

There is a set of functions that should be used to add and edit extensions that will take the required info and insert it into the proper locations so that it works properly. Search the sites forum postings for the word bulk and you’ll find the info along with at least two implementations being offered to have it done. One takes a db table and loads it, the other if I remember correctly takes a cvs formatted file and does it.

I know it doesn’t work for many people but I am a developer myself and know how to deal with databases and other related asterisk stuff, and I am doing this for many years now.

I’ve found out answer to my question. It gets its outbound caller ID info from /var/lib/asterisk/astdb file. That was all I wanted to know. I’ve managed to do what I wanted to do, i.e. to modify it in real time while updating extensions information from my own GUI.

zeeshan,
how are you accessing the astdb database? Are you doing it through the Asterisk Manager Interface or directly and if directly, it would be interesting to know how.

Hi Philippe.

I am doing the following:

/usr/sbin/asterisk -rx “database put AMPUSER 1234567890/outboundcid “John\ M\ White”\ <1234567890>”

I am not an expert developer like you are, but know enough to keep my things working. I googled and found php scripts for interacting with astdb, based on which I created my ColdFusion template, which executes the above command on the server.

Here is the link to the PHP script:
http://www.voip-info.org/tiki-index.php?page=Asterisk+tips+managing+CID+names

Do you have any better ideas?

nope,
was just curious if you found a way to interact with the astdb directly. I usually open a connection to the manager to interact with it. You can look into the FreePBX code base to find how that is done - it’s just a bit lighter weight, but the end result is the same.

Just make sure that you are populating all the astdb fields appropriately, there may be others that are not being populated. One thing you can do after populating the database is to execute the following URL:

http: //server.com/admin/config.php?type=setup&display=extensions&action=resetall

which will populate those tables for you (but remove any other stuff that was put there by other modules if not a fresh creation).

Thanks for your advice and the reset command. I’ll try to interact with astdb through the Manager, for which I also have code.

Hey Zeeshan / p_lindheimer ,

You guys seems to be expert on freePBX administration. I inherited a freePBX infrastructure which I have never administered before. Could I trouble you with some errors and issues I am facing? If you can give me your email addy, I will provide you with the details.

Thanks a lot in advance.

Lindheimer is the expert as he is the lead developer of FreePBX. I don’t know that much. But you can sure ask whatever questions you may have and I’ll try to answer them to the best of my knowledge. To post your questions on the forum here is a better idea, but if you want email, you can email me at [email protected].