Giter VIP home page Giter VIP logo

superfecta's Issues

Feature Requst: search leads with SugarCRM

requested by user dgruhin starting here: http://pbxinaflash.com/forum/showthread.php?p=73505#post73505

I added another quick and dirty MySQL search that the OP tested and says is good, and I committed the change to 2.2.5.x branch.

In the process I noticed a few things that probably should change:

  1. SugarCRM has an API that is recommended for stability across versions. I have not investigated this at all, I just discovered it exists
  2. The MySQL search is not using the regular expression developed for vTiger for ignoring non-digits in the database
  3. There may be other phone fields that the lookup source is not searching.

Separate 'Multifecta' code from 'Superfecta' code

After spending a few hours with the code in the callerid.php class I really think we need to make two extended classes called 'multifecta' and 'superfecta'. If the user selects superfecta use the superfecta base, if they chose multifecta then use multifecta base.

These new extended classes wouldn't affect any of the modules (As the modules would never be calling these classes directly anyways) or what we are doing now in terms of the superfecta_base class. It would just help to separate and sort code from the mind boggling-ness of the current stuff. It's just really hard to follow

$astman not exposed

Whilst porting Asterisk_Phonebook to v3.x I found the code calls

$name = $astman->database_get('cidname',$thenumber);

Which has a requirement for php-asmmanager.php, I am not sure how to resolve this.
I looked at config.php, but I am not sure we want to include this for every source.

Update superfecta_base.php with sources?

Question:

When a user updates a source or adds a new source from the repo should superfecta also try to download and update superfecta_base.php? (doing an MD5 checksum between the online repo and the downloaded one to make sure there are no glitches)

Redundant repeated code for number validation

There is a lot of common code to validate the DDI passed in the different lookup sources especially UK and US variants.

US sources have a static NPA list, and UK sources use a STD list to validate the number.

Can we abstract this code to a common function/base class member function for v3.0 e.g

function isValidNumber(DID, Country)
{
}

v3.x lookup not working with multiple schemes

I have multiple schemes for testing different lookups.

If I set the lookup scheme to "ALL" in "Incoming Route" results are not being returned.

Setting the lookup source to the first one in my list e.g. "LDAP" returns results.

Exclusion Rule

Brief exchange here: http://pbxinaflash.com/forum/showthread.php?t=11019

It boils down to a system with lots of DID's where he wanted only one to be processed in a particular way, which meant defining schemes with lots of DID's. A temporary solution was proposed, where a lookup source was created to artificially create a CNAM so that no further processing would take place. I have uploaded source-Abandon_lookup.php to the 2.2.5.x branch for this.

The better solution IMO is to add a case in the rules processing for excluding a number or rule, perhaps by enclosing in (). So if I had a rule like (15554443333), instead of matching the number, it would exclude that number (or rule) and proceed to the next rule.

Thoughts?

Use DID as Caller Name

On occasion you see posts from people who want to display the DID for an incoming call. It occurs to me that it might be useful if Superfecta could do this. It would be useful for testing too.

Debug Verbosity in v3

After exchanging posts about debug levels I propose the following

    1. Normal debug/progress messages
    1. Print out URL and return codes
    1. More extreme developer stuff - dump vars etc

The base class functions have been updated to support the concept of a debug level rather than a boolean value.

isDebug(2) will return true if the verbosity is 2 or more.

DebugPrint("some debug string", 3) will only display when debug level is 3 or more.

Rather than hardcoding 1,2,3 as levels I think we need some constants/defines
I am not sure what the namimg should be, how about

  • DEBUG_LEVEL_1
  • DEBUG_LEVEL_2
  • DEBUG_LEVEL_3

The debug verbosity needs to be exposed in the freepbx GUI with a default of DEBUG_LEVEL_1.

We also need to be able to set the debug level for CLI and via URL.

SPAM text is not applied to results

If the lookup source sets $this->spam to true, the result does not have the spam text applied.

Trying 08450044237 with Telepest.co.uk returns

Searching Telepest.co.uk ... SPAM caller
Looking up CNAM ... 'Toucan Claims '
result took 0.2265 seconds.

Returned Result would be: Toucan Claims

the result should be **SPAM:**Toucan Claims

Using ver. 2.2.5 Fatal error:...callerid.php on line 55

Installed on FreePBX 2.8, every debug number gives this output:

Strict Standards: Non-static method DB::connect() should not be called statically in /var/www/html/admin/modules/superfecta/config.php on line 26

Strict Standards: Non-static method DB::parseDSN() should not be called statically in /usr/share/pear/DB.php on line 520

Strict Standards: Non-static method DB::isError() should not be called statically in /usr/share/pear/DB.php on line 557

Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/pear/DB.php on line 594

Strict Standards: Non-static method PEAR::isError() should not be called statically in /var/www/html/admin/modules/superfecta/config.php on line 27

Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/pear/PEAR.php on line 275

Notice: Undefined variable: astman in /var/www/html/admin/modules/superfecta/bin/callerid.php on line 55

Fatal error: Call to a member function connect() on a non-object in /var/www/html/admin/modules/superfecta/bin/callerid.php on line 55

Superfecta Caching and SPAM prefix in ver. 3.x

I had some ideas about caching and spam, originally discussed here: http://projects.colsolgrp.net/issues/456 summarized as follows:

One issue is the spam prefix, if a call is determined to be spam and the spam prefix is applied, then the CNAM is cached with the spam prefix. It is possible for a subsequent call to come in, get the CNAM from the cache and also be determined to be spam and the prefix is applied again and re-cached resulting in a CNAM of "spam:spam:spam: ...". I believe that the spam status should be cached as a separate variable from CNAM. ukstevef may have fixed this already, pls confirm

Another issue is automated report back. I don't have much enthusiasm for the concept myself, but if it is eventually implemented, there will need to be a mechanism that prevents cached data from reporting back to the same source it came from, which means that the cache will need to keep track of the successful lookup source.

Line 246 hard codes a : (colon) between the spam prefix and the CNAM, which I don't agree with. If the user want a colon to separate the two, they can put it in the spam prefix themselves. The default spam text can include the colon.

Discovered problem if using spam scoring and multiple schemes. Looks like line 276 (from earlier ver may be different now) will prepend the spam prefix to the string $first_caller_id regardless of whether a valid CNAM is found or not. This will not allow the next scheme to be processed since $first_caller_id must equal "" to continue. I am getting calls in my logs that look like this "SPAM:" because no valid CNAM was found in the first scheme with spam prefixes enabled. Need to incorporate a check so that spam text is only prepended to a found $first_caller_id. Thinking this may be important in case of a false spam positive.

Another thought on spam scoring -- once a call is determined to be spam, the $spam boolean is set as true, Superfecta should not do any more spam scoring checks to minimize delay.
To which Jkiel replied:
Good idea, however it will require editing each spam source -- and if that is to be done, would a cumulative spam score be worth anything? Say you have 3 spam sources, and each one scores relatively low for a given number -- would adding the score of all of them together, then allowing callerid.php decide if it's high enough to mark the call as spam rather than the spam source, be a bad move?

Numberguru captcha

Ka'Plah! I got a live update today for the first time in MONTHS! Numberguru.

I tried a handful of numbers on the revised code, and got "not found" for all of them. To make sure I was using numbers that are available on Numberguru, I went to the website and tried to do a lookup manually. I was challenged with 2 captchas before it would yield a result. I think the days are numbered for this lookup

Sources Slated for Deletion

-Google Phonebook [Reason: http://www.google.com/support/forum/p/Web%20Search/thread?tid=5a68b203a44c073e&hl=en]

How does the new live update work

Can someone please summarize how the new live update works. I understand the reasoning for changing, something about github and date/time.

I know that sources.xml is involved, does this file get changed manually or is is generated somehow. Does the pbx copy of sources.xml get updated when you do a liveupdate or when you update a source? It didn't when I just updated numberguru, but it seems to me that it should have.

TelcoData does not need NPA lookup (follow up to Issue #24)

Regarding issue #24, the system would not let me add a comment because the issue has been closed, and I don't have permission to reopen it. Feel free to move this comment there (if you can do that), or tm1000, you can just close it after you've read it (and even delete it if you like), but I did want to just say this:

The TelcoData module does not need a NPA check, at least not the usual one for USA and Canada NPA's. Because...

  1. It will return a valid result for just about ANY NPA in a NANP country. Try giving it a number in a Caribbean country, it will give you exchange (or city) name and country.

  2. If you happen to give it an NPA-NXX that it does not have in its database, it will return an XML result that tells you that (and the script looks for that).

So, the only reason for a NPA check would be to exclude Toll-Free NPA's (which it already does) and NPA's that are not valid anywhere in the NANP (BUT those probably won't show up in a Caller ID that you receive anyway, unless someone is spoofing the CID filed, so why bother? And if someone IS spoofing, do you really care if they have to wait an extra second to connect?).

Presence of Google Voice module can cause Superfecta to stop working

On reflection I thought perhaps this should be made a separate issue.

The problems were observed under these conditions:

FreePBX Distro with FreePBX 2.9.0.7

Caller ID Superfecta 2.2.4 or 2.2.5

Google Voice module installed but nothing done to configure it.

Effects noted:

With 2.2.4, attempting to do a Debug test results in message about FreePBX version being 2.9 and short flash of spinner, but no results returned.

With 2.2.5, the database sources are not shown on the Superfecta page, and attempting to do a Debug test results in short flash of spinner, but no results returned.

Suggestion for TelcoData module

I have been using a modified TelcoData module that does not limit you to area codes in the US and Canada. TelcoData will return valid information on just about any NANP exchange (even in the Caribbean) and if it can't it will tell you, so my modification takes advantage of that fact. It also runs slightly faster. Here are two side by side runs (had both sources enabled) of mine vs. the one provided in 2.2.5:

Mine:
Searching Telco Data ... 'HOUGHTONLK, MI'
result took 0.0921 seconds.

The one provided in 2.2.5:
Searching Telco Data ... 'HOUGHTONLK, MI'
result took 0.1141 seconds.

This module has not been modified to work with 2.2.5 in any way, but it does seem to work with it. Feel free to use it if you like, or modify it as you see fit (but please don't reinstate the US/Canada area code tables, they really are NOT necessary with TelcoData). I should also note that I simply started with an earlier version of the TelcoData module and made some edits - I don't know PHP so there is no way I could have written this from scratch!

//this file is designed to be used as an include that is part of a loop.
//If a valid match is found, it should give $caller_id a value
//available variables for use are: $thenumber
//retreive website contents using get_url_contents($url);

//configuration / display parameters
//The description cannot contain "a" tags, but can contain limited HTML. Some HTML (like the a tags) will break the UI.
$source_desc = "http://www.telcodata.com - These listings are generally only return the geographic location of the caller, not a name.";

//run this if the script is running in the "get caller id" usage mode.
if($usage_mode == 'get caller id')
{
    $number_error = false;
    if($debug)
    {
        print "Searching Telco Data ... ";
    }

    //check for the correct 11 digits in US/CAN phone numbers in international format.
    // country code + number
    if (strlen($thenumber) == 11)
    {
        if (substr($thenumber,0,1) == 1)
        {
            $thenumber = substr($thenumber,1);
        }
        else
        {
            $number_error = true;
        }

    }
    // international dialing prefix + country code + number
    if (strlen($thenumber) > 11)
    {
        if (substr($thenumber,0,3) == '001')
        {
            $thenumber = substr($thenumber, 3);
        }
        else
        {
            if (substr($thenumber,0,4) == '0111')
            {
                $thenumber = substr($thenumber,4);
            }           
            else
            {
                $number_error = true;
            }
        }

    }   
    // check for short number
    if(strlen($thenumber) < 10)
    {
        $number_error = true;
    }


    if(!$number_error)
    {
        $npa = substr($thenumber,0,3);
        $nxx = substr($thenumber,3,3);

        // check for valid area code (201 or higher)
        if ($npa < '201')
        {
            $number_error = true;
        }           
        else
        {
            // Check for Toll-Free numbers (including future TF NPA's)
            $TFnpalist = array(
            "800", "822", "833", "844", "855", "866", "877", "888"
            );
            if(in_array($npa, $TFnpalist))
            {
                $number_error = true;
            }
        }
    }

    if($number_error)
    {
        if($debug)
        {
            print "Skipping Source - Toll Free or International (non-NANP) number: ".$thenumber."<br>\n";
        }
    }
    else
    {
        $url = "http://www.telcodata.us/query/queryexchangexml.html?npa=$npa&nxx=$nxx";
        $value = get_url_contents($url);

        // Telcodata will tell us if we have an invalid NPA/NXX
        $start = strpos($value, "<valid>");
        $valid = substr($value,$start+7);
        $end = strpos($valid, "</valid>");
        $valid = substr($valid,0,$end);

        if ($valid == 'NO')
        {
            if($debug)
            {
                print "Skipping Source - Telcodata reports invalid NPA/NXX: ".$thenumber."<br>\n";
            }
        }
        else
        {

            $start = strpos($value, "<ratecenter>");
            $ratecenter = substr($value,$start+12);
            $end = strpos($ratecenter, "</ratecenter>");
            $ratecenter = substr($ratecenter,0,$end);

            $start = strpos($value, "<state>");
            $state = substr($value,$start+7);
            $end = strpos($state, "</state>");
            $state = substr($state,0,$end);

            $value = $ratecenter.", ".$state ;

            if(strlen($ratecenter) > 1)
            {
                $caller_id = strip_tags($value);
            }
            else if($debug)
            {
                print "not found<br>\n";
            }
        }
    }
}
?>

Whocalled reportback function

Tony modified Whocalled early last January to give the option to automatically report back if an incoming call was determined to be spam. This code was never released and some effort should be made now before we release as part of 2.2.5

report back starts at line 244. Report back is only done when superfecta determines a call to be spam. There is a check to make sure that report back is not done if the name came from the whocalled source, but no check is done to prevent it from reporting back a CNAM that came from the cache, which could easily have come from a previous whocalled lookup.

MT pointed out another issue that merits some thought too. If an unsophisticated user (or careless guru) combines the whocalled source with a private address book, is it possible to potentially push private or unlisted numbers back to this source. I don't see how exactly this could be the case unless superfecta gets a false spam positive somehow.

Are there any other sources that do report back?

v2.2.5 sources left to migrate to v3.x

The following need to be converted.

  • Argentina
    • Paginasblancas_AR
  • Austria
    • Herold_AT
  • Australia
    • Google_Maps_AU <-- scheduled for deletion
    • Personlookup_AU
    • ReverseAustralia_AU
    • Reversephones_AU <-- updated since migration
    • Superpages_AU
    • Truelocal_AU <-- automated searches prohibited by TOS
    • Yellowpages_AU
  • Canada
    • Can411 <-- TOS do not restrict Superfecta usage
    • Can_White_Pages <-- automated searches prohibited by TOS
    • CanPagesCa <-- automated searches prohibited by TOS
    • Can_Yellow_Pages <-- automated searches prohibited by TOS
    • Canada411 <-- automated searches prohibited by TOS
  • Database
    • AsteriDex
    • Elastixphonebook
    • FOP2_Phonebook
    • MSSQL_DB
    • MySQL_DB superseded by SFDatabase
    • Open79XX
    • PostgreSQL_DB
    • SugarCRM <-- see #66
    • Theaddressbook
    • VTiger_CRM
  • Dominican Republic
    • Paginasamarilla_DO - Issue #56
  • Italy
    • PagineBianche_IT
  • Netherlands
  • Serbia
    • Telekom_rs_SR
  • Sweden
    • Eniro_SE
    • Hitta_SE scraping prohibited
    • Vemringde_SE
    • www_118700_SE
  • USA
    • CallWith.us
    • Yellow Pages automated search prohibited
    • EnumQuery
    • Google - See issue #37
    • Metrostat_US
    • PhoneSpamFilter
    • Telepest_US
    • VoIPCNAM
    • OpenCNAM
    • Who Called
  • Miscellaneous
    • Abandon_lookup
    • Trunk Provided <-- can't migrate, total rewrite
  • Post Processing
    • Send_to_Dreambox
    • Send_to_Squeezebox_Server
    • Send_to_Winunciator
    • Send_to_XBMC
    • Send_to_MythTV
    • Send_to_Email
    • Send_to_URLl
    • Send_to_Yac
    • Send_to_Soundbridge
    • Send_to_SMS
  • Germany/German - Issue #167
    • DeTeMedien
    • Klicktel
    • Infobel
    • Local.ch

Merge 3.x branch into master

I do not mean any offense to anyone by this

We did this fork because the project manager tshif dropped of the face of the planet and Superfecta wasn't getting updates to any of it's sources, no matter how much was being updated in the repo. I had hoped that this fork would let us release a version of superfecta that would be completely updated with the 7-8 months of updates.

Unfortunately lgaetz is still updating the repo over at colsolgrp. That's fine. I'm ok with that, but that means that the master branch is now out of sync with the repo at colsolgrp and it will start to confuse users because they won't know where to look for updates.

Therefore I say we merge the 3.x branch into master (here on github) and just call this Caller-ID-Superfecta project at github the official 3.x version.

Superfecta without an inbound route?

I was not aware of the issue until I read this post: http://pbxinaflash.com/forum/showthread.php?t=11498

Aparently you can receive an inbound call directly to an extension via the extension's DID field and not use an inbound route for the call. No inbound route, means no CID lookup. Has anyone else ran into this? Does Superfecta 3.x address this usage case? The FreePBX ticket referenced on the thread above has a bit of info, but it still looks to be outstanding.

Environment checking routine

There have been 2 issues lately where an external module broke superfecta operation, the Hotel style wake-up calls module and the GV module. There may well have been others, and it is likely that it will happen again. Is it at all feasible to have some sort of internal superfecta mechanism that will scan the environment it is installed in and report these items to the user? It would have to be live updatable so that as issues are discovered, they could be pushed to users. I suppose that as it evolves, it could be used for checking dependencies, and no doubt other things as well.

By the time I finished typing the paragraph above, I started thinking that such a scanner would be more work than it is worth, but I leave the ticket for comments anyway.

CIDS 2.2.5 (Aug 1 version) - Live update/sources issue

Using PIAF Purple, FreePBX 2.8.
I am not sure that live update is working as expected. I can see the new lookup source for Canda411 has been merged into the master branch, and it looks like the xml file has been edited to include it, but when I click on check for data source updates, Canada411 does not appear on the list of missing sources.

Also, I am thinking that references to the colsolgrp website should be changed to github.

Google Maps UK no longer works.

The format of the web page has changed - no results are being returned.

For example 01214278888 returns nothing, where previously this was "T O A Taxis"

Missing "Disable" option in Module Administration

I reported a bug to the FreePBX bug tracker (see http://www.freepbx.org/trac/ticket/5296 if you are curious) and was asked to temporarily disable three third-party modules I have installed, of which Superfecta is one. I was surprised to find that there is no "Disable" option for Superfecta - you can only uninstall, and of course if you do that, you lose all your module configurations and also all your inbound routes that use Superfecta as a source get reset to use no Caller ID lookup.

Would it be possible to add a "Diasble" option in Module Administration for debugging purposes?

Grouping Sources

As the number of data sources grow the list is starting to get unworkable.

Would there be merit in being able to expand/collapse groups of sources ?

Initial thoughts we could do this by region e.g USA, UK, Europe, Other - of course I am well aware of the challenges of defining an all encompassing category naming scheme.

We could add a settings category to help facilitate this.

Another category that would be useful to seperate would be "Post Processing Only" data sources.

Hosting

Just wanted to bring this up. Right now you can see I'm hosting the downloadable tar-balls for the project. I don't mind doing this at all (I have unlimited bandwidth).

I just wanted to bring this up incase anyone has any objections.

Basically I wrote a small script that generates these packages for me on the fly from the repo (whenever I ask it to do so)

$run_param not populated for post processing

I get the following

Notice: Undefined index: Server_address in /var/www/html/admin/modules/superfecta/bin/source/Send_to_Soundbridge.module on line 43

This also happens with the YAC module as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.