vbawinapihwndtapiwindow-handles

How to get TAPI HCALL handle?


I want to use lineBlindTransfer() to blindly transfer a connected telephony call.

Here is the declaration in the documentation:

LONG WINAPI lineBlindTransfer(
   HCALL  hCall,
   LPCSTR lpszDestAddress,
   DWORD  dwCountryCode
);

I connected the call using tapiRequestMakeCall() function in Excel VBA:

Declare Function tapiRequestMakeCall Lib "tapi32.dll" _
(ByVal stNumber As String, ByVal stDummy1 As String, _
ByVal stDummy2 As String, ByVal stDummy3 As String) As Long

Sub DialNumber(Number As String)
Dim lngStatus As Long

 lngStatus = tapiRequestMakeCall(Number, "", "", "")

 If lngStatus < 0 Then
  MsgBox "Failed to dial number " & Number, vbExclamation
 End If

End Sub

How can I get the HCALL to transfer the connected call to some other number?


Solution

  • lineMakeCall

    Syntax C++

    LONG WINAPI lineMakeCall(
       HLINE                  hLine,
       LPHCALL                lphCall,
       LPCSTR                 lpszDestAddress,
       DWORD                  dwCountryCode,
       LPLINECALLPARAMS const lpCallParams
    );
    

    lphCall

    Pointer to an HCALL handle. The handle is only valid after the LINE_REPLY message is received by the application indicating that the lineMakeCall function successfully completed. Use this handle to identify the call when invoking other telephony operations on the call. The application is initially the sole owner of this call. This handle is void if the function returns an error (synchronously or asynchronously by the reply message).