Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-09, 02:20 AM
tshif tshif is offline
Guru
 
Join Date: Jan 2008
Location: San Diego, Calif
Posts: 1,131
Caller ID Superfecta: THE MODULE
NOTE: This thread covers the early released versions of the Caller ID Superfecta module for FreePBX.
THIS INFORMATION IS OBSOLETE and is maintained here for historical and reference purposes only.
Go here for the current CID Superfecta thread. (tshif)

Caller ID Superfecta: THE MODULE
If there is one thing that is universally expected when people set up a PBX, it’s got to be Caller ID. And, as we all know – Caller ID is the responsibility of the receiving party’s telephone providers. Um, in simpler terms, that's US, and our PBX's.

There’s at least two very good examples of this function right here in the forum. The Ultimate CNAM, originally created by former forum participant Titanous and the Caller ID Superfecta, originally written by our own Nerd Uno, Ward Mundy.

As a testimony to open software – both of these creations have now exceeded their original programmers’ vision because the community here at the PBXIAF forums has contributed to their growth. Today – each of these Caller ID look up programs has been extended to include more sources of information than the original authors would have imagined.

There’s just a couple little hiccups with getting all this good stuff working right. The install scripts have to be run from a CLI, and their configuration parameters have to be edited in a text file editor. I always thought it should be possible to install, configure and use these great tools without having to do all that. And - when its time to upgrade – its just to messy for an end user to attempt.

Since I’ve been on a module kick of late – it occurred to me that all that could be solved by “modularizing” the Caller ID function into a FreePBX Module.




Open Software Should Be Open
It’s a rare and beautiful thing to see folks contributing to a coding project. But have a look around here at the PBXIAF forums and you see it; A lot of it. It may not be unique – buts its rare enough. I most sincerely hope that all of you who have contributed to the Superfecta code upgrade along the way will consider updating this module in the same way. I will certainly keep track of its status – but everyone here who has been contributing should feel as welcome to provide upgrades to the module as they have for the non module version of the Superfecta. I hope to have it in a svn soon – so that all can have easy access.

The module still installs and uses callerid.php. The only changes I have made were to comment out the configuration section in the script, and add a few lines of code to cause it to gather those same configuration items from a database. The changes are well commented, and highly localized, just as the previous block of config data was at the top of the script. For the typical upgrade, such as when a provider changes their output, modifying the script will feel identical to how you have done so in the past.

To add additional sources can be accomplished almost as easy with more changes to the supporting module code.

Install and Upgrade
This module should co reside with any and all other CID solutions you maybe running. It will take about 1 minute to complete the install. Upgrading will not wipe out your settings.

Installation:
(This download link was updated on 5-3-2009 to point to the most current version of this module - tshif)
Step 1: Download the module to your desktop From here. (Generally, you'll want to select the most recent released (non-dev) version.)
Don’t decompress the archive!
Step 2: Use a web browser to access FreePBX on your PBX. Choose Tools, Module Admin, Upload Module.
Now, browse to the superfecta-1.0.3.3.tgz file on your Desktop and click the Upload button. Now click local module administration, scroll down and click on CID Superfecta and then the Install radio button. Now click Process, and complete the usual FreePBX install and reload process.
Step 3: Use a web browser to access FreePBX on your PBX. Choose Setup, CID Superfecta.
You will be presented with configuration screen. Establish settings that make sense for your PBX, and Save your changes.
Step 4: Use a web browser to access FreePBX on your PBX. Choose Setup, Caller ID Look Up Sources.
The module installer has already created the entry for Caller ID Superfecta. Select if from the list. In the USERNAME enter MAINT, PASSWORD field enter your current PBXIAF MAINT password.

NOTE: Yes, I know the password is visible. It’s a FreePBX thing. If it means anything to you, I think the password box should be obfuscated (stars) by FreePBX. But until they come around to my way of thinking (lol), consider this. If the person is already viewing this screen, they have to have the password already – or they couldn’t be here. If this STILL drives you crazy - look here for a fix. (4/1/09: (http://freepbx.org/trac/ticket/3613. Sorry - I tried. I guess I didn't do the naked dance around the fire well enough to appease the "great ones". If I ever get so closed-eared and arrogant, please somebody shoot me.)

Conditions/Prerequisites:
TThis module is compatible with the security models used in, and has been tested with the following distributions:
Fonicatec PABX
Foncordiax
PBX In A Flash
TrixBOX CE
The Module’s wiki Page is here.
(If you use a distro other than PBXIAF, read the wiki for more installation help.)

Asterisk Version Compatibility
This module has been tested and found to work correctly with Asterisk versions 1.4 and 1.6.

Credits:
The CallerID Superfecta was written originally by Ward Mundy, as the Caller ID Trifecta. It has evolved to support more sources, and is now maintained by the community of forum users at PBX In a Flash.
The Superfecta was converted to FreePBX Module format by Tony Shiffer & Jerry Swordsteel.

Notice:
The Developement Home page for this module is here.

The Caller ID code undergoes regular maintenance - it is our hope that by placing the module in an svn that everyone who wants to contribute can and still will do so. Besides, this a great way for you to start getting familiar with modules in general!

I’ll post the link to the svn back to this article as soon as its ready.

Until next time
-tshif

Last edited by tshif : 11-04-09 at 03:18 PM. Reason: Added notation about obsolete, and link to current thread.
Reply With Quote
  #2  
Old 03-13-09, 06:15 AM
wardmundy wardmundy is offline
Nerd Uno
 
Join Date: Oct 2007
Posts: 3,881
Niiiiiiiiiiiice, Tony!


Would you mind adding the new SugarCRM module, too?
Attached Files:
File Type: zip sugarcrmclid-0.9.3.zip (1.5 KB, 12 views)

Last edited by wardmundy : 03-13-09 at 06:17 AM.
Reply With Quote
  #3  
Old 03-13-09, 02:38 PM
tshif tshif is offline
Guru
 
Join Date: Jan 2008
Location: San Diego, Calif
Posts: 1,131
We finished adding the SugarCRM piece to Superfecta Module. I don't have any way to test it. Here is the module with the SugarCRM Part. Would some one with SugarCRM please try this out for me? (This code is obsolete. This thread is still here for archival purposes only.5-3.090)

NOTE: Because there is a database change - if you have the previous version of this module installed, it will be necessary to use FreePBX to UNINSTALL the previous module, and then install this new one. Your configuration settings for Superfecta will have to be re-entered.

Somebody - PLEASE let me know if this works with SugarCRM -

Tony

Last edited by tshif : 05-03-09 at 06:56 PM. Reason: Download obsolete link
Reply With Quote
  #4  
Old 03-13-09, 07:26 PM
Lost Trunk Lost Trunk is offline
Guru
 
Join Date: Aug 2008
Posts: 157
Originally Posted by tshif View Post
This module depends up the Asterisk DB AMP user ID and password being set at their default values. The module script may be edited to reflect your actual id and passwords if you have changed them.
Any particular reason you can't simply read those vales from the /etc/amportal.conf file? There are distributions based on FreePBX where these passwords are not set to the FreePBX default, but you can always get the correct AMPDBUSER and AMPDBPASS values (if that's what you're using) from amportal.conf.
Reply With Quote
  #5  
Old 03-13-09, 07:31 PM
tshif tshif is offline
Guru
 
Join Date: Jan 2008
Location: San Diego, Calif
Posts: 1,131
It's something we are working on for future updates.

Due to the strength of the PBXIAF security methods - very few people change that ID/PW. I'm sure you've read Wards postings on the topic of changing them before.

Last edited by tshif : 03-13-09 at 07:38 PM.
Reply With Quote
  #6  
Old 03-13-09, 07:37 PM
tshif tshif is offline
Guru
 
Join Date: Jan 2008
Location: San Diego, Calif
Posts: 1,131
Obfuscating the Password Field Contents in FreePBX Caller ID Lookup Sources
Obfuscating the Password Field Contents in FreePBX Caller ID Lookup Sources.

For this project - we had to enter our MAINT ID and Password into the Caller ID lookUp Sources section of FreePBX.

I discovered that the field displays plain text. (http://freepbx.org/trac/ticket/3613. Sorry - I tried. I guess I didnt do the naked dance around the fire well enough to appease the "great ones".)

I KNOW that anyone who has gotten this deep into the system would already have to KNOW that password - but I *hate* that it displays it in plain text.

Heres a quick fix for that. It should last until you update the CIDLookup module of FreePBX at some time in the future.

Using your favorite editor, open this file:
Code:
/var/www/html/admin/modules/cidlookup/page.cidlookup.php
On line 145, locate the section that reads: type="text" and change it to read: type="password"

Save your changes. Now, go back and view one of your caller ID look up sources. The password field is not displaying plain text any more.

This process has been tested with FreePBX v 2.5.1.1, and should work with all versions of the cid lookup module.

-tshif

Last edited by tshif : 04-03-09 at 07:24 PM. Reason: Added the inevitable reject notice from FreePBX trac ticket
Reply With Quote
  #7  
Old 03-14-09, 12:01 AM
Lost Trunk Lost Trunk is offline
Guru
 
Join Date: Aug 2008
Posts: 157
It broke
Doesn't work here - I get this in the CLI (changed the incoming number, otherwise this is exactly how it appeared):

Code:
    -- Executing [s@macro-user-callerid:19] NoOp("SIP/1-pstn-b7e65348", "Using CallerID "<!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN>
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href=https://127.0.0.1/admin/modules/superfecta/callerid.php?thenumber=9999999999>here</a>.</p>
<hr>
<address>Apache/2.2.3 (CentOS) Server at 127.0.0.1 Port 80</address>
</body></html>" <9999999999>") in new stack
That html code actually appears in my CLI output, and as shown, the CID name is set to
Code:
<!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN>
I did change the password in the script, etc. and the weird part is that if I execute the url directly from a browser, using

Code:
https://serveripaddress/admin/modules/superfecta/callerid.php?thenumber=9999999999
Then it works. The CID lookup source "Path" is set to /admin/modules/superfecta/callerid.php which seems correct, so I don't get the problem.

EDIT: If I try to use this URL with WGET on the server itself, using an ssh connection, I get this error:

Code:
--01:13:57--  http://127.0.0.1/admin/modules/superfecta/callerid.php?thenumber=9999999999
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://127.0.0.1/admin/modules/superfecta/callerid.php?thenumber=9999999999 [following]
--01:13:57--  https://127.0.0.1/admin/modules/superfecta/callerid.php?thenumber=9999999999
Connecting to 127.0.0.1:443... connected.
ERROR: cannot verify 127.0.0.1's certificate, issued by `/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost.localdomain':
  Self-signed certificate encountered.
ERROR: certificate common name `localhost.localdomain' doesn't match requested host name `127.0.0.1'.
To connect to 127.0.0.1 insecurely, use `--no-check-certificate'.
Unable to establish SSL connection.
Two other questions:

At one time, in an earlier incarnation, this also had a lookup source for Canadian area codes - did that stop working, or did the code for that just get lost somewhere along the line?

Also, if the call does come in with valid Caller ID, is this smart enough to not do a lookup anyway, or does it just assume that any Caller ID name received must be wrong? It would be nice if there were a way to make this trigger only if there is no name received, or if the name received matches certain patterns (such as "Unknown Caller" or whatever the provider sends when it can't do the lookup).

Last edited by Lost Trunk : 03-14-09 at 12:17 AM.
Reply With Quote
  #8  
Old 03-14-09, 12:18 AM
tshif tshif is offline
Guru
 
Join Date: Jan 2008
Location: San Diego, Calif
Posts: 1,131
You missed a step
Those symptoms:

Quote:
<!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN>
usualy mean only one thing - you missed this step (or perhaps didn't save):

Step 4: Use a web browser to access FreePBX on your PBX. Choose Setup, Caller ID Look Up Sources.
The module installer has already created the entry for Caller ID Superfecta. Select if from the list. In the USERNAME enter MAINT, PASSWORD field enter your current PBXIAF MAINT password.

Quote:
At one time, in an earlier incarnation, this also had a lookup source for Canadian area codes - did that stop working, or did the code for that just get lost somewhere along the line?
Quote:
Also, if the call does come in with valid Caller ID, is this smart enough to not do a lookup anyway, or does it just assume that any Caller ID name received must be wrong? It would be nice if there were a way to make this trigger only if there is no name received, or if the name received matches certain patterns (such as "Unknown Caller" or whatever the provider sends when it can't do the lookup).
Those are great questions - I have no idea. The Module incorporates the Superfecta callerid.php script - theres a whole thread devoted to its care and maintenance. Check it out when you get time.

I do think the script is smart enough to NOT check each source once it finds a Hit, it stops looking - but I could be wrong.

- tshif

Last edited by tshif : 03-14-09 at 04:55 AM.
Reply With Quote
  #9  
Old 03-14-09, 12:46 AM
Hat Hat is offline
Guru
 
Join Date: Dec 2007
Posts: 84
Tony,

Thanks for yet another add-on that installs cleanly. So far this works as advertized. I do not have Sugar CRM, soooo...I can't help you with that one.


Tom
Reply With Quote
  #10  
Old 03-14-09, 01:07 AM
tshif tshif is offline
Guru
 
Join Date: Jan 2008
Location: San Diego, Calif
Posts: 1,131
Originally Posted by Hat View Post
Tony,

Thanks for yet another add-on that installs cleanly. So far this works as advertized. I do not have Sugar CRM, soooo...I can't help you with that one.


Tom
Our first success report! Thanks for letting me know Tom
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:56 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007-2008, Ward Mundy & Associates