Superfecta oddity


(D E) #1

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


Thank you!


(Lorne Gaetz) #2

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


(D E) #3

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;
                        }

(system) closed #4

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