FusionPBX Caller ID Lookup support – what I know so far (and what I don’t).

Previous: FusionPBX Basic Configuration: Using Google Voice and Using YATE to overcome Google Voice issues in FreeSWITCH and Asterisk

One of the main reasons I have been reluctant to use FusionPBX in actual “production” use, besides the fact that I’m still in the learning process, is that there is no equivalent of the Caller ID Superfecta module for FusionPBX.  This doesn’t matter as much if you are not using Google Voice or some other service that doesn’t provide Caller ID names, but if you are then it’s nice to have a way to attempt to look up a name using one or more of the free online services.  FreeSWITCH supports this to some extent with their CID Lookup module (mod_cidlookup) but FusionPBX offers no built-in support for it, except for the following:

1) You can enable or disable the module, and stop or start it from System|Modules:

FusionPBX Module List – CID Lookup

The above shows the module enabled and running, but that’s not the default state. To enable it, click on the edit icon on that line and set the two Enabled fields to True and then Save:

FusionPBX Module Update – CID Lookup

Then you can go start the module, but it won’t do much until you configure it, and FusionPBX doesn’t have a configuration utility, which brings us to…

2) You can directly edit the cidlookup.conf.xml file used by the module from Advanced|XML Editor:

FusionPBX XML Editor showing default cidlookup.conf.xml file

As you can see in the image above, the file is in the Files|autoload_configs section of the XML editor, which translates to /usr/local/freeswitch/conf/autoload_configs in the Linux filesystem (at least that is the case if you used Debian Linux and the Easy Install script).

Documentation for the module is in two pages on the FusionPBX and FreeSWITCH wikis:

Mod cidlookup (FusionPBX wiki)
Mod cidlookup (FreeSWITCH wiki)

Where I am having difficulty at the moment is that they talk about creating a table in a database, but I’m not sure that’s even necessary for what I want to do (use one or more web sites as lookup sources), and in any case they don’t give complete instructions for doing that. It’s as though they assume you have worked with whatever database FreeSWITCH uses and know where you have to be to start creating a table, but I don’t. Also, by default, FusionPBX uses SQLite, but the example that would be relevant to my system is labelled “PostgreSQL (fusionpbx version 3 or higher)”, and that makes me wonder if the examples shown are truly relevant to my system (and if they aren’t, do I need to do a complete reinstall to use PostgreSQL, or what)?

FusionPBX doesn’t seem to yet have an equivalent of the “Asterisk Phonebook” so the idea of using a local database to store Caller ID listings as an additional lookup source makes me wonder how you would manage that (add/edit/delete individual entries — that alone cries out for a configuration page), and then there is the question of how you would actually get your Inbound Routes to USE the Caller ID Lookup.

And assuming you can make that all work, then there is the question of whether you can add additional lookup sources that can be checked, in case the first doesn’t return anything useful (again, similar to what Caller ID Superfecta does). I’m sure all of this can be done, but given my age and the increasing difficulty I am having figuring things like this out, I don’t know if I will ever be able to figure this out or not — if I do I will update this article accordingly.  EDIT: See the comments on this article for a few additional bits of information that may be helpful if you are trying to get this to work.

I want to preface this by saying that there are a lot of things I really like about FusionPBX, but this is one of those cases where the Wiki doesn’t give quite enough information to be useful to a new users, and the lack of an online Forum means you can’t ask for help in setting this up, and then leave a permanent record of any responses that others can read.  I’ve already seen some indication that people might be getting tired of answering questions in the IRC channel (or maybe someone was just having a bad day), but if the answers that are provided scroll off the screen and are gone forever, then of course new users will want to cover the same ground that’s been covered before (maybe many times) with some other user.  Either getting the Wiki in better shape, or having an online forum would help that situation.  Unfortunately, the code that approves new Wiki users (by sending an e-mail confirmation) is broken, so now even if someone wanted to help improve the Wiki, they might not be able to if they don’t already have an account that’s been approved.

35 Comments

  1. the FusionPBX wiki page at present relates only to using cidlookup for looking up numbers in the FusionPBX contacts database (table is v_contacts). The bulk of the configuration info is on the FreeSwitch wiki, which leads one to believe that you can lookup from url, fall back to local database lookup and if that also fails do a city/state lookup.

    I have write access to the wiki so contact me via my email address to see if we can improve the wiki.

  2. For the FusionPBX wiki description, the sql being presented there is to tell cidlookup where to get its data from. That table is in the FusionPBX database already (known as Contacts, from Apps/Contacts in UI), it shouldn’t be too difficult to figure out the sqlite version of the same select query.
    As for age, I am 64 and not having too much trouble with any of this so there should be hope for you :-)

  3. Gerrit Visser, you said:

    “For the FusionPBX wiki description, the sql being presented there is to tell cidlookup where to get its data from. That table is in the FusionPBX database already (known as Contacts, from Apps/Contacts in UI)”

    So wait, you are saying that the SQL stuff on that Wiki page can be ignored, because it’s already done? If so, why is it there at all, or at the very least, why isn’t there some sort of notation saying it’s there for educational purposes only? That particular page really has issues to begin with — it’s not really “instructions”, it’s just a lot of information thrown together with no real indication to the user what needs to be done to get it all working.

    “it shouldn’t be too difficult to figure out the sqlite version of the same select query.” Maybe not for someone who has ever worked with databases, perhaps, but I wouldn’t even know how to get into an SQL=type program to enter those commands in the first place, let alone translate them from one SQL-type program to another. You might as well ask me to translate Chinese to Korean (since I don’t know either language at all). I get the feeling that whoever wrote many of the Wiki pages assumed that most readers would have knowledge that in reality they do not, which is one reason they seek out a GUI in the first place.

    As for the age thing, the point I try to get across to people is that it’s not that you cannot learn new things, but it might take you longer than someone in their 20′s or 30′s, and it really helps if the person doing the explaining has a little patience and doesn’t assume prior knowledge. Remember that when I grew up the only keyboards we had were on typewriters, and even most adding machines were mechanical, not electronic (computers existed, but only very large businesses could afford them). So I’ve never really had any exposure to databases apart from MySQL, and only that because it’s used by “The Software I have Come To Hate”, and I never interact with it directly, but only through that software (or in rare cases, I have used something like PHPmyadmin or Webmin’s database viewer). So when a page throws a bunch of database commands at me like that, I don’t even know how to enter them, because I’m guessing you have to be inside some program when you do it (not just at a Linux command prompt).

    But if, as you say, the table is already in the database (and therefore, you don’t need to enter those lines at all), then why is that information on the page to begin with, with no explanation of why it’s there or who would need to use it? That’s what I don’t get.

  4. I can tell that you touch type, I never learned that :-)
    On the topic of wiki pages in general, they are written by people who figured something out, made it work and then added it in their way to the wiki. This IMO is the weakest link on the whole FOSS process, documentation by those who might or might not understand it and who may or may not have English as a first language and who may or may not have a decent command of it regardless of first language or not.
    Back to cidlookup then keeping that in mind:
    The place to start is on FS’s wiki as that is where they describe the module. Cidlookup can get its info via a URL or via a database lookup or via a user defined script, which can be written in lua or php or.. In typical FreeSwitch style, they don’t quite describe the operation but I surmise that there is a fall trough in play where it tries to get info from each ‘provider’ in sequence until it gets what it asked for. The default FS config uses 2 URL’s first, then a db lookup. The URL lookups rely on you having a paid account, hence the APIKEY in caps. The db lookup relies on you having set up a db table and filled it with NPA data. So, none of it will work out of the box until you get at least an app key for one of those providers.
    Back to FusionPBX, the example given there uses the built in Contact database table which FusionPBX creates on install. You add data to that table using App/Contacts. You configure cidlookup to use this table as per the FusionPBX wiki.
    Why you need to enter those SQL or URL lines is to tell cidlookup where to get the CNAM from the CallerID. Because it is so flexible, almost anything is possible here and that is typically difficult to describe. E.g after configuring the cidlookup module, you still need to decide where to call it from in the
    You then still need to decide where to trigger the lookup from in your incoming Dialplan, again FS gives you 2 examples.
    Simplest form to use the module, use only a URL, test with that and then get creative with database lookups if that is not enough.
    If you have a free CNAM service to try out, I will be happy to try and assist with configuration (via email, not comments here :-)). We can then use your language skills to whip that wiki page into shape, at least on FS wiki (because that is where the key information should be), then touch up the FusionPBX one.

    Bottom line, the key to working with FusionPBX configuration is to first understand the FreeSwitch module you are working with. FusionPBX applies one way to use each module, there are fortunately or unfortunately many different ways to configure FS and that creates phrases such as ‘One way to …’. I personally have learned to hate the words ‘flexible framework’ over the years because it generally leads to the type of documentation you are seeing. Add the typical *nix attitude of ‘I figured it out the hard way, now it is you turn’ and you arrive where you are today. While using Xchat for FusionPBX info is not the greatest for longevity of the information, I find that it is not too difficult to get what you need from there. The missing link is that most people then don’t update/improve the FusionPBX wiki (yes I know you can’t sign up right now but that will get fixed).
    Regarding db SQL, part of the problem there is that FS and FusionPBX both support 3 or more db’s, none of which are quite compatible in their definition of sql, another side effect of FOSS and freedom of choice! Unfortunately people only document what they use .

    FusionPBX does a great job in abstracting the FS flexibility into an approach that works out of the box but also provides ways to go outside of that (using XML edit)

  5. Actually, I’m NOT a touch typist – a friend once called me the fastest two-finger typist he’d ever seen, though as I grow older my typing speed has definitely taken a downturn, and I make a lot more typing mistakes than I used to.

    Your obeservations about Wiki’s in general are right on, and there’s another thing about them — people (rightly or wrongly) tend to view them as more authoritative than, say, a conversation in a forum, even though very little is usually known about the person who posted the article. For people like me, it means I’m sometimes more reluctant to edit or post in a Wiki unless I’m pretty sure I know what I am talking about. But on the other side of the fence, readers often assume that the Wiki is the last word on a subject, when in fact any given article may have been written OR edited by someone with only partial knowledge of the subject. That “air of authority” doesn’t tend to permeate forums to the same degree, and all in a forum all posts are identified but the poster’s handle, and over time you get a sense of which participants have greater knowledge than you do.

    I’ll contact you by e-mail, probably tomorrow, to respond to some of your other comments. Thanks for your insights!

  6. I just wanted to add this to the above article — it’s a couple of bits of added information that may prove useful to anyone attempting to get this to work.

    Let’s say that ALL you want to do is a lookup from a single source. We’ll use OpenCNAM as an example – it may not be the best but it does nor require use of an API key as long as you are only doing occasional lookups, so it’s easy to explain.

    The first thing you would do is comment out all the lines in the cidlookup.conf.xml file EXCEPT these:

    <configuration name=”cidlookup.conf” description=”cidlookup Configuration”>
      <settings>
        <param name=”url” value=”https://api.opencnam.com/v1/phone/${caller_id_number}?format=pbx”/>
      </settings>
    </configuration>

    Comment out or remove all the other lines, at least for now (if you choose to remove them, back up your original cidlookup.conf.xml someplace safe so you have it for reference).

    Then, in the Inbound Route(s) where you want to do lookups on incoming calls, in the Conditions and Actions section add a new Action with the following settings:

    Tag: action
    Order: 80 (or just before the “transfer” action)
    Type: set
    Data: effective_caller_id_name=${cidlookup(${caller_id_number})}

    This should be all you need to do to pull a lookup from an online source. This will NOT query the FusionPBX Contacts database – that’s possible, I just don’t know how yet. Thanks to Gerrit Visser for helping me get this far.

    Note that if you have Caller ID Superfecta installed on another machine on your network, you may be able to use this URL to get Caller ID Name data from it (this is very experimental so don’t be surprised if it doesn’t work):

    http://192.168.0.123/admin/modules/superfecta/bin/callerid.php?thenumber=${caller_id_number}

    Replace 192.168.0.123 with the address of the machine that has Caller ID Superfecta installed. The reason I say this may not work is because the other server will probably want you to authenticate first and while that’s possible from a standard web browser, I’m not sure it can be done from the mod_cidlookup module (EDIT: see Gerrit Visser’s and Lorne Gaetz’s comments below for the solution. I totally forgot that you could do this. Note I had not yet had the chance to approve Gerrit’s comment when Lorne sent his, so Lorne could not see what Gerrit had written). I just throw is out there in case anyone wants to try to get it to work. For those wanting to go the experimental route, you might also want to take a look at this CallerID Service, which MIGHT provide something akin to Caller ID Superfecta in a more “standalone” environment. If you figure out how to use either of these in FusionPBX, please leave a comment!

    By the way I have not been posting the past few days or working with this stuff much because I have been feeling very fatigued. If and when I regain some energy I’ll try to do a few more things.

  7. CID Lookup from the FusionPBX Contacts table works. Use the PostGresql version 3 config from the FPBX wiki. You will have to configure odbc to create a DSN of course. For Sqlite there is no user or password, just use a pair of single quotes in their place.
    For Windows you need to install a Sqlite ODBC driver, get that from here: http://www.ch-werner.de/sqliteodbc/.
    Gerrit

  8. To provide authentication information you might be able to use the http://uname:pword@192.168.0.123 format. IE and some other browsers no longer support this (can be abused) but it might work from cidlookup.

    Gerrit

  9. I updated the FusionPBX wiki page at http://wiki.fusionpbx.com/index.php?title=Mod_cidlookup

    Gerrit

  10. A few points related to your previous comment:

    First, OpenCNAM is a very good resource for this purpose, and is very generous with their free lookups. They have recently implemented v2 of their API which changes the format slightly for free lookups (and significantly for premium paid lookups). You can read the necessaries here:
    https://www.opencnam.com/docs/v2/apiref
    Superfecta has already transitioned to v2 and tested so you can just take the URL from here:
    https://github.com/POSSA/Caller-ID-Superfecta/blob/v2.2.5.x/bin/source-OpenCNAM.php

    Second, I assume that Fusion has a mechanism that allows unsuccessful lookups to time out. Very occasionally a web lookup request can stall, and you don’t want to keep your caller waiting indefinitely.

    Third, Superfecta can indeed be used to provide lookups remotely depending on the security model used by your FreePBX server. If using the apache security model in the style of PIAF, you can pass the access credentials using this URL:
    http://username:password@address/admin/modules/superfecta/bin/callerid.php?thenumber=caller_id_number
    This URL may work for the other popular distro as well, but I have no way of testing. This technique was recently suggested for logging CNAM for OUTGOING calls. The problem is that you don’t want Superfecta Send To modules to be called when doing this, see this discussion:
    http://pbxinaflash.com/community/index.php?threads/superfecta-2-2-5-send-to-yac-triggered-on-outbound-calls.14004/
    Starting in Superfecta 2.2.6.1 there is a special php file to call specifically for doing non-standard lookups, substitute outboundid.php for calerid.php

    None of this will work with Superfecta 3.x which is still in development

  11. Gerrit Visser wrote:

    You will have to configure odbc to create a DSN of course.

    HUH? Please remember that some of us have NO experience with databases, so when you say that to me, you might as well say “put the thingamajig in the whatchamacallit” and it would make just about as much sense. I have no idea what you are talking about, much less how to do this configuration (and i might add, this is the sort of thing the FusionPBX install script should do. Certain other PBX software distributions do not force their users to grapple with this sort of thing. Not that I would mind having to do it if I knew how, but I’m just saying that it would be netter if the install script took care of this).

  12. Thanks, it needed an update. But it says. “You need to create a DSN that points to your database as well as the required credentials.” And all the folks that haven’t worked with databases are going “WHAT am I supposed to do?!?” NOTHING in that statement makes sense to me at this point.

  13. Lorne, thanks for the information. I would just suggest that if you want to make Caller ID Superfecta more universal, you provide an alternate configuration page that runs on an alternate HTTP port (similar to the configuration for Webmin or Openfire). That way it would not be limited to use with PiaF or Elastix (I remember there was something I had to do to get it to work in Elastix, but don’t recall what offhand). You could, of course, still retain the existing configuration module for those who want it “baked in” to PiaF, but the lookup part of the software works just fine when using another type of software, so it would be nice if the configuration did too, even if it means that the user needs to install MySQL so the functions that require use of a database would work.

    I know it’s probably a bit more work but since you are developing version 3 anyway, it might be something to think about, and would help get Caller ID Superfecta noticed by those who run PBX software not based on Asterisk. Also, it would make Superfecta more resistant to problems caused by changes between F—PBX versions, since those changes have a nasty habit of breaking third-party modules, especially the ones that people have come to depend upon. If the configuration module was broken, people could still use the standalone interface until you could get it fixed. And, if I recall correctly, you guys weren’t particularly happy when someone forked Caller ID Superfecta to create that other standalone program, so creating your own standalone interface would eliminate most of the desire to do that, or to use that other software.

  14. In the time that you took to write your comment you could have looked up how to configure the DSN :-)
    Re creating a DSN, it takes 5 minutes to read the manual for unixODBC to figure that out. For Windows I already pointed to the path from Control panel. When you look at the menus I think you will see that it is quite trivial to do. I just now added a link to unixodbc.org for those who can’t figure out that is where the docs are for that add on.

    Issues 323 already address some ODBC related problems. I also note that for Centos at least the odbc drivers for postgresql are installed by default. I am not sure where the DSN parameters are stored, it likely depends on which Linux you are using. (Just from reading issue 273 and 284 it would seem that my decision to dump linux was a good one, an install mess as usual though I admire the guys writing those scripts.)

    I am submitting a Jira (enhancement request) to FreeSwitch this week with a patch to add mod_cidlookup to the Windows build.

    Gerrit

  15. Gerrit Visser wrote:

    In the time that you took to write your comment you could have looked up how to configure the DSN :-)

    WTF makes you think that I could have done that when I had no idea where to look? How many times to I have to tell you: I HAVE ABSOLUTELY NO KNOWLEDGE OF DATABASES, other than perhaps using a GUI such as Webmin’s to look at the contents of a MySQL database. I have no idea what ODBC is. Furthermore, I shouldn’t NEED to know this to use a feature of FusionPBX. Whatever on earth would make you think that I even knew that such a thing as a “manual for unixODBC” existed?

    If using features of FusionPBX requires users to to search out obscure information about databases, then maybe it really isn’t ready for general usage yet. None of the GUI’s for Asterisk require you to know the first thing about databases* – that’s all hidden from the user, as it should be! How many other pieces of software that utilize databases require the user to interact with the databases directly? Not many, I’d say.

    On the Wiki page you edited, you say “You need to create a DSN that points to your database as well as the required credentials. See the manuals at http://www.unixodbc.org/ for details on configuration.” What an unhelpful link! There is NOTHING on that page that shows how “to create a DSN that points to your database as well as the required credentials”. I clicked on “Manuals” – nope, still nothing obvious about how to do that. I clicked on “A neophyte’s guide” — it gives a bunch of installation instructions — surely I don’t need to do all of this? It does, at least, define a DSN as a “Data Source Name” (in a comment on the installation process) but here is the first part of where it talks about setting up unixODBC:

    In order to get unixODBC running, do these things in this order:

    Do this as root…

    In an xterm, type ODBCConfig . This is a GUI program and must be run in an X session. At the very least you need to set up a driver to use. The drivers will be specific to one database application, like MyODBC is specific to MySQL. In addition to this, you need to specify a setup file to use for this drive. The setup files are the /usr/local/lib/libodbc*S.so libraries where * signifies the database application, so /usr/local/lib/libodbcmyS.so is the “setup file” for MyODBC. The driver (not the setup file) is /usr/local/lib/libmyodbc-2.50.23.so.

    It then talks about setting up a driver, and then says:

    You should have a driver set up before setting up a DSN. After having done so, you may want to set up a system DSN. You do this by selecting the “System DSN” tab, clicking on ‘New’, specifying the driver to use and filling in the required information. You will want to select the driver name you just defined as the Driver in the first screen that displays, and click OK.

    And my head spins… first of all, how do you run an X session? Do you need to set up a driver, and if so, which one, and if not, how do you know which driver name to select? This is waaaaaaaay too much effort, and again, I emphatically say that ideally, all of this should be set up for the user as part of the FusionPBX installation. In any case, these are the sort of instructions that I find much less than helpful, in part because I don’t know what’s already been done and what I would still need to do. You obviously overestimate my experience and knowledge of such things.

    What I need for something like this is “cookbook” style instructions – do this, then do that, and so on (basically the type of instructions that I try to provide in my blog posts). I understand that since you are running FusionPBX under Windows, things might be a bit different, but that unixODBC site is probably not that helpful to someone who isn’t a true Linux geek.

    * I said that “None of the GUI’s for Asterisk require you to know the first thing about databases” and that’s true, but if you are using “The Software I have Come To Hate” it’s helpful at times to know how to change a database value to get around the efforts of the developers to stop you from doing things that they think you should not be able to do, even though such things are perfectly valid as far as Asterisk is concerned. Even figuring out how to do that can be a challenge, but at least you’re dealing with a database that’s already been created and populated.

  16. I agree that Superfecta should be coded such that it is system agnostic. Unfortunately POSSA does not have sufficient coding talent at the moment to do much more than maintain the stable of modules as they are. With luck that will change, but it is difficult to attract and keep volunteers.

    In reviewing Craig Andrews’ project over at:
    https://gitorious.org/callerid-service/
    I see that it has matured a bit since I last tested. For the foreseeable future, this seems like the most likely candidate for Fusion users. The one missing feature that is pretty much a necessity for general usage is the ability to toggle which lookup sources to use, currently it looks like you have to manually delete unneeded sources from the /sources folder. This project would benefit from a bit of (easily located!) documentation so that less experienced users can figure out how to download, install and configure it, and a brief blurb for amateur devs on how to write/adapt a new lookup module. The hosting site does not provide any space for docs or an issue tracker so the only way I can see to contribute is to send an email to Craig from the link on this page:
    https://gitorious.org/~candrews

  17. FusionPBX does not require users to find obscure details, it is your desire to use Mod CID Lookup, which is NOT directly supported by FusionPBX, that is in this case pushing you there. I figured you were smart enough to use Google to search for information, that is how I have found what I needed to in order to help you with this (No, I don’t use Linux which is why I used Google to find the information for you). It appears that the FusionPBX install scripts for FusionPBX install odbc, at least for Centos, perhaps for the other many,many flavours of linux aas well. I suggest that you ask on IRC for FusionPBX (e.g. avimarcus) how to find the odbc config information on Linux since it is already installed.

    http://www.unixodbc.org/doc/UserManual/ shows how to configure a DSN on Linux. I now realize that since you need a full blown description of every single step that I am not the person to do this for you.

  18. Gerrit, first of all I want you to know that I appreciate your help in getting this to work with an external source (such as OpenCNAM). What I did not appreciate was the implication that I was being lazy by not looking something up. It’s kind of hard to look something up if you don’t have the foggiest clue what you are supposed to be looking for. It’s the same reason I get ticked off when people tell someone to Google for information but can’t be bothered to suggest any relevant search terms. You are correct in one thing, if you can’t break it down for me so I can understand what needs to be done, then you are probably not the person to help me going forward. But still, I do appreciate your help to this point.

    I had said that it is possible to query the FusionPBX Contacts database, but I just don’t know how yet. What I probably should have mentioned was that it was not a high priority for me. The thing I really wanted to find out was whether it was possible to do lookups from an external source, and we have pretty much determined that’s possible. But what I think we have also established is that until and unless mod_cidlookup is supported by FusionPBX, it’s going to be too difficult for most users to access the FusionPBX Contacts database. I was wrong in thinking that FusionPBX supported mod_cidlookup when I wrote the previous message; I can only blame that on lack of sleep, since I know better. But it would be really great if it did have baked-in support for Caller ID lookups, even if only making sure all the necessary database stuff is taken care of during the installation.

  19. I will submit a ticket to FusionPBX to use a specific config for that module in place of the default FreeSwitch one. That should solve at least the Contacts portion. It will include a free lookup URL as well. But the ODBC thing on Linsux I just don’t have energy for. I suffered through Sys III, Sys V, BSD4.1, BSD 4.2 for years in the 80′s and again in the 90′s with HP, SGI ans Sun versions and more recently a few years with various flavours of linux. Whatever time I have left on this wold is too valuable to spend on *nix. My voip system was running on *nix, first * then FS and FusionPBX. In the end there were too many ‘you need to compile from source’ but you can’t because you don’t have .. installed. It was an endless circle. I switched to Windows Server (2003 on my Home Server) and tings just work.
    For ODBC and FusionPBX I really do suggest asking on IRC in the late afternoon when Avi or diemos are online. It seems to be installed at least on Centos.

  20. Gerrit, thank you for submitting the ticket. I can understand and appreciate your views on Linux; I’m not a big Linux fan, but on the other hand I don’t want to have to pay for an operating system (particularly when I am just previewing a software package to see if it will work) so Linux and FreeBSD are about the only choices out there, and for some reason it seems hardly anyone is using FreeBSD except for the FreeNAS people (that’s the only application that anyone I know is using that runs under FreeBSD). Also, keep in mind that if a software producer wants to create an ISO distribution that installs their product on a “bare metal” system, they could not include Windows for copyright reasons, but they can use just about any version of Linux. I’m willing to endure a little pain with Linux to get things to work, which basically means that if I have an issue I’ll try to do an online search to see if anyone has solved that specific issue with that particular combination of distro and software. But I at least need to have some idea of how to begin.

    My pet peeve about Linux is that it’s possible to get your system into a state where certain packages cannot be upgraded, even if an upgrade is available in the software repository. Usually it doesn’t matter that much but it’s annoying when it tell you that there is an update available for some piece of software, yet every time you attempt to update, the update fails. When this happens with something that’s a major component on your system, though, it’s worrisome.

    I don’t think people avoid Windows entirely out of cost, although I’m sure cost is a major factor. The real problem is that since Microsoft started checking registrations against a database, if you try running Windows on (for example) a virtual machine and decide that whatever you’re trying out isn’t working and you just want to blow away the VM and start over, the next time you install it Microsoft might decide that the license is already in use and not let you do it, at least not until you call them and get them to reset it. So, anyone who can use Linux without it being too painful an experience does so. You’re certainly not wrong to feel as you do about Linux, and what the world really needs is an open source operating system that does not attempt to have several pieces of software use the same dependencies. That may have been a valid thing to do back when hard drives where still measured in megabytes, but now we have storage measured in gigabytes and terabytes, and there’s no reason each piece of software couldn’t simply include the dependencies it needs, so that you don’t get this issue where different pieces of software want a different version of some dependency and it’s not possible to have both versions running under the same version of Linux. Of course, that’s probably what OS X does (I’m just guessing here), but that’s neither free nor usable on most typical server hardware, such as any non-Apple computer (at least not without a fair bit of effort).

    As for IRC, I’ve been kind of trying to avoid that unless I really get stuck. I have my reasons, not the least of which is that there’s no permanent record of anything said there, so it makes hard to go back and review a conversation at a later date, and no one that’s not present at the time can learn from someone else’s questions and answers.

  21. On Xchat, the windows IRC client I use there is a setting to enable logging to a file. I use this frequently to aid my memory :-)
    I edited the FusionPBX wiki cidlookup page again, now the Linux ODBC section points to FreeSwitch wiki page on the topic. While they are describing how to setup FS to use ODBC, it illustrates the configuration locations.
    I also confirmed that the Ubuntu, Centos6 and FreeBSD scripts all install unixODBC.

  22. Lorne Gaetz wrote:

    In reviewing Craig Andrews’ project over at:
    https://gitorious.org/callerid-service/
    I see that it has matured a bit since I last tested. For the foreseeable future, this seems like the most likely candidate for Fusion users. The one missing feature that is pretty much a necessity for general usage is the ability to toggle which lookup sources to use, currently it looks like you have to manually delete unneeded sources from the /sources folder. This project would benefit from a bit of (easily located!) documentation so that less experienced users can figure out how to download, install and configure it, and a brief blurb for amateur devs on how to write/adapt a new lookup module. The hosting site does not provide any space for docs or an issue tracker so the only way I can see to contribute is to send an email to Craig from the link on this page:
    https://gitorious.org/~candrews

    I couldn’t find any documentation either, so just as an experiment I attempted to install it on the system that’s running FusionPBX by doing this:

    sudo git clone git://gitorious.org/callerid-service/mainline.git /var/www/fusionpbx/cidsvc
    sudo chown -R www-data:www-data /var/www/fusionpbx/cidsvc

    Then, after logging in to FusionPBX from my web browser, I browsed to https://fusionpbx-server-address/cidsvc/index.html which brings up a page where you can (in theory) do Caller ID lookups. But when I entered a phone number and clicked “Lookup”, all it returned was “error”. If I tried to do it using https://fusionpbx-server-address/cidsvc/callerid/callerid.php?format=basic&num=1xxxxxxxxxx that didn’t work either. There is a sample configuration file at /var/www/fusionpbx/cidsvc/config.php.sample which I tried copying to config.php in the same directory, and commenting out a few of the data sources I wasn’t familiar with. Still no luck. There is probably more (possibly much more) you have to do to get it to work, but without instructions you are pretty much flying blind. Plus, it doesn’t have nearly as many data sources as Caller ID Superfecta, and I’ll bet the ones it has aren’t kept updated when something changes in the way a source must be queried.

    You mentioned Superfecta 3.x, which I guess has been on the back burner for many months now. Are you guys still working on that, or is it a case of not enough time or volunteers to finish that project?

  23. Using PIAF I got candrews’ project running fine by loading the files to /var/www/html/cid as root, and renaming the config.php but making no changes. Nothing else not even a chown/chmod and it works for me. I have no suggestions for you, but I would be surprised if it is not something simple.

    Superfecta 3.x is at about 95% and has been for a while, I would say it is ready for some cautious production, some minor features might be a bit rough at this point. My main PBX is running FreePBX 2.8 and 3.x requires 2.9+ so I need to upgrade before I can give it a real workout. I never seem to find time to do this.

  24. Forgot to add…

    PIAF recently added a sub-forum for YATE which otherwise wouldn’t have one. I suspect that the same thing could be done for Fusion/FS if there is a demand for such and the devs are willing to participate. I agree that it is a necessity especially when the project has struggling users.

  25. Lorne, if you got it running under PiaF then I am suspicious that it requires MySQL and won’t use SQLite instead. I am starting to get really tempted to reinstall FusionPBX from scratch and specify MySQL as the database, and also to see if perhaps the Google Voice outbound calling issues have been fixed. I have to give that a bit more thought.

    If Ward wouldn’t mind creating a forum for FusionPBX and FreeSWITCH, it would be interesting to see whether people would use it. It would be great to have a place where discussions are archived and searchable, but what I can’t predict is whether FusionPBX users and/or developers would be willing to come to the PiaF forums and use a forum there, even if it were dedicated to FusionPBX and FreeSWITCH. The software used on the PiaF forum is definitely a lot more conducive to discussions that some of the other forum software I’ve seen.

  26. I didn’t think my install was tied to MySQL in any way, so I temporarily stopped they MySQL service and lookups proceed fine. My install process:
    1. Copy the entire project to /var/www/html/cid/
    2. rename config.php.sample to config.php

    That’s it. Files are owned root:root, 766

    You might try “chmod -R 777″ on all files just to rule out a permission issue. It is also possible that this project requires PHP to be compiled with certain options that are available by default on PIAF, PHP errors show up in the httpd log on PIAF. Can’t think of anything else.

  27. I reinstalled the CallerID Service and followed your suggestions, except for the install path (FusionPBX defines /var/www/fusionpbx as the root for the web server, which is why I used /var/www/fusionpbx/cidsvc). The larger issue may be that FusionPBX uses nginx by default (though I could have selected apache during the install if I’d known it would matter). In the file /var/log/nginx/.error.log I see this error message:

    2012/10/30 10:36:46 [error] 1080#0: *1050 FastCGI sent in stderr: “PHP message: PHP Fatal error: Call to undefined function curl_multi_init() in /var/www/fusionpbx/cidsvc/callerid.php on line 200″ while reading response header from upstream, client: xx.xx.xx.xx, server: fusionpbx, request: “GET /cidsvc/callerid.php?format=json&country=us&num=%2B18005551212 HTTP/1.1″, upstream: “fastcgi://127.0.0.1:9000″, host: “xx.xx.xx.xx”, referrer: “https://xx.xx.xx.xx/cidsvc/index.html”

    curl (/usr/bin/curl) is installed on the system, so that is not the issue. In searching for this error on the web, I found the suggestion that you need to check that a particular line is uncommented in php.ini (“extension=php_curl.dll”), but I find two instances of that file (in /etc/php5/fpm and /etc/php5/cli), and that line isn’t in either of those files (nor is anything with the word “curl”), and besides, isn’t a .dll file a Windows thing?

    Using the phpinfo function (as suggested here) the string “curl” does not appear anywhere on the resultant page. So although curl is installed. it seems php doesn’t know about it, and I have no idea how you’d fix that.

  28. This is a php install issue, not a web server one.
    In php.ini (phpinfo should tell you where it is), go to the directory shown in ‘extension_dir’. Is there a file there with curl in its name? If not, then you don’t have the extension. If so, then add a line ‘extension=’ (without the single quotes of course). If not, then you do’t have all the bits needed. A search on php.net might help with that, search for ‘curl extension’ .
    To run phpinfo, create a file in the fusionpbx directory called phpinfo.php. Fill it with content of example #1 on this page: http://ca2.php.net/manual/en/function.phpinfo.php. then go to http://fusionpbxdir/phpinfo.php to get the details of what your php install inclueds and where its extension files are located.

  29. Gerrit, that was the key. Here is what I wound up doing, though not quite in this order, but this is probably how I should have done it:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

    (The above line I found at http://php.net/manual/en/curl.installation.php in one of the more recent comments. If any of the above fail to install, as php5-curl did for me on the first attempt, repeat the update/upgrade).

    After that I rebooted the system – I probably could have just restarted something but since I wasn’t sure offhand what “something” was, I just took the safe approach and rebooted. Now I am getting valid data from the web page at https://fusionpbxserveraddress/cidsvc/index.html (there is one thing that worries me about that, though – it appears that anyone that stumbles across the correct IP address could potentially get into that page and do lookups, without first logging in. While that’s not in and of itself a huge security risk, I’d rather not be providing Caller ID Lookup service to the world. There’s probably a way to limit access using a .htaccess file, but it’s been so long since I’ve done anything with one of those that I’ve completely forgotten anything I might have known about them (EDIT: Or not – apparently nginx doesn’t use .htaccess files, which is a REAL issue). I would have thought that since it’s in a subdirectory off of the fusionpbx directory you’d need to first log in to FusionPBX to use that page, but apparently I’d be wrong in thinking that).

    I did NOT need to change php.ini or any other .ini file. I think that is because one of the things I installed put a curl.ini file into the /etc/php5/conf.d directory, and symlinked to it from the /etc/php5/cli and /etc/php5/fpm directories (/etc/php5/fpm is the Configuration File (php.ini) Path according to phpinfo).

    EDIT: So after a few false starts, I got it to sort of work in FusionPBX, by using this line in cidlookup.conf.xml (in place of the one I used for OpenCNAM):

    <param name=”url” value=”https://localhost/cidsvc/callerid.php?num=${caller_id_number}&format=basic”/>

    BUT I can’t say I am thrilled with the results so far – on calls from two numbers it returned “UNKNOWN” and on a third it just returned “MICHIGAN” – OpenCNAM was giving better information than that! You’d think it would have at least pulled city and state from TelcoData.us or something. Maybe it’s one of their sources that’s returning such useless information, but as far as I know they don’t have any debug option that shows what each source is returning.

    EDIT 2: If I go into /var/www/fusionpbx/cidsvc/config.php and comment out all the sources lines except $config['sources'][]=’TelcoData’; then incoming calls do show valid city/state. So that means it is working, but apparently doesn’t have the logic to skip over a useless result from a source. I then tried uncommenting the line $config['sources'][]=’WhitePages’; (while still leaving TelcoData uncomnmented) and it still seemed to return city and state, so it’s got to be one of the other sources (which, strangely, do NOT include OpenCNAM). Thank you Gerrit and Lorne for all your helpful comments on this.

  30. I just want to make a general statement. Although I am somewhat gratified to have got this to work to this point, I hadn’t realized that Nginx uses a different security model that doesn’t even work the way they say it does in their Wiki, unless I am somehow totally misunderstanding how one is supposed to create an access.conf file. The .htaccess files that everyone uses with Apache are ignored by Nginx. This has security implications and it worries me enough that I shut down the server tonight.

    I need to step back from this and consider whether I want to continue to work this hard to get this operating the way I want it to. If I continue to pursue this route for Caller ID lookups, I will need to investigate whether there is some way to see what each source is returning, and whether there is a way to have low quality responses (such as “UNKNOWN”) ignored, so that another source can possibly provide better results. I have to admit there’s a part of me that’s become burned out on this project, especially after seeing how poorly FreeSWITCH handles outgoing Google Voice calls. And I now wish I had chosen Apache instead on Nginx as the web server. The only way I can do that now is to wipe the virtual machine and start over (okay, it may not be the only way, but any other way would probably take me ten times as long and would leave a lot of unnecessary junk in the filesystem).

    I realized when I started this that FusionPBX is not as mature a product as what I’m used to (and that was part of my motivation for documenting some basic things as clearly as I could) but I didn’t anticipate that taking a default choice during installation would come back and bite me with a potential security issue. Before I do anything else I may want to do a full reinstall, but if I do that I’d sort of like to wait until another release version of FreeSWITCH appears (that would HOPEFULLY have the Google Voice fix included). Anyway, I don’t have to make a decision on this tonight, but it is something I want to think about before proceeding.

  31. I didn’t go back to the beginning of your posts but why are you working so hard to get CID? I have 2 did from les.net and voicenetwork.ca. I get CID on all my calls. I’m as frugal as anyone but the effort to take advantage of GoogleVoice is trumped by the $5/month that I pay for an incoming line. Outgoing calls are dirt cheap from voicenetwork.ca. It all just works and I spend my time on real hobbies :-)
    Just wondering…..

  32. I’ve learned that when people don’t want to tell you their real reason for doing something, they will usually make up an answer that sounds good, but is also total bullshit. I don’t want to answer your question, but I will give you a reason that’s not entirely bullshit: I want to do it because that other software is capable of doing it with a simple add-on module, and I want people to consider FusionPBX as a viable alternative. The trouble is that when I run into issues like this, I have a harder time staying convinced that it’s a viable alternative, at least for someone like myself that’s not an uber geek and who doesn’t really enjoy trying to figure out why something won’t work (mostly because it can literally take me hours to figure something out that someone else could probably figure out in about two minutes).

    The fact is that Google Voice support is very important to a certain percentage of users of that other software. If it won’t work in FusionPBX or FreeSWITCH, that means fewer users will consider that software as an alternative to “The Software I Have Come To Hate.”

  33. why are you working so hard to get CID?

    Notwithstanding the fact that some providers will supply CNAM (often for a fee), all of the above is still a worthwhile exercise. The provider’s CNAM is only the beginning, I also want to pull names from local databases, contact lists and/or CRM systems. I want to be able to rate and sort CNAM resources so that I am getting the most useful data and getting it quickly. I want to know before I pick up the phone if there is a liklihood of it being a spammer. If I am paying for CNAM, I might be in a market where CNAM lookup costs are non-trivial, so I want to cache that data for reuse on subsequent calls.

    And all of the above is just for inbound calls, I also use CNAM lookups to log the callee in the CDR for outbound calls. Now that I have some level of comfort with Remote Party ID (rpid), I suspect I can use outbound lookups to actually display the name of the called party on my phone before they even pick up.

    Caller ID Superfecta users are completely spoiled, I doubt there is a service anywhere that comes close to the usability we get for free.

  34. Ok, I understand that. When I was eager to dump *, the only feature I used that was missing from FreeSwitch was Callblock. At the time we had no DoNotCall list in Canada and were recieving a lot of nonsense calls. After getting the basics of my phone system working (I increased the challenge by using OpenWRT on a Seagate Dockstar), I decided to create a module for FusionPBX that performs that function. It is about to be checked in as an addon there.
    Perhaps the best thing to work towards is a version of Superfecta for FreeSwitch/FusionPBX. I might get myself motivated to take a look in a few weeks time.

  35. Can you email me what Superfecta installs into the *.conf files for inbound and outbound callerid lookups? And maybe a few screen shots of the config UI?

RSS feed for comments on this post

Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 136 other followers

%d bloggers like this: