Help on Setting up a MySQL database for CallerID Lookup Source

I am using Asterisk PhoneBook now for CallerID Lookup source and also for system speed dial. When my buiness grows, I feel that I need to seperate the CallerID lookup source and the system speed dial.

I read a few posts here about setting up a MySQL database as CallerID lookup source. Anyone can give me a hint on where to build a MySQL database, within FreePBX/trixbox, or a completely seperate place? If within FreePBX, where to build a MySQL?

Thanks and happy new year!

Need help again.

I created a MySQL database called “CallerID” and I also created 2 tables: one as “Dept1_CallerID” and the other one as “Dept2_CallerID”. I imported my caller ID list into the 2 tables. Each of the table has 2 variables: “number”, as the index, and “name”.

I went to the CallerID Lookup source module, and set up one srouce for Dept1
Source Description: Dept1
Database: CallerID
Query: SELECT name FROM Dept1_CallerID WHERE number LIKE '%[NUMBER]%'
Username: root
Password: “password” — my own password

I also created the looup source for Dept2 as:
Source Description: Dept2
Database: CallerID
Query: SELECT name FROM Dept2_CallerID WHERE number LIKE '%[NUMBER]%'
Username: root
Password: “password” — my own password

I went to the Inbound model and picked up one DID to use Lookup source of Dept1 and another DID to use Dept2.

When I tested the call, the callerID did not work. Any ideas where I did wrong?

Great! Very clear instruction, thanks!

This link can provide some help:
http://samyantoun.50webs.com/asterisk/freepbx/calleridlookup/

I want to use the sugarcrm database contacts. I create everything as listed above with the uname and pword for the database I query the phone_work field and try to return last_name. I cannot seem to get it to work.

I am using the latest version of trixbox. Any help would be greatly appreciated.

You can’t use percentage in the current version of freepbx.
this won’t work: SELECT name FROM Dept2_CallerID WHERE number LIKE ‘%[NUMBER]%’

This works: SELECT name FROM Dept2_CallerID WHERE number = ‘[NUMBER]’