Was anyone ever able to get this script to work in HS2.0
Thanks
Thom
Thanks
Thom
PHP Code:
Function CheckAddressBook(callnmbr, callname, callfrom)
Dim i
Dim adr_count
Dim contact
Dim bFound
adr_count = hsp.ADRCount
bFound = False
For i = 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(callnmbr, 4)
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(callnmbr, callname, callfrom) Then
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", 30, 3, 5, 3
End Sub
Comment