Aug 212007

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:
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 Responses to “Asterisk and the Australian grey pages”

  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.

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

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

  5. Grey pages is closed from the looks of it.

  6. Hrrrm. It still works here… The script I wrote references

  7. 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

  8. 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.

  9. 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


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

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


  12. 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.

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

  14. 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.

  15. 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? 🙁


  16. Gotta love the big boys when it comes to information. They shut down 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!!

  17. So can this script still work? Greypages are great for asterisk, would love to make it work! But all the links here are broken 🙁


    • 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…

  18. 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

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

  19. 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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>