Hi!
I want to be able to click an hyperlink in PHPrunner website witch uses an vbs file to call an phone call via TAPI in an windows machine.
I have found an vbScript witch look like this:
Option Explicit
Dim strFilter, strNumber
strFilter = ""
If (Wscript.Arguments.Count < 1) Then
Wscript.Echo "Make a call via TAPI" & vbcrlf & vbcrlf & "dial.vbs Number StringToSearchForInTapi"
Wscript.Quit
Else
' Retrieve the first argument (index 0).
strNumber = Wscript.Arguments(0)
If Wscript.Arguments.Count > 1 Then
' Retrieve the second argument.
strFilter = Wscript.Arguments(1)
End If
End If
If Wscript.Arguments(0) = "-list" Then
Call ListTAPI()
Else
Call MakeCall(strNumber, strFilter)
End If
Sub MakeCall(strNumber, strFilter)
Dim lAddressType, objTapi, objCollAddresses, objCrtAddress, lLoop, NewCall, gobjAddress
Const LINEADDRESSTYPE_PHONENUMBER = 1
Const LINEMEDIAMODE_INTERACTIVEVOICE = 4
lAddressType = LINEADDRESSTYPE_PHONENUMBER
Set objTapi = CreateObject("TAPI.TAPI.1")
objTapi.Initialize
Set objCollAddresses = objTapi.Addresses
For lLoop = 1 To objCollAddresses.Count
Set objCrtAddress = objCollAddresses.Item(lLoop)
If Instr(objCrtAddress.AddressName, "IP Phone:") > 0 Then
If Instr(objCrtAddress.AddressName, strFilter) Then
Set gobjAddress = objCrtAddress
Exit For
End If
End If
If lLoop = objCollAddresses.Count Then
Msgbox "TAPI Provider Not Found"
WScript.quit(-1)
End If
Next
Set NewCall = gobjAddress.CreateCall(strNumber, lAddressType, LINEMEDIAMODE_INTERACTIVEVOICE) ',lMediaTypes)'Set
NewCall.connect(False)
End Sub
Sub ListTAPI()
Dim strAddressList, lAddressType, objTapi, objCollAddresses, objCrtAddress, lLoop
Const LINEADDRESSTYPE_PHONENUMBER = 1
lAddressType = LINEADDRESSTYPE_PHONENUMBER
Set objTapi = CreateObject("TAPI.TAPI.1")
objTapi.Initialize
Set objCollAddresses = objTapi.Addresses
For lLoop = 1 To objCollAddresses.Count
Set objCrtAddress = objCollAddresses.Item(lLoop)
strAddressList = strAddressList & objCrtAddress.AddressName & vbCrLf
Next
Wscript.echo strAddressList
End Sub
How should i use this vbs in phprunner to make it possible to click an phonenumber field in the website and the the local win maschine uses the vbs to call thrue TAPI?