No announcement yet.

hsp address updater discusion

  • Filter
  • Time
  • Show
Clear All
new posts

    hsp address updater discusion

    post comments or questions about the hsp address updater script here.

    HSP address updater performs a reverse number lookup on all incoming calls (based on caller id) and then updates the address book.

    Simple description
    1. The address will not be updated if the script finds information already in the address book.

    2. It only works with people (Verizon white pages) for now. (business reverse lookups are on another website so I am in the process of writing a version to lookup yellow pages if the number is not found in the white pages)

    3. if you like the hs2 popups - it writes to the log/popup what action was performed and why/why not (updated, info not found, etc.)


    1. copy the script into the script folder

    2. create an event that triggers on caller id available and then run the script hsp Address Updater2 and send the parameters ("SendCID", "1") - second parameter is for line number
    Last edited by jdr2bpa; September 15, 2005, 08:31 PM.

    I've installed it and am quite anxiously waiting for my first non-cell phone call! Maybe today will be my lucky day. This is a really cool idea.

    I think I'm going to write a routine that iterates through all my address book entries and populates them in one go.

    Thanks for sharing!




      I installed your script and have an event that fires when CID is avilable.

      The first few call I got have the event firing but I get the following message in the log.

      "No entry was found in your address book to update"

      I believe these names were in my phonebook without any address. Why wouldnt the script work in this case.

      Also I have HSP set up so that any call ( new) is added to my address book. Wouldn't this script work in such a case?



        Some assembly required...

        I found that the script needed mods to the URL for my area, and parsing the return because of the URL change. I have it working pretty well, but I still want to tweak it more for my needs.

        Check your CID string as it is given to HSP and how HSP returns it. That will help in getting it to match the CID.

        The Call Simulator in HSP is a great help. I'm using HS 1.7 last beta........

        It's a great script jdr2bpa...You made a good solution to a tedious task in the hsp address book!!

        That would make a nice first time run function in jdr2bpa's script.
        Last edited by Jebus; September 15, 2005, 07:34 PM.
        HS2PRO - Ocelot, SecuIR, Secu16, Attendence Management Alarm Interface, X-10, LCD Studio VFD Display, 3 Apexis IP Cams, Custom Software Interfaces, GMQ Geiger Graphing
        HS3PRO - Testing


          i wrote the script to intentionally not update the address book with addresses when I recieved a call from a "new" phone number for two reasons.

          The first being that in hs2 the address book interface list's all the info in each entry. I found myself (in hs1) frequently going through the address book and deleting MANY callers/numbers I would not need. The interface to hs2, with it's large display of information, now shows callers I have recieved multiple calls from. This allows me to easily look at my address book and delete the unwanted ones (the ones with small entry's). The second reason to not initially update the address book is that I have homeseer add all new calls to the phonebook. I am unsure how homeseer handles this (if it's done when CID recieved or after the call) which limited me to only updating existing callers. As you can see in the script I included variable names for hsp.CIDName also so that I can eliminate homeseer from adding any information to the phonebook and then just allow my script to handle all of the updating (once it is more refined and handles all numbers (white and yellow pages)).


          this would be simple by just editing the sendcid sub and iterating through the phone book. the other two functions would handle all of the incoming data.


          I mentioned that the script worked in hs2 and forgot to mention that hs2 handles cid data differently (I think). When hs2 sends cid it removes the dashes between the numbers while homeseer1 did not (at least i think that was the case- I am away from my hs pc and script to look and see). Anyways, my script adds the dashes and then removes them (I think) for other functions to work. hs2 address book contains the dashes, so check (if you are using hs1 phone) to see if it contains the dashes. if it does post again and i will update the script to hs1.

          another possibily is that i am using verizon phone book which i found not to be completly up to date. go to verizons website and manually enter the number and see if it finds any information. if it does then there is a problem with the script (see above). Anyways, enough incoherent rambling, just post your setup and i will take a look at the script for problems.


          if you don't have hs1 (call simulator) then you can just replace the variable data (hsp.CIDNumber(line)) with the number of someone in your address book ("1235551234") and make sure it is in quotes.


            I am using HS2, and installed your script .

            I have a lot of names and numbers in the address book , but never got around to input the addresses. I thought with this script if I get a call from someone in my book it would fill in the address, but it seems to give me the message

            "Phone message no entry was found in you address book to update"

            Also I would not mind having the script fill in the address for new callers as well.



              Update all address in addressbook...

              You must of missed some of my post, I am using HS 1.77
              I'm not having any problems with your great script. I just modded it for my use.

              Here is a routine to loop through the address book and update all addresses.
              You may have to change some for your CID string received from HSP.
              I have the country code and hyphens removed to match my CID string.

              '#New sub to Batch update address in address book
              Sub MatchAllCID()
                Dim strMsg
                Dim callname
                Dim callnmbr
                Dim i
                Dim adr_count
                Dim contact
              adr_count = hsp.ADRCount
               For i = 1 To adr_count
                 Set contact = hsp.ADRGet(i) 
              	callname = contact.first & " " & contact.last  
              	callnmbr = contact.home_phone 
              	callnmbr = replace(callnmbr, "-", "")
              	callfrom = ""
              	address = ""
              	city = ""
              	state = ""
              	zip = ""
                If Not CheckAddressBook(callnmbr, callname, callfrom, address, city, state, zip) Then
                 hs.writelog "Phone Message", "No entry was found in your address book to update"
                End If
               hs.writelog "Phone Message", "Finished Batch Address Update."
              End Sub

              Put this at the bottom of the script and call it with:

              Phone Book Address Updater2.txt(MatchAllCID) in an event.

              Change it the way you like.

              HS2PRO - Ocelot, SecuIR, Secu16, Attendence Management Alarm Interface, X-10, LCD Studio VFD Display, 3 Apexis IP Cams, Custom Software Interfaces, GMQ Geiger Graphing
              HS3PRO - Testing


                Hey, Jebus,

                Darn! You beat me to it. Thanks for the routine.

                Is anyone else having problems getting the city filled in? I'm going to have to take a look at how that's parsed out.

                I had to modify jdr2bpa's awesome script to strip out the "1" that is assumed to be present on the incoming number, and the mid functions. Perhaps that was the issue for you, jjsmd?




                  Here's what I did......

                   z = i
                  	   '#Changed here to match actual string
                  	  Area_code2 = Mid(callnmbr, 1, 3)
                  	  City_COde2 = Mid(callnmbr, 4, 3)
                  	  Local_Code2 = Mid(callnmbr, 7, 4)
                  	   '#Changed URL string here
                  	  site = "/utilities/reverselookup/?process=yes&A2="& Area_code2 & "&X3=" & City_Code2 & "&P2=" & Local_Code2 & "&x=6&y=62"
                  	  page = hs.GetURL("", site, TRUE, 80)
                  	  beginning = InStr(page, "Name:")
                  	  the_end= InStr(page, "Phone")
                  	  length_paragraph = the_end - beginning
                    IF beginning = 0 then
                  	  hs.writelog "Reverse Number Info",  "I was unable to find an address match for the phone number"
                  	  text = Mid(page, beginning, length_paragraph)
                  	while (InStr(text, "  ") <> 0)
                  	   '#Changed for page diff.
                  	  text = replace(text, "(Map & More Info)", "")
                  	  text = replace(text, "  ", " ")
                  	  hs.writelog "Phone Debug", Text
                  	  splData = split(Text," ")
                  	for i = Lbound(splData) to Ubound(spldata)
                  	   Select Case spldata(i)
                     Case "Name:"
                  		 '#Changed for page diff.
                  				Case "Address:"	j = i + 1
                  	 while spldata(j) <> "City:"
                  	  address =  address & " " & spldata(j)
                  											j = j + 1
                    '#Changed for page diff.
                  				Case "City:"	 j = i + 1
                  	 while spldata(j) <> "State:"
                  	  city = city & " " & spldata(j)
                  										 j = j +1
                  				Case "State:"  state = spldata(i+1)
                  				Case "ZIP:"	  zip = spldata(i+1)
                    Case else
                     End Select
                  I had to strip the 1's in the script also.
                  HS2PRO - Ocelot, SecuIR, Secu16, Attendence Management Alarm Interface, X-10, LCD Studio VFD Display, 3 Apexis IP Cams, Custom Software Interfaces, GMQ Geiger Graphing
                  HS3PRO - Testing



                    I got the script to run and now my address book has updated addresses.

                    If you dont mind telling me , how do you figure out to use the following:?

                    "site = "/utilities/reverselookup/?process=yes&A2="& Area_code2 & "&X3=" & City_Code2 & "&P2=" & Local_Code2 & "&x=6&y=62"

                    If I would want to write a script to get info from some other website that has a blank to fill in , how would I go about figuring out what the site= should be?



                      Reverse Lookup URL's

                      I just went to verizon's site and saw the difference in the url.
                      If you use another site, then the parsing routine will have to change.
                      The part of the URL that you quote is just the submit part.

                      I have been searching for a more complete reverse lookup page, I havn't found a better one yet. They are all "masking" the return on the submit very well.
                      They don't want you to grab the info by scripts. They want you to look at their ads.
                      Thats how they get money.

                      If anyone finds a good reverse lookup page post here and I will check it out for the script.

                      HS2PRO - Ocelot, SecuIR, Secu16, Attendence Management Alarm Interface, X-10, LCD Studio VFD Display, 3 Apexis IP Cams, Custom Software Interfaces, GMQ Geiger Graphing
                      HS3PRO - Testing



                        Have you ever found a better reverse lookup site?

                        The verizon site is not too good in my area and I was wondering if you ever adapted the script for any other reverse lookup sites.