Skip to content

Understanding Superfecta CID DID Rules

lgaetz edited this page Aug 2, 2011 · 3 revisions

In order to best understand the flexibility of CID/DID Rules, and apply best practices when using them, it helps to have a basic understanding how Superfecta operates under the hood.

###Superfecta Theory of Operation

In simple terms, Caller ID Superfecta is a means of matching a CID (caller phone number) with a CNAM (caller name). To do this Superfecta employs devices named schemes and lookup sources. The lookup source (or just 'lookup') is a set of commands that take the CID and attempt to match it to a CNAM from a particular resource. There are dozens of lookup sources, and more are constantly being added as CNAM resources are discovered and as developers exploit them. For flexibility, groups of lookup sources are combined into schemes. By combining lookup sources with schemes in different ways, Superfecta can be customized to the individual user's preference. From a top level point of view, this is the philosophy of Superfecta operation:

  1. A call arrives and hits an inbound route on the PBX. If the inbound route defines Superfecta as the CID Lookup Source, the story continues; if not Superfecta is not used for the call.

  2. The first Superfecta scheme is called. The CID and DID of the incoming call are matched to the Scheme CID & DID rules and if both match, the individual lookups in the scheme are executed in priority.

  3. Still in the first scheme, the first lookup source is called and an attempt is made to acquire a CNAM. If the first lookup source is unsuccessful, the second is called and so on until a value for the CNAM is found. If a CNAM is found, Superfecta will stop looking and continue to post processing.

  4. If all of the lookup sources in the first scheme are exhausted and no CNAM results, the second scheme is called, and so on down the list of all schemes (and all lookup sources within schemes) until a value for the CNAM is achieved.

  5. Once a CNAM has been found, Superfecta stops stepping through lookup sources and schemes. Any schemes that have been called before and any that would have been called after are now ignored. Post processing is done on the successful scheme only.

  6. Assuming that Superfecta is successful, we have a CNAM. Superfecta now starts its Post Processing phase and steps through all of the individual lookup sources configured for the successful scheme only. If any of the lookup sources have further post processing to do with the newly found CNAM, now is when it will be done. If configured in the successful scheme, "Send to" sources like "Send To Winunciator" will be called and the CNAM data will be announced. If configured in the successful scheme, the Superfecta Cache will be used to cache the newly found CNAM to speed up future searches on the same CID.

  7. Once all lookup sources have been post processed in the successful scheme, Superfecta is finished and hands off control of the call.

By truly understanding the above, it is possible to create a complex arrangement of schemes and sources to achieve fast lookups, get accurate CNAM and avoid polluting your send to sources with less than ideal CNAM data.

###Real World Example

  1. Let us suppose there is a PBX (located in USA/CAN) that has both analog and VOIP trunks. Further suppose that incoming calls come in with a variety of CID lengths: 7 digits for local analog calls, 11 digits for long distance analog calls and 10 digits for VOIP calls. There are 11 digit analog DIDs, 10 digit VOIP DIDs and even an 11 Digit toll free DID. Analog DIDs provide useful CNAM but the VOIP DIDs provide no usable CNAM.

  2. Since the analog lines instantly provide accurate CNAM, the first scheme will have the Trunk Provided lookup source configured. I don't want to preserve the VOIP provided CNAM, so only analog DIDs are added to this scheme configuration (I could also add a rule or rules that catch only analog DIDs). This PBX is in North America, so I want to "fix" all incoming CID numbers to be processed consistently. I add CID rules that modify CID as necessary so that all incoming CID is processed as 11 digits. In this situation it is useful to cache the Analog trunk provided CNAM for reuse if a caller calls again on a VOIP line, so I add the Superfecta Cache lookup source after the trunk provided source. I know from experience that some trunk provided CNAM may differ between individual callers in the same organization even if they all have the same CID, so I have to configure the Superfecta Cache not to cache CNAM from certain CIDs; which is easily done with the Superfecta Cache configuration. If I used Winunciator, or any other Send to sources, I would add them here. If a lookup fails in this or any other scheme, the scheme is dead. Superfecta will not come back to check the send to sources or the cache for post processing, they must be configured independently and separately for each scheme.

  3. The second and third schemes are a unique situation for this office. I have imported thousands of numbers into the asterisk phone book from various other sources going back dozens of years, stored indiscriminately in 7, 10 and 11 digit format. Out of pure laziness I have not made any attempt to clean up the data, but Superfecta can handle it easily. I create one scheme with rules that strip as necessary for 7 digit CIDs and another scheme with rules that create all 10 digit CIDs and both have the asterisk phone book lookup source configured. There is no need to cache this CNAM so Superfecta Cache is not configured for these schemes. Once again, if I used Winunciator or any other send to sources, they would have to go in both schemes.

  4. The next Scheme will do the heavy lifting. Once a call gets to this scheme I know it has no useful Trunk provided data and I couldn't get a hit with a 7 or 10 digit number in the Asterisk Phonebook. I add CID rules that modify CID as necessary so that all incoming CID is processed as 11 digits. In this scheme I don't have any DID restrictions, all calls are treated equally. This scheme will have multiple lookup sources, which are generally ordered by speed; keep your caller waiting as little as possible. First on the list will be the Superfecta cache and the Asterisk Phonebook (again! but this time we are searching for 11 digit numbers not 7 or 10), both do fast lookups. Next is TheAddressBook which is is also used in this office. If I used Asteridex or CRM, they would go next, again group all your fast local searches at the beginning. Next come all of the Internet lookup sources in order of preference and finally any send to sources you wish to configure. The presence of the Superfecta Cache lookup source will ensure that the Internet sources are cached so subsequent lookups will be much faster. The CID rules will ensure that the cached numbers are all stored consistently regardless of how many digits the incoming CID has.

  5. The last lookup source means that all attempts to get any useful free CNAM have now failed. This is the place for the "last resort" lookup sources. There is a source called Telco Data that only reports the geographic location of the caller. There are other lookup sources that are pay per use, so you want to exhaust your free options before paying. This is where they would go. I do not restrict by DID but once again I have CID rules to ensure that calls are processed with 11 digit CID for consistency. I don't use any pay per use sources and I certainly don't want to cache the geographic location of a CID, so the Superfecta cache is not configured for this scheme. Again, any and all necessary send to sources must be added here.

The above example could be considerably more complex with schemes added for CID from other countries or with totally different lookup handling for each DID, really the flexibility is present in the module to do pretty much whatever you can dream up.