Announcement

Collapse
No announcement yet.

Called ID and The Address Book

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Called ID and The Address Book

    I have been playig with this script for weeks and still can not get it to work.

    It is suppose to pull the called id and check the address book the display it.

    For some reason I get this error

    <TABLE cellSpacing=2 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=LOGDateTime0 noWrap align=left>10/15/2006 11:39:34 AM </TD><TD class=LOGType0 align=left colSpan=3>Error </TD><TD class=LOGEntry0 align=left colSpan=8>Running script, script run or compile error in file: BetaBrite Caller ID.txt0: in line 0 More info: Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))</TD></TR></TBODY></TABLE>


    After I get it working I then want to convert it to .net

    Any help would be greatfull.

    Thanks

    Thom

    PHP Code:
    Function CheckAddressBook(callnmbrcallnamecallfrom)
      
    Dim i
      Dim adr_count
      Dim contact
      Dim bFound
      adr_count 
    hsp.ADRCount
      bFound 
    False
      
    For 1 To adr_count
        Set contact 
    hsp.ADRGet(i)
        
    Select Case callnmbr
          
    Case contact.home_phone
            callname 
    contact.first " " contact.last
            callfrom 
    "Home Phone"
            
    bFound True
            
    Exit For
          Case 
    contact.cell_phone
            callname 
    contact.first " " contact.last
            callfrom 
    "Cell Phone"
            
    bFound True
            
    Exit For
          Case 
    contact.business_phone
            callname 
    contact.first " " contact.last
            callfrom 
    "Business Phone"
            
    bFound True
            
    Exit For
        
    End Select
      Next
      CheckAddressBook 
    bFound
    End 
    Function
    Sub SendCID(Line)
      
    Dim objMsg
      Dim strMsg
      Dim callname
      Dim callnmbr
      Dim callfrom
      callnmbr 
    hsp.CIDNumber(Line)
      
    Select Case Len(callnmbr)
        Case 
    10
          callnmbr 
    Left(callnmbr,3) & "-" Mid(callnmbr,4,3) & "-" Right(callnmbr4)
        Case 
    7
          callnmbr 
    Left(callnmbr,3) & "-" Right(callnmbr,4)
      
    End Select
      callname 
    hsp.CIDName(Line)
      
    callfrom ""
      
    If callname "O" Or callnmbr "O" Then
        strMsg 
    "Incoming call from an out of area caller."
      
    ElseIf callname "P" Or callnmbr "P" Then
        strMsg 
    "Incoming call from a private caller. Call is being dumped."
        
    hsp.LINEhangup Line
      
    Else
        If 
    Not CheckAddressBook(callnmbrcallnamecallfromThen
          
    If callname <> "" Then
            strMsg 
    "Incoming call from " callname " at " callnmbr
          
    Else
            
    strMsg "Incoming call from " callnmbr
          End 
    If
        Else
          
    strMsg "You have a call from " callname
        End 
    If
      
    End If
      
    strMsg Replace(strMsg" & "" and ")
      
    hs.plugin("LEDAM").SendMessage "phone""{brown}" strMsg"start"30353
          
    End Sub 

    #2
    I have the same error, but the scripts run okay !!!

    What could be wrong ??
    Regards,

    Rien du Pre
    The Netherlands
    Using:
    Homeseer PRO latest HS4 BETA on a Raspberry
    Plugin's:
    RFXCOM, mcsMQTT, Z-Wave

    Comment

    Working...
    X