Aug 21

Asterisk and the Australian grey pages

NOTE: This info is VERY outdated and doesn’t work anymore. You should look at the new script for services provided by Reverse Australia.

So since I found the Australian gray pages on a lovely web site, I wanted to integrate this info into asterisk. 30 minutes of perl hacking later, and it works. enjoy ๐Ÿ™‚

The following script & example will enable a reverse lookup of incoming caller ID and replace the name section with the lookup. It also allows you to maintain a comma separated file in number,name format. If this finds a match, it will add the name in the file to the caller ID string. If nothing is found in the file, it will consult the grey pages.

Updated 24/8/07: changed script URL to reflect new grey pages site.

Download this script and put it into /var/lib/asterisk/agi-bin.

Create a file /var/lib/asterisk/agi-bin/numbers.txt and populate it with numbers that you already know in the format of:
number,name
eg: 0390001234,My Pizza Shop

The script will try to match numbers from this file first. If no match is found, it will consult the Australian grey pages for a match. If nothing is found here, it will not change the caller ID strings.

In your extensions.conf, call cid-lookup like so:


    exten => 100,1,NoOp(Incoming call!)
    exten => 100,n,agi,cid-lookup.agi
    exten => 100,n,NoOp(Caller ID: ${CALLERID(all)})
    exten => 100,n,Dial(SIP/my-sip-phone,30)
    exten => 100,n,HangUp

22 comments

Skip to comment form

  1. Very interesting however the data from the greypages site is a bit out of date.

    A number I gave up about 6 months ago still shows as mine. The current number that I’ve had for a a year is still showing as belonging to someone else. This number came as with Optus cable and then I migrated the number to Telstra when I went back to ADSL. The greypages site shows it as still belonging to Optus.

    Pretty good site though keep up the interesting articles.

  2. Yes, the data on the site in question is quite out of date. Telstra pretty much shut the lid on reverse directories when they claimed the data was copyright. Some updates have been seen here and there, however nothing major has happened since 2005.

    It would be nice if the data was made available again, and apparently the guys that run the site have acquired some newer data, however it still needs converting etc.

    • Ben on November 15, 2007 at 5:32 pm
    • Reply

    Hi all, i just tried the GP website and i couldn’t even find any whois info… have they shut the doors??

  3. Hrrrm. It goes seem to be down… Apparently the server is down… in theory it should be back up in a week or two…

    • Josh on January 14, 2008 at 8:13 am
    • Reply

    Grey pages is closed from the looks of it.

  4. Hrrrm. It still works here… The script I wrote references http://www.greypag.es/

    • marty on January 15, 2008 at 7:02 pm
    • Reply

    mate great work
    i use pbx in a flash
    which in nerd vettis version same a trixbox
    can you post how it calls the script
    having a play but carnt get it to work
    is there a way to delay sending the caller id to after it parses the site
    cheers

  5. Not 100% sure what you mean, but if you want to delay the process, you can either exit the script and put a sleep in there, or use the Wait command in asterisk.

    • marty on January 17, 2008 at 5:39 pm
    • Reply

    thanks
    whats the basic steps for setup
    i have installed as per blog
    but it just doesnt search for the info
    how do i call the data to search
    useing pbx in a flash which is same as trixbox

    cheers

    • sue on March 21, 2008 at 11:54 pm
    • Reply

    I want to know who lives at a certain address (in Australia) Is there anyway of finding this out?

    • Rob on April 14, 2008 at 1:36 pm
    • Reply

    The site mentioned, allows you to type the address, instead of a phone number, and will return the Name etc.

    Rob

  6. Nice.
    Does it work with the 2008 update?

    I am planning on setting up asterix soon and was gonna do this myself… When I get it done, this is a must. Even if the info is old/whatever, still better than seeing Just a number.

  7. Not as yet. I wasn’t aware the site had been updated… I might look at doing this when I have a chance…

  8. thay have moved there site to http://informationisfreeforyouandme.com

    • jez on March 13, 2009 at 1:08 pm
    • Reply

    As of a few days ago, the greypages data is no longer available from their website. They reference another provider that charges 23c per matching record.

  9. Yes this is very disappointing. I really liked Grey Pages.

    I hope they bring it back soon.

    That new site is a waste of space trying to charge 23 cents a search. What a joke!. ๐Ÿ™

    I wonder if they did a deal with GreyPages to shut down so there was no competition? ๐Ÿ™

    .-.-.

    • eleljay on May 27, 2009 at 10:36 pm
    • Reply

    Gotta love the big boys when it comes to information. They shut down greypa.es because they infringe copyright or privacy or some such nonsense. But it’s okay if the information is charged for, evidently it doesn’t infringe copyright or privacy if someone makes money out of it!!!
    Cut the crap and bring it back. Silent numbers were never published, and as for privacy, the numbers were just made easier to find, they are in the normal white pages if you care to take the time to review each and every listing. What a crock!!

    • petr on April 12, 2010 at 6:23 pm
    • Reply

    So can this script still work? Greypages are great for asterisk, would love to make it work! But all the links here are broken ๐Ÿ™

    Ta

    1. The script will work, however the grey pages site is no longer able to be used how the script uses it. It is still online more for a ‘this is how you would do it’ purposes…

  10. Steve, it might interest you or your readers to know we are currently offering a free API for out own reverse lookup service over here http://www.reverseaustralia.com/developer/

    By the way, your link to cid-lookup.agi is currently broken.

    1. Yeah – I’ve done a lot of updates on this script since – I should write another post on it and like to that post instead…

  11. I’m looking forward to seeing it. It’s been a while since any of our devs have done any perl code, so if you can suggest a better format to receive the data from our API we’re all ears. Or if you have any suggestions at all for that matter ๐Ÿ™‚

Leave a Reply

Your email address will not be published.