Superfecta oddity

Re: this thread, does anyone know how I would go about debugging this?


Thank you!

Mistake on my part. Locate the file:

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

and note the logic is wrong, the checks are looking for results less than the threshold, not greater. The following lines are corrected:

if($number_of_searches >= $run_param['Search_Number_Threshold'] || $number_of_comments >= $run_param['Comment_Number_Threshold']) {

and

if($number_of_searches >= $run_param['Search_Number_Threshold'] || $number_of_comments >= $run_param['Comment_Number_Threshold']) {

Open a ticket referencing this thread to get it fixed:
https://issues.freepbx.org/

Done: https://issues.freepbx.org/browse/FREEPBX-20975

1 Like

Thanks Lorne. I made the changes to the file and all was well for a while. Then I think Superfecta updated itself and the problem has reappeared. Aha, thought I, I’ll just manually make the changes again to the file. I’ve done so, but now the ‘fix’ isn’t helping.
I’m just reporting this for info.
This must be so boring for you - I’m not asking for a fix. I’m just letting you know. :slight_smile:

EDIT: “fixed” it by bodging it well and truly. Works for now.

if (isset ($average_rate)) {
                        switch (strtolower($average_rate)) {
                                case "dangerous":
                                                $this->DebugPrint("Number flagged as Dangerous, comment/search threshold met, setting call as SPAM");
                                                $this->spam = true;
                                        break;
                                case "harassing":
                                                $this->DebugPrint("Number flagged as Harassing, comment/search threshold met, setting call as SPAM");
                                                $this->spam = true;
                                        break;
                                case "unknown":
                                        $this->DebugPrint("Number flagged as Unknown, doing nothing");
                                        break;
                                case "neutral":
                                        $this->DebugPrint("Number flagged as Neutral, doing nothing");
                                        break;
                                case "safe":
                                        $this->DebugPrint("Number flagged as Safe, doing nothing");
                                        break;
                                default:
                                        $this->DebugPrint("Site returned unexpected rating of ".$average_rate.", doing nothing");
                                        break;
                        }

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Hi @dan_ce

I updated the ticket with a version for testing, my own testing is incomplete. Can you confirm it’s working properly?

Thanks Lorne, seems to work ! :clap: :heart_eyes:

Debug is on and set at level: 1
The Original Number: 02039813069
The Scheme: Default
Scheme Type: SINGLEFECTA
Debugging Enabled, will not stop after first result

Scheme Asked is: Default
The DID is: 5555555555 
The CNUM is: 02039813069
The CNAME is: CID Superfecta!

Starting scheme Default
 Executing Superfecta Cache
Searching Superfecta Cache ...
'London'
result  took 0.0343 seconds.

 Executing Asterisk Phonebook
Searching Asterisk Phonebook ...
not found
result  took 0.0779 seconds.

 Executing FreePBX Contactmanager
result  took 0.0337 seconds.

 Executing WhoCalled UK
Searching https://who-called.co.uk/Number/02039813069 ...
Average Rate: Dangerous
Number of Searches: 209
Search Threshhold : 25
Number of Comments: 0
Comment Threshold :
Number flagged as Dangerous, comment/search threshold met, setting call as SPAM
result  took 1.0414 seconds.

 Executing ReversePhoneBooks UK
Searching ReversePhoneBooks.co.uk...
value of 0 returned...
Not a SPAM caller
result  took 1.1953 seconds.

 Executing UKPhoneInfo UK
Searching UKPhoneInfo ...
'London'
result  took 0.5998 seconds.

 Executing Abandon lookup
Setting CNAM WEIRD AREA CODE ...
'WEIRD AREA CODE'
result  took 0.0006 seconds.

Converting result to UTF-8
Post CID retrieval processing
 Executing Superfecta Cache
CNAM already cached, skipping write.
Done
Call detected as spam, would send call to: ext-miscdests,1,1
This scheme would set the caller id to: SPAM London

Returned Result would be:SPAM London
result took 2.9909629821777 seconds
1 Like

Just not sure I’ll be able to take advantage of the fix until https://issues.freepbx.org/browse/FREEPBX-21584 is fixed

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.