Caller ID Lookup Sources

This module provides the ability to specify Sources where inbound calls can have their Caller ID looked up so Caller ID Names can be used or changed.

The Caller ID Lookup Sources module enables your FreePBX system to lookup Caller Names that are related to your number whether they be in your phonebook, in a database, or via an HTTP lookup. The module can also be used with scripts in the agi-bin directory of your asterisk configuration.

------------------------------------------------------------------
Add Source

A Lookup Source let you specify a source for resolving numeric caller IDs of incoming calls, you can then link an Inbound route to a specific CID source. This way you will have more detailed CDR reports with information’s taken directly from your CRM. You can also install the phonebook module to have a small number <-> name association. Pay attention, name lookup may slow down your PBX.

Source Description: A description for this source.

Source Type: Choose the source type.
Internal: uses astDB as a lookup source. Use the phonebook module to populate it.

ENUM: Uses DNS to look up the callers Name; it uses ENUM lookup zones as configured in enum.conf

HTTP: This executes an HTTP GET passing the caller number as an argument to retrieve the correct name.

MySQL: the queries a MySQL database to retrieve the caller name.

Cache results - Decide whether or not to cache the results to a astDB; it will overwrite present values. It does not affect internal source behavior.

----------------------------------------------------

HTTP Lookup Configuration:

Configuring the module to lookup a Caller Name (cn) via http lookup is simple. Most http lookup providers will provide you with a string you'll need to query with (query string). We'll need to break up the string into it's various components to populate the CID Lookup Source Fields.

For the purposes of this tutorial, i'm going to use configuring metrostat as an http provider. They expect queries in the form: http://cnam1.edicentral.net/getcnam?q=C&f=S&dn=[NUMBER] where [NUMBER] is a 10 digit telephone number.

Source Description: Metrostat
Source Type: HTTP
Cache Results: (leave this unchecked)

Host: cnam1.edicentral.net
Port: (leave blank)
Username: (leave blank)
Password: (leave blank)
Path: /getcnam
Query: ?q=C&f=S&dn=[NUMBER]

ok.. so let's break this up so that we can see what we did. Source Description is nothing more than a name you want to call the lookup source. Since it's metrostat, we're just going to call it metrostat.

Source Type: Here, we can specify whatever the lookup source type that is supported for the query. In this particular case, it's an http lookup so we're going to specify http.

Cache Results: You can check this and the system will keep successful lookups for future use, thus eliminating excessive remote lookups for numbers that have already called you in the past.

Host: This is the hostname or IP address of the host you'll be querying. In our example, it's cnam1.edicentral.net.

Port: You can pass your query to any port that is running httpd. This is usually left blank if it's on the standard port (80). In our example, we're leaving it blank, because it's on the standard http port.

Username and Password fields: The username you're issued by the provider if it's needed, otherwise, it's blank. In this case, it's blank. This goes for the password as well.

Path: This is the first thing after the hostname (including the slash. Up to, but NOT including the '?' symbol. That's reserved for the query line otherwise it just won't work.

Query: This is everything after the Path entry. In our example, we had '/getcnam' so we'd be putting the following in here. '?q=C&f=S&dn=[NUMBER]'. The [NUMBER] variable will automatically be filled in with the incoming caller number.

After you've filled out and submitted your changes (remember to hit apply changes), go to the incoming route and select the appropriate caller id lookup source, submit the changes, and apply and you're good to go! enjoy!

Taxonomy upgrade extras: 

Comments

Jibade's picture

I have interfaced my Avaya Definity with Asterisk. I can get Caller ID information to the Cisco phones on the asterisk but cannot get the system to Lookup the names from the Internal Address Book where they are populated. I have setup the Caller Name Lookup Source to "Internal" and setup an Inbound Route through the Zaptel Channel (Sangoma E1 card). I still cannot get Asterisk to Lookup the names from the internal source.

billetkontoret's picture

If no documentation is available how the heck can I know how to set up my mysql database so that this module can pull info from it ??

cosmicwombat's picture
lamthenhan's picture

I have small problem when deploy a call center ... have a requirement of my customer is :

"When a familiar customer make call into Call Center, if Asterisk system known Caller Number, Can this system route the call to assigned agent (maybe via database have 2 field Customer No. and Agent ) ? ". For follow example :

Inbound Call :

Customer No. Agent
8776352536 101
8236482927 102
9872636482 103
8364818153 201
... ...
if can't lookup Caller No. so will route this call into Queue as normal !
I think CID Lookup Source module can solve this requirement ... but i don't have any ideal !
(This is my ideal :

incoming call ---> CID Lookup source ---> Caller No. found ----> assigned Agent
----> Caller No. not found -----> Queue

Please give some ideal about this problem !
Thanks all !

Steven Lam (R&D Manager)
Mobile No. : +84918633646
Bussiness No. : +845126377 (Ext : 150)

NTT Network Co.,Ltd
Tel: (+84.8)3 92 93 228
Emai:

liku's picture

Since Freepbx 2.4 i found that CID source using Asterisk Phonebook work great!.

For now im a the beginning and im workin to implement remote sources [http]

Hey Misters from the freepbx team:

Big up and many thanks for al your great work!

cheers

liku

maxlyth's picture

I am using the the internal Asterisk Phonebook in FreePBX 2.4 for lightweight CID lookup but it does not work for DirectDial entries created directly on Extensions. Instead you have to delete the Extension DID and create a seperate inbound route that forwards to the extension.

You would think that associating a CID lookup source with the anyDID/anyCID inbound route would then use the CID lookup source for all DIDs created by extensions. Is this in purpose and is there a simpler workaround?

sysrq's picture

whitepages.com supports developer API, and http queries to do reverse number lookup, has anyone successfully made this work in freePBX?

mdalacu's picture

can this also work the other way around?
Ex. a name from phonebook insted of the dialed number in CDR ?

dennislv's picture

I signed up for Metrostat like you have used in your example. For $30 I expect more than the location of the NPA-NXX. EVERY number I run only give me the location. What a rip-off!

skybus's picture

There is now a revised CNAM script that will look up the asterisk phonebook, asteridex4, and a number of external web sites, including sites that provide phone spam estimates. See the Google Code project at:

http://code.google.com/p/freepbx-utils/

skybus's picture

What was the original reasoning for making the host, port, path, and query fields separate in the Caller ID Lookup Sources module? In effect, this forces the user to manually parse a URL and break it up into four fields, and then enter each manually. It prevents the user from simply doing a copy-and-paste of a URL.

If the user could have just entered a complete syntactically correct URL, the code within the module could have parsed it with a single call to the standard PHP parse_url() function or, at worst, with a few lines of explicit PHP. This would have made the FreePBX UI more friendly.

Isn't that why we have computers -- so they can free human beings from such trivial tasks as parsing URLs?

tshif's picture

Caller ID can be a problem to deploy – but with the Caller ID Superfecta Module for FreePBX – its fast and simple. Read about it here: http://pbxinaflash.com/forum/showthread.php?t=3747

iptoolz's picture

There are a lot of good Reverse Phone Lookup sites out there but it is hard to find the ones with regularly updated listed and unlisted cell phone records.

p_lindheimer's picture

This comment thread is being blocked because for some reason it is the target of spam on a regular basis that has to be deleted. If you have something valuable to add or want to edit the primary page then pm me to gain access.