I HAVE A DREAM NEW CallerID Superfecta 2.2.4: THE MODULE

timg

New Member
Joined
Sep 30, 2008
Messages
138
Reaction score
0
That took care of the problem with saving the password but now all my lookups are failing. All that is being passed to the phone is the phone number. If I do a debug on the lookups they show the name from the individual sources. But when the call comes in, nothing but the number..........
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Check your inbound routes. I had the same problem of no lookups, and it was just the CID source not selected.
 

timg

New Member
Joined
Sep 30, 2008
Messages
138
Reaction score
0
Inbound route is OK. Deleted and re-added it just to make sure. Still no go. Debug shows the name correctly. Asterisk log files do not, just show the number...
 

jkiel

Guru
Joined
Sep 5, 2009
Messages
25
Reaction score
0
Inbound route is OK. Deleted and re-added it just to make sure. Still no go. Debug shows the name correctly. Asterisk log files do not, just show the number...


Do you have any non Alpha numberic characters in your maint password? If so, you'll need to URL Encode it. Please read posts 671 to 673 from here for details. If not, see below:

Using the module admin, please try the following, in order:

1) Uninstall Superfecta
2) Apply changes
3) Uninstall CallerID Lookup
4) Apply changes
5) Install CallerID Lookup
6) Apply changes
7) Install Superfecta 2.2.4
8) Apply changes

under: CID Superfecta:

9) Configure your superfecta sources (unless you have alpha numeric characters in your maint password, your username and password should already have been set correctly for you by the superfecta installer)

under: Inbound Routes:

10) Set your inbound routes' Caller ID Lookup source to "Caller ID Superfecta".
11) Apply changes
 
Last edited by a moderator:

timg

New Member
Joined
Sep 30, 2008
Messages
138
Reaction score
0
No alpha numeric characters in my maint pass, just standard letters and numbers.

Did what you suggested. Password and Username were set correctly. Tried calling in to the system, now I am no longer getting the number or name. Just blank. I ran a debug and got this which was different.

Debugging Enabled, will not stop after first result.
Processing Default Scheme.
Searching Asterisk Phonebook ... 'Tim Grooms (Cell)'
result
scrollup.gif
took 0.0004 seconds.

Searching Superfecta Cache ...
Notice: Undefined index: Cache_Timeout in /var/www/html/admin/modules/superfecta/bin/source-Superfecta_Cache.php on line 58
not found
result
scrollup.gif
took 0.0008 seconds.

Looking for Trunk Provided Caller ID ...
Notice: Undefined index: Ignore_Keywords in /var/www/html/admin/modules/superfecta/bin/source-Trunk_Provided.php on line 26
not found
result
scrollup.gif
took 0.0004 seconds.

Searching Telco Data ... 'CONWAY, AR'
result
scrollup.gif
took 0.5387 seconds.

Post CID retrieval processing.

Caller ID data added to cache.

Returned Result would be: Tim Grooms (Cell)
result
scrollup.gif
took 0.0118 seconds.
 

jkiel

Guru
Joined
Sep 5, 2009
Messages
25
Reaction score
0
To get rid of the notices, click on the Superfecta Cache source, then click the apply button -- do the same for Trunk Provided.

To see if Superfecta is working, in Firefox, make sure you are logged out of FreePBX, then try:

Code:
http://maint:[email protected]/admin/modules/superfecta/bin/callerid.php?thenumber=5555555555


Where "your_password" is your maint password, "your.pbx.address" is the address of your PBX, and "5555555555" is a valid number you know will give you results.

You should receive a single line with your CNAM result. If that works, superfecta is working -- you may have a problem elsewhere.
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Wiki Entries Made

I have captured John's excellent troubleshooting advice from his previous posts here and combined it with a little additional information we have been collecting.

There is enough there now to mention it as a possible resource.

Trouble Shooting the CallerID Superfecta Module

This area will be updated with new troubleshooting steps as we encounter/create them. Its a public resource available for read access by everyone. Let us know if any of the info there helps out also -
 

timg

New Member
Joined
Sep 30, 2008
Messages
138
Reaction score
0
Tried the direct link from the address line and it worked. The debug also works. For some reason tho when I turn on caller id superfecta in freepbx, i don't get a phone number or name. If I turn it off I am getting the number and whatever the phone company is passing. Not sure what to try next...
 

zorka

Guru
Joined
Jul 16, 2009
Messages
41
Reaction score
4
We are working on upgrading the documentation for the MySQL data source of the CallerID Superfecta.

To better understand how this data source is being used, I'm asking today for you to share your storys of how you use it.

It will be MOST HELPFUL if you would kindly inclulde the parameters you use for SQL Query.

-tshif

SQL Query

select name as data from phonebook where phone like '[NUMBER]'
 

zorka

Guru
Joined
Jul 16, 2009
Messages
41
Reaction score
4
Superfecta and Arduino

I have been playing around a bit with an arduino (www.arduino.cc) and made a little display to show incoming phone numbers and names using Superfecta.
The project is using a slightly adapted source-Send_to_Winunciator.php data source called source-Send_to_Arduino.php

PHP:
<?php
//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);
//this data source created by Zorka  01/18/2011

//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 = "This source will send the number and the Caller ID to a webenabled Arduino.<br>Enter the URL of the Arduino in the format `url:port`.<br>This datasource should be one of the last data sources on your list, as it does not provide any data of its own, and can only send what information has been collected before it is run.<br>This data source requires Superfecta Module version 2.2.3 or higher.";
$source_param = array();
$source_param['URL_address']['desc'] = 'Specify the URL:Port to the Arduino installation. (Example: 192.168.1.222:8080)';
$source_param['URL_address']['type'] = 'text';
$source_param['URL_address']['default'] = '';

if($usage_mode == 'post processing')
{
    if ($run_param['URL_address'] !='')
   {
       $thenumberformated = $thenumber;

      $url=$run_param['URL_address'].'/ASTERISK_IN|'.$first_caller_id.'|'.$thenumber;

        if($debug)
      {
          print 'Send to Arduino: '.$run_param['URL_address'].'<br><br>';
      }
                
      $value = get_url_contents($url);
    }
}
?>
The arduino itselfs is a Duemilanove with an ethernetshield and Hitachi HD44780 compatible LCD (20 x 4). Besides the caller info, it also display the time and date it gets from a internet timeserver. Here's the code :

Code:
#include <SPI.h>
#include <Ethernet.h>
#include <String.h>
#include <Udp.h>
#include <Time.h>
#include <LiquidCrystal.h>

/*##########################################################################################
# user adjustable parameters
##########################################################################################*/
const int timezone = 1;
const int displaytime = 20000;
const int timesync = 30;

LiquidCrystal lcd(8, 9, 4,5 , 6, 7);
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,70,222 };
byte gw[] = { 192,168,70,254 };
byte timeServer[] = {192, 168, 70, 100};
Server server(80);

/*##########################################################################################
##########################################################################################*/

unsigned long int timer1;
time_t prevDisplay;
unsigned int localPort = 8888;
const int NTP_PACKET_SIZE= 48;
byte packetBuffer[ NTP_PACKET_SIZE];
boolean numberDisplay = false;
String line1;
String line2;
String line3;
String line4;

boolean updated = false;

void setup()
{
  
  lcd.begin(20, 4);
  lcd.setCursor(4,1);
  lcd.print("PhoneDisplay");

  Ethernet.begin(mac, ip, gw);
  server.begin();
  
  Udp.begin(localPort);
  setSyncInterval(timesync);         
  setSyncProvider(SetNetworkTime);

  delay(5000);
}

void loop()
{
  String readString;
  
  if (updated) {
     updateDisplay();
     updated = false;
  }

  if( now() != prevDisplay)
  {
    prevDisplay = now();
    digitalClockDisplay();  
  }
  
  if (millis() - timer1 > displaytime) {
    numberDisplay = false;
    line2 = "";
    line3 = "";
    line4 = "";
  }


  Client client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        readString += c;
        
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();

          if (readString.startsWith("GET /ASTERISK_IN|")) {
            if (readString.startsWith("GET / HTTP/1.1")) {
            } 
            else {
              line2 = readString.substring(17,readString.indexOf("|",17));
              line3 = readString.substring(readString.indexOf("|",17)+1, readString.indexOf(" HTTP"));
              line4 = "Incoming Call";
              numberDisplay = true;
              updated = true;
              timer1 = millis();
            }
          }

          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } 
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
  }
  now();
}

unsigned long sendNTPpacket(byte *address)
{
  // set all bytes in the buffer to 0
  memset(packetBuffer, 0, NTP_PACKET_SIZE);
  // Initialize values needed to form NTP request
  // (see URL above for details on the packets)
  packetBuffer[0] = 0b11100011;   // LI, Version, Mode
  packetBuffer[1] = 0;     // Stratum, or type of clock
  packetBuffer[2] = 6;     // Polling Interval
  packetBuffer[3] = 0xEC;  // Peer Clock Precision
  // 8 bytes of zero for Root Delay & Root Dispersion
  packetBuffer[12]  = 49;
  packetBuffer[13]  = 0x4E;
  packetBuffer[14]  = 49;
  packetBuffer[15]  = 52;

  // all NTP fields have been given values, now
  // you can send a packet requesting a timestamp:         
  Udp.sendPacket( packetBuffer,NTP_PACKET_SIZE,  address, 123); //NTP requests are to port 123
}

unsigned long SetNetworkTime(void)  
{

  sendNTPpacket(timeServer); // send an NTP packet to a time server
  
  const unsigned long seventyYears = 2208988800UL;    
  unsigned long highWord;
  unsigned long lowWord ;  
  unsigned long secsSince1900; 
  unsigned long epoch=0; 

  delay(100);  
  if ( Udp.available() ) {  
    Udp.readPacket(packetBuffer,NTP_PACKET_SIZE);  // read the packet into the buffer
    highWord = word(packetBuffer[40], packetBuffer[41]);
    lowWord = word(packetBuffer[42], packetBuffer[43]);  
    secsSince1900 = highWord << 16 | lowWord; 
    epoch = secsSince1900 - seventyYears; 
    setTime(epoch);
   }
   else if (timeStatus() == timeNotSet){
      setTime(epoch);
   }

    return (epoch);
  }


void digitalClockDisplay()
{
  // digital clock display of the time
  

  time_t utc, local;

  utc = now();
  local = utc + timezone *60 * 60; 

  line1 = "";
  if (hour(local) < 10)
    line1 += "0";  
  line1 += hour(local);
  line1 += ":";

  if (minute() < 10)
    line1 += "0";
  line1 += minute();
  line1 += ":";

  if (second() < 10)
    line1 += "0";
  line1 += second();

  if (timeStatus() == timeNeedsSync)
    line1 += "* ";
  else
    line1 += "  ";
  
  if (day() < 10)
    line1 += "0";
    
  line1 += day();
  line1 += "/";
  if (month() < 10)
    line1 += "0";
  line1 += month();

  line1 += "/";  
  line1 +=year(); 

  
  updated = true;
}

void printDigits(int digits, String line){
  if(digits < 10)
    line += '0';
  line += digits;
}


void updateDisplay()
{
  lcd.clear();
//  delay(100);
  lcd.setCursor(0,0);
  lcd.print(line1);
  lcd.setCursor(0,1);
  lcd.print(line2);
  lcd.setCursor(0,2);
  lcd.print(line3);
  lcd.setCursor(0,3);
  lcd.print(line4);

  updated = false;
}
Use it at your own risk :wink5:
 

dbenwit

New Member
Joined
Apr 26, 2009
Messages
13
Reaction score
0
CID Superfecta 2.2.4 on trixboxCE 2.8.0.4

I have installed the CID Superfecta 2.2.4 module on trixboxCE v. 2.8.0.4 which uses Asterisk 1.6.

From my previous experience using CID Superfecta on trixbox, everything seems to installed properly, but when I go to the Default Caller ID scheme, I do not see the data sources under the Date Sources section and I get a message

Forbidden

You don't have permission to access /admin/modules/superfecta/sources.php on this server

I've checked the permissions and ownership on directories and files in this path and everything seems to be OK.

Anyone having a similar problem using CID Superfecta 2.2.4 on trixboxCE 2.8.0.4 or know why this problem is occurring?

Dave
 
Joined
Apr 22, 2009
Messages
230
Reaction score
0
try for testing purpose to remove the .htaccess file in the /module directory or even maybe the one one folder up.

If it works, then you know where to look to solve your issue.
 

byersjus

New Member
Joined
Jan 19, 2010
Messages
16
Reaction score
0
New Database Sources

I just wanted to post two new sources I created out of necessity. I tried to register at the developer site, but it didn't work.

They're a PostgreSQL source and a MS SQL source. The two attached files should be placed in /var/www/html/admin/modules/superfecta/bin.

Before you can use them you'll need to install PostgreSQL and MS SQL for PHP like so:

$ yum install php-pgsql

and

$ yum install php-mssql

After installing the php modules you'll need to restart apache:

$ service httpd restart

Clearly the sources are just copies of the MySQL source with a few edits, so don't give me too much credit. I didn't look up the author of the MySQL source, but please thank them.

I created the PostgreSQL source because I'm using DAViCal server (a great CalDAV and CardDAV server) for contact storage at home, and I wanted to do CID lookup from that database. My settings are:

Standard host, database, user, and password entries.
SQL Query: SELECT get_name_from_number('[NUMBER]') AS data;

As you might guess, you'll need to create a new function named "get_name_from_number". Mine ended up like this:

Code:
CREATE OR REPLACE FUNCTION get_name_from_number(text)
  RETURNS text AS
$BODY$SELECT addressbook_resource.fn FROM public.addressbook_resource INNER JOIN public.addressbook_address_tel ON addressbook_resource.dav_id = addressbook_address_tel.dav_id WHERE regexp_replace(addressbook_address_tel.tel, '\\D', '', 'g') = $1 ORDER BY addressbook_resource.fn ASC;$BODY$
  LANGUAGE 'sql' VOLATILE
  COST 100;
ALTER FUNCTION get_name_from_number(text) OWNER TO postgres;

I created the MS SQL source because I'm using SugarCRM at work for contact storage. Of course there has been a SugarCRM source for a while, but that is really just a specialized MySQL source. SugarCRM can now be installed on MS SQL, which mine is. My settings are:

Standard host, database, user, and password entries.
SQL Query: exec get_name_from_number [NUMBER]

Again, you'll need to create a stored procedure named "get_name_from_number". This one is:

Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE get_name_from_number
    @number varchar(25)
AS
BEGIN
    SET NOCOUNT ON;

    CREATE TABLE #TEMP([name] varchar(250))

    INSERT INTO #TEMP ([name]) (SELECT [name] FROM accounts WHERE Replace(Replace(Replace(Replace(phone_office,'(',''),')',''),' ',''),'-','') = @number)

    INSERT INTO #TEMP ([name]) (SELECT first_name + ' ' + last_name FROM contacts WHERE (Replace(Replace(Replace(Replace(phone_work,'(',''),')',''),' ',''),'-','') = @number) OR (Replace(Replace(Replace(Replace(phone_mobile,'(',''),')',''),' ',''),'-','') = @number))
    
    SELECT [name] AS data FROM #TEMP
END
GO

Of course the PostgreSQL query was more elegant with regular expressions, but since regexs are a pain to get setup on MS SQL, I just winged it with Replace().

Thanks to all of the contributors on this forum, it's a great place!

-Justin
 

Attachments

  • DB_Sources.tar.gz
    1.3 KB · Views: 19

dbenwit

New Member
Joined
Apr 26, 2009
Messages
13
Reaction score
0
try for testing purpose to remove the .htaccess file in the /module directory or even maybe the one one folder up.

If it works, then you know where to look to solve your issue.

Thanks for your input. Unfortunately, I cannot find any .htaccess file in the path to the sources.php file. I am currently not using the Administrator ACL, only the basic security provided by the maint user.
 

dbenwit

New Member
Joined
Apr 26, 2009
Messages
13
Reaction score
0
Sorry, my bad

There was an .htaccess file in the modules/ directory. When I removed it, the problem of accessing the sources.php file went away.

The .htaccess file contained the single line

Deny from All

I replaced the Deny with Allow in the file and put it back in the modules/ directory and was able to access the sources.php file. I could of also just left the .htaccess file out of the modules/ directory altogether.
 

MarkWorsnop

New Member
Joined
Jun 6, 2009
Messages
7
Reaction score
0
Now what?

You don't have permission to access /admin/modules/superfecta/bin/callerid.php on this server.
 

candrews

New Member
Joined
Jan 25, 2011
Messages
4
Reaction score
0
CallerID Superfecta for standalone Asterisk

I currently have Asterisk installed on my OpenWRT router, and since there's no way to run PBX in a flash on my OpenWRT, I can't use the CallerID Superfecta module on it.

Since Superfecta is PHP, I figure there must be a way to run it without the whole PBX in a flash stack, but I can't find any documentation on how to do so.

Note that the GUI and all that are completely unimportant, and if some features are missing/extremely difficult to set up, that's fine. I also don't think this is that rare of a situation, I think there are a *lot* of Asterisk installations out there not running PBX in a flash that would benefit from awesome caller ID.
 

tm1000

Schmoozecom INC/FreePBX
Joined
Dec 1, 2009
Messages
1,360
Reaction score
78
candrews,

You are getting PBXinaflash confused with FreePBX. PBXinaflash uses FreePBX which is what CallerIDsuperfecta is written on. CIDsuperfecta replies heavily upon mysql, so you'd actually have to install PHP + cURL + MySQL + Apache, then we could see what we could do to get it to work.
 

candrews

New Member
Joined
Jan 25, 2011
Messages
4
Reaction score
0
candrews,

You are getting PBXinaflash confused with FreePBX. PBXinaflash uses FreePBX which is what CallerIDsuperfecta is written on. CIDsuperfecta replies heavily upon mysql, so you'd actually have to install PHP + cURL + MySQL + Apache, then we could see what we could do to get it to work.

Sorry about the confusion - that distinction is obvious in retrospect.

In any case, how can I get CallerIDsuperfecta to run on PHP+cURL+MySQL+Apache (all common things I have available)?

I'm not eager to hack it and get it to work just for myself if the community has already done this.
 

Members online

No members online now.

Forum statistics

Threads
25,811
Messages
167,759
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top