1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.

CID Superfecta + FreePBX 2.9

Discussion in 'Bug Reporting and Fixes' started by bpps, Feb 15, 2011.

  1. lgaetz Pundit

    Interesting. So if I understand you correctly, step 3 works fine for you and there is no <cr> in the browser displayed CNAM. If so that points to a bug in FreePBX CallerID module and not Superfecta. Anyone else have something to add?

    Lorne
  2. tm1000 Guru

    I'm looking into this.
  3. tm1000 Guru

    I haven't tried this yet and it definitely won't break anything.

    But

    Go to /var/www/html/admin/modules/cidlookup

    Open up functions.inc.php.

    Go to the very bottom and remove this "?>". It doesn't need to be there and you can see after it there is a new line.

    When files are included in php they are actually included as straight text unless the <?php or ?> tags are declared. Therefore anything after a closing tag is interpreted as html. EG carriage returns.

    I can't guarantee this will work. But it's a quick two second look.
  4. rcoates New Member

    Correct -- it shows up fine in the Debug mode on the web page. Whether this points to a bug in the FreePBX module or not I cannot say.
  5. rcoates New Member

    correct -- the cnam shows up properly on the web page using the debug option. Whether this points to an error in the FreePBX module or not, I have no idea. Seems to me that the problem would be in Callerid.php.
  6. tm1000 Guru

    If you try the check I just posted and it works then I can have a fix out for this for all 2.9 clients in about 5 hours....
  7. rcoates New Member

    If you're referring to removing the >? at the end of functions.inc.php, I tried that and it didn't make a difference for me. But it was a good idea and worth trying. I did reload the config but I did not s-h-u-t-d-o-w-n and restart asterisk. Did I need to do a restart?
  8. rcoates New Member

    take a look at this routine in callerid.php

    it appears to strip out the control characters.

    specifically, I'm wondering if the parms to preg_replace are specified correctly. (I'm not very knowledgeable about escape sequences.)

    //remove unauthorized character in the caller id
    if ($first_caller_id !='')
    {
    //$first_caller_id = _utf8_decode($first_caller_id);
    $first_caller_id = strip_tags($first_caller_id );
    $first_caller_id = trim ($first_caller_id);
    if ($charsetIA5)
    {
    $first_caller_id = stripAccents($first_caller_id);
    }
    $first_caller_id = preg_replace ( "/[\";']/", "", $first_caller_id);
    //limit caller id to the first 60 char
    $first_caller_id = substr($first_caller_id,0,60);
    }
  9. lgaetz Pundit

    The trim command will strip any leading carriage return from $first_caller_id even if the line you highlighted won't. Also those are the same lines that work fine in versions < FreePBX 2.9

    Lorne
  10. rcoates New Member

    then I have no idea how the cr/lf is getting into the results
  11. tm1000 Guru

    Here's an idea.

    Create a simple html page in the sources folder of superfecta.

    Call it something like: "test.html" and inside it put some random number. Like "5550159" and no cr or lf

    Then go and create a new callerid lookup source inside the caller id lookup and tell it to reference "test.html" and go and change your inbound routes to reference this new "source"

    See what happens with the phones.

    Let us know
  12. rcoates New Member

    could have left out the "localhost" on the host field in the config
  13. rcoates New Member

    I get the "DOCTYPE HTML" error whether I put in the userid/password or not, and whether or not it is a .txt file or .html file.

    But I don't get the CR/LF, so maybe that narrows it down a little?
  14. tm1000 Guru

    Unfortunately I still can't replicate this.

    I even wiped my machine and installed from scratch and it still works just fine for me

    Sorry guys :confused5:
  15. rcoates New Member

    I'm running PBX in a Flash on CentOS. I doubt if either of those make a difference, but that's more info for you.
  16. tm1000 Guru

    I'm running the same.

    Also I only have one source enabled. Just who called. Thats all Im checking it with.

  17. rcoates New Member

    I have several sources enabled, but I don't think that is making a difference. I'm not sure, but the system may have been upgraded directly from FreePBX 2.7.x to 2.9.x, skipping 2.8 entirely. I don't know if that would make a difference.
  18. lgaetz Pundit

    I had the same idea but didn't want to post it until I knew it was going to work. Wasted an hour or so, and I always got the same result as rcoates; "DOCTYPE..." error. Does anyone know of an actual web resource that will return CNAM via http similar to this page but I can't get Metrostat to work. The idea is to do http lookup but bypass superfecta and see what happens.

    Going forward, people posting issues with problem systems probably should post their version of Asterisk.

    Lorne

    *edit* Link above for metrostat has the wrong query format. Actual format is
    Code:
    http://cnam1.edicentral.net/getcnam?dn=[NUMBER]
    which would make the query either "?dn=[NUMBER]" or I believe it should be "dn=[NUMBER]" Every number I tried it returns "401:Unauthorized:" but that should still work for testing.
  19. cmccoy1234 New Member

    I am showing the same problem as rcoates.

    CR in the name result:

    -- Executing [s@macro-user-callerid:26] Set("SIP/xxxxxxxxxx-08d24780", "CALLERID(name)=
    Name") in new stack

    FreePBX 2.9 and Asterisk 1.4
  20. lgaetz Pundit

    Odd combination, old stable Asterisk with RC FreePBX. What version of Asterisk are the other problem systems running?

    Lorne

Share This Page