In re. FREEPBX-22293, CID Superfecta UK number format checking is too restrictive


(Phil Pemberton) #1

Hi @lgaetz - you asked me to open a thread here for further discussion of my bug report FREEPBX-22293.

Essentially what’s happening is, CID Superfecta is using an overly restrictive set of filters for UK phone numbers. This is causing some numbers to be misidentified as non-UK, or not correctly passed to the UK CID services.

I posted the UK Number Plan from OFCOM, which defines how UK phone numbers should be interpreted and validated, as a starting point for discussion.

The issue I saw was that this number was rejected as non-UK and not passed to SayNoTo0870:

{{-> Executing Say No To 0870 UK
Skipping Source - Non UK number: 00443337591018
result took 0.0011 seconds. }}

0044 is obviously the country code, which is substituted with “0” for a trunk-dialed (STD coded) UK number. This gives 0333 759 1018

If you manually search SayNoTo0870 for the above number, it identifies it correctly as “Sky Media Head Office”. But CID Superfecta isn’t getting this far, and is rejecting the number as “non-UK” and thus not worth looking up on SayNoTo0870 – because '0870 is a UK-only database.


(Lorne Gaetz) #2

The code for this superfecta module is in the file:

/var/www/html/admin/modules/superfecta/sources/source-Say_No_To_0870_UK.module

you can see it references the function IsValidNumber and I believe the user uksteve wrote the UK number validation routine for Superfecta, I’ve not seen anything from him in a long time. You can see the routine here starting on line 667
https://git.freepbx.org/projects/FREEPBX/repos/superfecta/browse/includes/superfecta_base.php#667

It looks like the UK number validation might be incomplete but as a work around, reference to the validation routine could be removed from source-Say_No_To_0870_UK.module for testing.