Announcement

Collapse
No announcement yet.

CID ok, but not logged

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CID ok, but not logged

    When I get an 'Out of Area' call that I have associated with a name in my Netcallerid address book, the pop-up shows the name and number correctly, but the log in HSP or HS does not put the callers name in the log, it just shows 'Out of Area.' Same for any 'Private' calls.

    To clarify - a friend calls and the software shows 'Out of Area' and shows the phone number.
    I go to the newly added entry in the address book and add his name.
    When he calls again, the pop-up window shows his name and number correctly, but the log in HSP or HS still shows 'Out of Area' (same for 'Private'.

    How come the log does not check caller against address book before writing to the logs?

    jbc

    #2
    Hi, JBC,

    Do you have the script's logging capability enabled (i_enable_logging=1)? That should place CID data in the log for you. Otherwise, it is a function of HSP that writes information in the log, and I do not know, offhand, why it wouldn't place that info in there.

    Please let me know about the i_enable_logging setting.

    Best regards,

    --David

    Comment


      #3
      I have that function checked off in the programs UI, but where is the code that I need to see that it is enabled?

      Am i looking for the i_enable_logging in "WAF-NetCallerID-Sample-CID-Processing.vbs" ?
      If do, i could not find it.

      If it's the "waf-netcallerid.vbh" file, I can not open it.

      Where do I look?

      Comment


        #4
        JBC,

        Forgive me for not clarifying that. i_enable_logging setting would be found in the WAF-NetCallerID.INI file in your c:\program files\homeseer\config directory. However, I just looked in the code, and believe I see a bug that would prevent the manual logging even if you do set that flag. I'll make a revision and see if I can get it in the Updater today or tomorrow. At that time, add/modify the value I mentioned in the INI file, and I believe you'll be in business.

        --David

        Comment


          #5
          I looked in the ini file and the "i_enable_logging=1" is in place.

          Still, my log is not reporting callers who are out of area, but are named in my address book.

          Another issue I seem to be having is sometimes the the phone line is not picked up on the fourth ring (I have it set to answer the phone on the 4th ring). I know that's not a question for this thread, but you seem to help everyone so well.

          jbc

          Comment


            #6
            Post the WAF script you are using... I know my script only logs the CID info, nothing is looked up first. I always look up the name/number match later, either in my WAF script or the .asp pages where I display the callers.

            Comment


              #7
              I dont have any other script but those that were installed with the program.

              jbc

              Comment


                #8
                It is specified in the .ini the script name you are using... if I rememeber it was WAF_sample... something... .vbs Mine has long been modifed... If you post it I can take a quick look and see...

                Comment


                  #9
                  I would rather not post David's script as it is his.
                  I appreciate the help, but feel uncomfortable posting his code in the forumn.
                  Thanks tho.

                  jbc

                  Comment


                    #10
                    I can assure you David doesn't mind... his scripts can be freely downloaded from the updater. I just found a couple different versions on my system and they would all require different changes to make work. If you post yours I can fix for you. Otherwise I am unsure what version you are running and thus what changes you would need.

                    Comment


                      #11
                      Here is the original, unchanged script;

                      Sub main

                      'No action

                      End Sub

                      '*********************************************************** *
                      '* Process the Caller ID data passed by the WAF-NetCallerID
                      '* script.
                      '*
                      '* Data is passed in 'what_parameters' in the following Format:
                      '* 5/23/2003 <tab character> David Kindred <tab character> 3015551212
                      '* (Date) (Name) (Number)
                      '*
                      '* This function splits the date, number and name components
                      '* of the CID data stream into their individual components
                      '* and then shows some samples of what can be done with it.
                      '*
                      '* By default, only the example (Exampe 3) performing custom
                      '* announcements from the external file is active. Feel free
                      '* to uncomment other examples to make them functional.
                      '*********************************************************** *
                      Function process_ncid_data(what_parameters)

                      Dim s_paramaters
                      Dim s_ncid_date
                      Dim s_ncid_name
                      Dim s_ncid_number
                      Dim s_phone_list_name
                      Dim s_phone_list_code
                      Dim current_time

                      'On Error Resume Next

                      ' Split incoming data into component parts of
                      ' date, name and number.
                      s_paramaters = split(what_parameters,Chr(9))
                      s_ncid_date = s_paramaters(0)
                      s_ncid_name = s_paramaters(1)
                      s_ncid_number = s_paramaters(2)

                      '--------------------------------------------
                      ' Example 1: Announce name supplied by the
                      ' NetCallerID unit.
                      '--------------------------------------------
                      'hs.Speak "Call from " & s_ncid_name


                      '--------------------------------------------
                      ' Example 2: Conditional processing based on
                      ' phone number
                      '--------------------------------------------
                      'Select Case s_ncid_number
                      '
                      ' Case "3015551111"
                      ' ' Custom household announcement.
                      ' hs.Speak "Mom is calling"
                      '
                      ' Case "3015552222"
                      ' ' Turn on A1
                      ' hs.ExecX10 "A1","on",0,0
                      '
                      ' Case "3015553333"
                      ' ' Change the device string of A1
                      ' hs.SetDeviceString "A1","Call from: " & s_ncid_name
                      '
                      'End Select


                      '--------------------------------------------
                      ' Example 3: Search phone list text file for
                      ' number match. Return associated
                      ' custom name and code. Based upon
                      ' return code, caller is announced
                      ' or not, depending upon time of
                      ' day.
                      '--------------------------------------------
                      ' Attempt to return custom name for caller from phone
                      ' list file
                      i_ret = find_match(s_ncid_number, s_phone_list_name, s_phone_list_code)

                      If i_ret = -1 Then
                      ' No match was found in the phone list text file.
                      ' Assign NCID name to phone list variable and
                      ' assign a code of 2000 (Others) to caller.
                      s_phone_list_name = s_ncid_name
                      s_phone_list_code = 2000

                      ' Add new caller to text file with a default
                      ' code of 2000.
                      i_ret = add_caller_to_file(s_ncid_number, s_ncid_name, 2000)
                      End If

                      ' Create a version of time that does not include seconds.
                      ' Time is expressed in 24 hour format.
                      current_time = datepart("h", time()) & ":" & right("0" & datepart("n", time()), 2)


                      ' Conditionally announce callers.
                      s_phone_list_code = cint(s_phone_list_code)
                      Select Case True

                      Case (s_phone_list_code >= 1 and s_phone_list_code <= 999)
                      ' Family -- announced 24/7
                      hs.Speak "Family call from " & s_phone_list_name

                      Case (s_phone_list_code >= 1000 and s_phone_list_code <= 1999)
                      ' Friends -- announced 8AM - 10PM (note the space in " 8:00")
                      If current_time >= " 8:00" And current_time <="22:00" Then
                      hs.Speak "Friend call from " & s_phone_list_name
                      End If

                      Case (s_phone_list_code >= 2000 and s_phone_list_code <= 2999)
                      ' Others -- announced 10AM - 9PM
                      If current_time >= "10:00" And current_time <="21:00" Then
                      hs.Speak "Other call from " & s_phone_list_name
                      End If

                      Case (s_phone_list_code >= 3000 and s_phone_list_code <= 3999)
                      ' Solicitors -- not announced. Written to log.
                      hs.writelog "Solicitor List", s_ncid_number & " " & s_phone_list_name

                      End Select


                      '--------------------------------------------
                      ' Example 4: E-mail the CID Info. Using custom
                      ' announcement name, if the
                      ' Example 3 code above is active,
                      ' and a match is found, otherwise
                      ' send TelCo provided information.
                      ' Customize To and From E-mail
                      ' addresses below.
                      '--------------------------------------------
                      'Dim s_to_email_address
                      'Dim s_from_email_address
                      'Dim s_email_subject
                      'Dim s_email_body
                      '
                      's_to_email_address = "joe@schmoe.com"
                      's_from_email_address = "joe@schmoe.com"
                      's_email_subject = "Someone just called!"
                      '
                      ' Create the message body
                      'If s_phone_list_name <> "" Then
                      ' s_email_body = "Call from: " & s_phone_list_name
                      'Else
                      ' s_email_body = "Call from: " & s_ncid_name
                      'End If
                      's_email_body = s_email_body & vbcr & "Phone number: " & s_ncid_number & vbcr & "Date: " & s_ncid_date
                      '
                      ' Send the E-mail message
                      'hs.SendEmail s_to_email_address, s_from_email_address, s_email_subject, s_email_body


                      '--------------------------------------------
                      ' Example 5: Custom HS log entries.
                      ' Write the CID data to the log in
                      ' any manner you desire.
                      '--------------------------------------------
                      'hs.WriteLog "WAF-NetCallerID", "Date: " & s_ncid_date & " Name: " & s_ncid_name & " Number: " & s_ncid_number


                      '--------------------------------------------
                      ' Example 6: Sends CID data to Krumpy's Audrey
                      ' Server application. Related topics
                      ' can be found at the following URL's:
                      '
                      ' http://homeseer.infopop.net/6/ubb.x?...376#9962913376
                      ' http://homeseer.infopop.net/6/ubb.x?...376#1822913376
                      '
                      ' Thanks to Phil Clayton and srodgers for
                      ' this information.
                      '--------------------------------------------
                      'hs.Plugin("AudreyServer").SendCID cstr(s_phone_list_name),cstr(s_ncid_number)

                      End Function


                      '*********************************************************** *
                      '* Search the phone list file for a matching number. If found
                      '* return the text to be announced and the code number
                      '* associated with the caller.
                      '*********************************************************** *
                      Function find_match(what_number, what_name, what_phone_code)

                      Dim fso
                      Dim file
                      Dim s_line
                      Dim s_file_name
                      Dim s_file_data

                      find_match = -1

                      ' Retrieve phone list file name from INI
                      s_file_name = hs.GetINISetting ("Settings","s_phone_list_file","","WAF-NetCallerID.ini")

                      Set fso = CreateObject("Scripting.FileSystemObject")
                      Set file = fso.OpenTextFile(hs.GetAppPath & "\DATA\WAF-NetCallerID\" & s_file_name,1,True,0)

                      ' Loop through phone list file
                      Do While Not file.AtEndOfStream

                      s_line = file.ReadLine

                      ' Ignore comment lines starting with ";"
                      If left(s_line,1) <> ";" Then

                      s_file_data = split(s_line,Chr(9))

                      ' Ensure that there are 3 data items
                      If UBound(s_file_data) = 2 Then

                      ' Look for number match
                      If s_file_data(0) = what_number Then
                      ' Match found. Assign custom name and
                      ' code values and exit function.
                      what_phone_code = s_file_data(1)
                      what_name = s_file_data(2)
                      find_match = 0
                      Exit Do
                      End If

                      End If

                      End If

                      Loop

                      ' Clean up
                      file.Close
                      Set file = Nothing
                      Set fso = Nothing

                      End Function


                      '*********************************************************** *
                      '* Add the caller's name and number to the end of the phone
                      '* list file.
                      '*********************************************************** *
                      Function add_caller_to_file(what_number, what_name, what_phone_code)

                      Dim fso
                      Dim file
                      Dim s_line
                      Dim s_file_name
                      Dim s_file_data

                      add_caller_to_file = -1

                      ' Retrieve phone list file name from INI
                      s_file_name = hs.GetINISetting ("Settings","s_phone_list_file","","WAF-NetCallerID.ini")

                      Set fso = CreateObject("Scripting.FileSystemObject")

                      ' Check to see if file exists. If not, create it.
                      If Not fso.FileExists(s_file_name) Then
                      Set file = fso.CreateTextFile(s_file_name)
                      End If

                      ' Open the file for writing.
                      Set file = fso.OpenTextFile(hs.GetAppPath & "\DATA\WAF-NetCallerID\" & s_file_name,8,True)

                      ' Write the CID data to the phone list text
                      ' file in the following format:
                      ' Phone Number <Tab character> Phone Group Code <Tab character> Telco Provided Name
                      file.WriteLine what_number & Chr(9) & what_phone_code & Chr(9) & what_name
                      add_caller_to_file = 0

                      ' Notify user that name has been added to the file.
                      hs.Speak "A new number has been added to the phone list."

                      ' Clean up
                      file.Close
                      Set file = Nothing
                      Set fso = Nothing

                      End Function


                      jbc

                      Comment


                        #12
                        ... I am a bit confused.
                        Which log file are you refering to? (callers.log?)
                        Which address book are you refering to? (WAF-NetCallerID-Phone-List.txt?)

                        Because the WAF script does not look up anything from the HSP address book, nor does it write anything there.
                        It also is not logging anything to any log files, ot least not the version you have posted.

                        Mine has this section of code:
                        <pre class="ip-ubbcode-code-pre">
                        Function Log_caller_to_file(what_number, what_name)

                        Dim fso
                        Dim file
                        Dim s_line
                        Dim s_file_name
                        Dim s_file_data



                        ' Retrieve phone list file name from INI
                        s_file_name = hs.GetINISetting ("Settings","s_phone_log_file","","WAF-NetCallerID2.ini")

                        Set fso = CreateObject("Scripting.FileSystemObject")

                        ' Check to see if file exists. If not, create it.
                        If Not fso.FileExists(s_file_name) Then
                        Set file = fso.CreateTextFile(s_file_name)
                        End If

                        ' Open the file for writing.

                        Set file = fso.OpenTextFile(hs.GetAppPath & "\" & s_file_name,8,True)

                        ' Write the CID data to the phone list text
                        ' file in the following format:
                        ' Phone Number &lt;Tab character&gt; Phone Group Code &lt;Tab character&gt; Telco Provided Name

                        file.WriteLine now & "~!~Caller ID~!~Number: " & what_number & " Name: " & what_name & Chr(9) & ":Business:"



                        ' Clean up
                        file.Close
                        Set file = Nothing
                        Set fso = Nothing

                        End Function

                        </pre>

                        I use the stock callers.log. It is set that way in my .ini file:
                        s_phone_log_file=Callers.log

                        Tell me what you would 'like' it to do and I can fix your script for you...

                        Comment

                        Working...
                        X