0

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?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
hmak.soft
  • 59
  • 1
  • 10

1 Answers1

2

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).

user6698332
  • 407
  • 3
  • 14
  • I am using TAPI 2.2 in excel vba, how to use TAPI 3.0 in excel vba ? Is that possible ?? – hmak.soft Mar 23 '18 at 06:24
  • @FahdKhan I want to say only that the call you want to transfer must to have hCall already that was assigned by function that made successfull call. – user6698332 Mar 23 '18 at 06:26
  • @FahdKhan it seems me that TAPI version is not important in this case... – user6698332 Mar 23 '18 at 06:29
  • @FahdKhan I suppose that the serach on the project code template you used will help you to find points where `hCall` assigned. And try do not rename parameters of referenced libs as you made with `tapiRequestMakeCall`. – user6698332 Mar 23 '18 at 06:33
  • Thank for the replies dude. But there's no method to get hCall. Can you help me with this please – hmak.soft Mar 23 '18 at 06:40
  • @FahdKhan if you read the documentation, `lineMakeCall()` is available in TAPI 1.3 and later. – Remy Lebeau Mar 23 '18 at 06:47
  • @FahdKhan Sorry... It was many years ago and almost nothing remained in my memory. There were no projects and code samples left either. I repeat - try to search on renamed variables, that may implicity act as `hCall'... – user6698332 Mar 23 '18 at 06:47
  • @RemyLebeau It does not matter where call handle comes from. It is present everywhere. And it is the main :) – user6698332 Mar 23 '18 at 06:52
  • but for this, i have to use lineInitializeEx() – hmak.soft Mar 23 '18 at 12:20
  • https://msdn.microsoft.com/en-us/library/ms735983%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 – hmak.soft Mar 23 '18 at 12:20
  • what to do with parameters of this lineInitializeEx(), it also had a hInstance Handle instance :) – hmak.soft Mar 23 '18 at 12:22
  • Call GetModuleHandle(NULL) to get the hInstance. VBA isn't a real good programming language to use TAPI... and better check first if your TSP supports lineBlindTransfer... – xMRi Mar 23 '18 at 13:11
  • 1
    It is giving module handle rather than handle to the Call – hmak.soft Mar 23 '18 at 21:55
  • lineInitializeEx -> HLINEAPP + device discovery -> lineOpen(device) -> HLINE -> lineMakeCall (for outbound) OR lineGetNewCalls (for existing) OR lineGetMessage (for inbound LINE_APPNEWCALL message) -> HCALL -> lineBlindTransfer – Kris Vanherck Apr 04 '18 at 09:58