Skip to main content

CallerID Name lookup AGI

Posted by eeman on Tue, 05/16/2017

I have developed an AGI script in python for CNAM lookups in order to cut down on the expense of callerID name presentation on calls. Depending on the wholesale sip provider, these lookups can cost as much as 2 cents per call. There are 3rd party vendors that exist using a curl-based query that can get your cost down to a more reasonable half-a-penny per call rate, but often you're still going to customize your scripts to query these providers and this still does nothing for another potential savings.

Unless you're a call center, is actually quite unusual for ever single call, over the course of a few days, to be entirely unique. Quite often the same caller will call in multiple times over the course of a couple days. If Bob Schmuckatelli called you 20 minutes ago, and he is calling in again, what are the odds that his callerid is going to say something different?

So here is what I have designed; I have built an event-driven AGI script in python for asterisk to query. This script has been written to work with Accudatatech, OpenCNAM, CallerIDService, and CIDname for vendor flexibility. Additionally, the NANP city/sate table is also loaded should the query return no result. But it gets better, I have also written a caching engine into the script to store, temporarily, the results of a lookup in both MySQL and SQLite3 database engines. You can specify the length of cache time, giving you the flexibility to set it at a week, a month, whatever. You pick the storage engine, you pick the cache time, you pick which resources to use and in what order (example: check mysql, then opencnam, then the nanpa text file)

The rpm will install itself, create the database tables, and make appropriate entries in user_extensions.include, leaving you only the task of putting your vendor credentials in cnam_lookup.cfg and changing your inbound context for the trunk to [cnam-lookup]

I am selling the software for $175. If you're currently someone paying 2 cents for cnam on every call, just switching to one of these vendors can cut your expenses 75%. If you take 100,000 inbound calls a month and pay 2 cents per call, thats $2,000. Switching to one of these services can reduce that to $475 even before you implement caching to save even more per month.


Submitted by matthewmalk248 on Thu, 06/01/2017 Permalink

This is a great feature to have as some origination providers charge an arm & leg for CNAM lookups. Just sent you an e-mail to buy this!