posted on Saturday, January 29, 2005 7:03 AM
by
suniljagadish
TAPI functionality is not supported in the Managed World!
I had written a Dialer Application based on the Windows Phone Dialer that would pick-up numbers from a database and would dial 'em. From a CRM perspective, I also logged some stats about the telephone session. I did the coding in VB6 in the traditional way, by doing an API call to the tapiRequestMakeCall function of the “TAPI32.DLL”. My application would invoke the Phone Dialer and pass the phone number and callers name as the arguments. It works cool on Windows 98 and Windows 2000. I ran the same stuff on Windows XP. The Phone Dialer in XP is an updated one and supports both a Phone Call as well as an Internet Call. I need to prefix the numbers that I would be dialing by 0 (because I have a PBX). When I supply the parameter as “0, 24565687” as the number to be dialer, the dialer assumes that this is an internet call. I require the comma to introduce a delay before dialing the actual number because the PBX needs a second to switch to cease the PSTN line. This is quite irritating especially after I found out that when I dial the number manually in Phone Dialer (same number), it treats it as a Phone Number and does the job well.
With this problem, I thought that I will port my dialer to .NET. It all came to a halt when I found this KB article, which says that TAPI functionality cannot be implemented in managed code.
The reason:
Because of the complexity of the TAPI 3.x Component Object Model (COM) interface, the managed wrapper that is created by Microsoft Visual Studio .NET does not work. Therefore, you cannot call TAPI functionality from managed code.
The solution:
COM Interop. Hmmm... There is always a solution. :-)
Interesting note:
All the TAPI 2.x data structures are based on the DWORD data type. TAPI 2.x also requires heavy use of pointers. Therefore, TAPI 2.x functionality is difficult to use from any language other than the Managed Extensions for C++. Offlate I have been reading about the Managed Extensions for C++, which is pretty cool.