Data Source- Superfecta Cache¶
05/18/2009
The Superfecta Cache data source is a high speed local data source that is well suited to being one of the first (if not THE first) selection on your providers list. If you are using the Asterisk Phone book to store company wide speed dial information, it is recommended that you place the Asterisk Phone book above the Superfecta Cache.
When enabled, results returned by Superfecta are cached locally for a user defined number of days, after which it is deleted. During this cache period, the data is available for fast local look up. The time frame for which entries should be kept in the Superfecta Cache should be viewed with respect to how out of date the data may be in x number of days, rather than worrying about how large the cache might get.
Why a separate caching source vs.the Asterisk Phone Book?¶
There are two schools of thought as to how the Asterisk phone book should be used.
Some installations choose to cache the results of CID lookups in the Asterisk Phonebook using the built in FreePBX function to do so. In this case, the phonebook is used mostly as a source for CID information - which can be customized by the PBX admin through editing the Phone Book information. The asterisk database, which is where the phone book lives, is a berkley database, and has not been stress tested with very large numbers of records to our knowledge.
Other installations do not cache results into the Asterisk PhoneBook, instead using it as a corporate "black book", to which they manually enter all the company's shared contact information. These numbers may include things like vendors, important customers, and other often dialed numbers. They then use the PBX speed Dial functions tied to these users to provide company wide speed dial codes to these often dialed numbers.
The Superfecta Cache data source provides the best of both worlds. When enabled, it caches all Superfecta results to its own mySQL based database, which can handle a LOT of records. It can be selected as a source, and placed in the search order as you see fit, just as with any other source.
This frees the Asterisk Phone book to BE the company Speed Dial resource without giving up the ability to locally cache CID information of recent callers.
Caching Revisited¶
Generally speaking, it is not necessary to cache fast lookup sources. Where the Superfecta Cache really shines is when it is used in conjunction with slow lookup sources. It is quite common for a PBX to receive many calls from the same CID. If the only source of CNAM for that CID comes from a slow internet source, the caller would have to wait for the CNAM to be retrieved every time they call. If the results are cached the first time, subsequent calls go through very quickly, provided the cache is called before the slow internet sources are called.
There are exceptions, however, when it is appropriate to cache fast sources. If you have a hunt group of DIDs, it is possible that some provide good trunk provided CNAM and some don't. In this case you can cache the fast Trunk provided CNAM from the DIDs that provide it, and reuse it on subsequent calls that arrive on DIDs that don't provide good CNAM. Incoming calls show up with consistant CNAM showing on the phones regardless of which DID is in use. Conversely, there are situations where it is inappropriate to cache slow sources. There are some internet sources that provide very general CNAM, such as Telco Data, where only the geographic location of the incoming call is reported. This CNAM is better than nothing, but you don't want to cache the result in case it superceeds any lookup source with better CNAM data in the future.
With the release of Superfecta 2.2.4, the Superfecta Cache lookup source has been improved to allow a list of CIDs to ignore when caching results. Suppose there is an organization that sends specific Trunk Provided CNAM from each of the individuals within the organization but the CID is the same for all. You don't want to cache these results because the incoming CNAM varies by caller even if the CID doesn't, so the offending CID can be placed in the list of "CID Exclusion Rules" in the Superfecta Cache configuration.