Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-17650

CID Superfecta GoogleContacts company field

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 13
    • Fix Version/s: None
    • Component/s: CID Superfecta
    • Labels:
      None
    • ToDo:
    • Asterisk Version:
      13.18.3
    • Distro Version:
      FreePBX 13.0.195.4

      Description

      I use CID Superfecta GoogleContacts to get caller ID information from Google contacts. It works fine. However, sometimes it does not return the caller name.

      I did lots of testing and found the reason: Some of my contacts only use the company name field. That is a 100% valid use. I can not change it, as they are coming in from another source. 

      Superfecta however ignores this field, but it should be using it if there is no other name. 

      This is the data in Google contacts:

      <gd:organization>
         <gd:orgName>Google, Inc.</gd:orgName>
      </gd:organization>

       

      So, only the organization set, not a name:

       

      results in 

       

      Debug is on and set at level: 1
      The Original Number: 2065551212
      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: 2065551212
      The CNAME is: CID Superfecta!

      Starting scheme Default
      Executing GoogleContacts
      Searching Google Contacts for number: 2065551212
      result  took 0.4948 seconds.

       

      (No name returned.)

      but this works (a name set):

      results in:

       

      Debug is on and set at level: 1
      The Original Number: 2065551212
      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: 2065551212
      The CNAME is: CID Superfecta!

      Starting scheme Default
      Executing GoogleContacts
      Searching Google Contacts for number: 2065551212
      'John Doe'
      result  took 0.5028 seconds.

       

      So, in both cases, he finds the record, but he only looks for the name. A perfect solution would be that he takes the company name if he does not have a name.

      It must be in these lines of the Superfecta GoogleContacts code, but unfortunately, I don't know how to handle it:

      $score = -1;
      $name = null;
           foreach ($results['data'] as $key => $info) {
           $s = $info['score'];
           if ($s > $score)

      {      $score = $s;      $name = $info['name'];      }

      }

       

      Willing to help and test!

      Thanks for your help!

      Stephan

       

       

        Gliffy Diagrams

          Attachments

          1. image-2018-06-06-18-11-57-926.png
            61 kB
            Stephan Koenig
          2. image-2018-06-06-18-13-30-905.png
            50 kB
            Stephan Koenig

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                StephanK Stephan Koenig
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  NextupJiraPlusStatus

                  Error rendering 'slack.nextup.jira:nextup-jira-plus-status'. Please contact your Jira administrators.