Page 1 of 1

TAPI

Posted: Wed Oct 03, 2007 8:21 am
by driessen
Hello,

TAPI is a Windows API. TAPI stands for "Telephony Appliction Programming Interface". This is a API to connect to a telephone system.

Does someone have any experience in TAPI ?

What is needed to use TAPI ? How is it accomplished ?

Thanks a lot in advance.

Posted: Wed Oct 03, 2007 3:45 pm
by James Bott
Michel,

I don't know much about TAPI but I did find this in my notes file from an old posting. I tried it and it does work. It brings up a TAPI dialog in addition to dialing.

I too, would be interested in more information about TAPI.

James

----------------------------
Tip: Get all the TAPI info on Microsoft's website.

http://msdn2.microsoft.com/en-us/library/ms737219.aspx

Here is a working example (tested on XP Pro)

Code: Select all

#include "fivewin.ch"

function main()
   local cPhone:="1-999-999-9999"
   phoneTo(cPhone,"My TAPI","Test TAPI","My comment")
return nil


DLL32 Function PhoneTo(cPhoneNo As LPSTR,cAppName AS LPSTR,;
      cName AS LPSTR, cComment AS LPSTR ) ;
      AS LONG PASCAL FROM "tapiRequestMakeCall" LIB "TAPI32.DLL"

Posted: Wed Oct 03, 2007 9:48 pm
by driessen
James,

Thank you very much of your answer.

It is working. Just what I needed.

Posted: Fri Aug 22, 2008 11:44 am
by driessen
James,

I implemented the TAPI function "PhoneTo" in my application.

It works very well.

It uses the standard Windows phone-function.

But a customer of mine installed a new telephone system on his network which uses its own TAPI system. The telephone system is now implemented in my application, just by using the function you gave me.

But I'd like to know if there is also a similar function to answer a phonecall.

Thanks.

Michel

Posted: Fri Aug 22, 2008 3:11 pm
by James Bott
Michel,

>But I'd like to know if there is also a similar function to answer a phonecall.

According to the help file, this feature is built in.

"To receive calls, you must have Phone Dialer running. When you make or receive a call, a dialog box appears in the upper-left corner of your screen. If the person you are talking to has a video camera installed, the dialog box shows a video image of the person."

I have not tried it. Perhaps you didn't have the Phone dialer running?

Regards,
James

Posted: Fri Aug 22, 2008 3:37 pm
by James Bott

Making a Tapi call: Outlook Vs my program

Posted: Thu Oct 09, 2008 2:00 pm
by MarcoBoschi
James,
I have compiled a program with this function:

DLL32 Function PhoneTo1( cPhoneNo As LPSTR, cAppName AS LPSTR, cName AS LPSTR, cComment AS LPSTR ) ;
AS LONG PASCAL FROM "tapiRequestMakeCall" LIB "TAPI32.DLL"

It's work fine but at least two dialog appears on the screen for each calls.

Instead If I make a call from Outlook and NO dialogs appear on my screen durin the call! Another fine thing is that I can drop the call from Outlook.
Is it possible from a Fivewin application to make and to drop a call without pop-up dialog?

Thanks

Posted: Thu Oct 09, 2008 2:27 pm
by driessen
Marco,

I have implemented this function in my application. It is working fine. The call from my application is perfectly handed over to the telephone nearby.

But, indeed, 2 dialogboxes do appear, and I haven't found a solution to avoid this.

Thanks for your sharing your experiences.

Posted: Thu Oct 09, 2008 4:02 pm
by James Bott
Marco & Michel,

You can try just hiding them by finding the window handle and using showWindow() to hide them. Here is an example. You will need to replace "Window Title" with the actual title of the window you wish to hide.

This is an adaptation of a sample by Enrico.

Regards,
James

Code: Select all

#include "Fivewin.ch" 


#define GW_HWNDFIRST 0 
#define GW_HWNDLAST  1 
#define GW_HWNDNEXT  2 
#define GW_HWNDPREV  3 
#define GW_OWNER     4 
#define GW_CHILD     5 


#define SW_NORMAL 1
#define SW_HIDE         0
 


FUNCTION MAIN() 

    LOCAL hWnd := FINDWND( "Window Title" ) 

    IF !EMPTY( hWnd ) 
        ? GETWINDOWTEXT( hWnd ) 
        SHOWWINDOW( hWnd, SW_HIDE ) 
    ELSE 
        ? "Window not found" 
    ENDIF 

    RETURN NIL 


FUNCTION FINDWND( cTitle ) 

    LOCAL hWnd := GETWINDOW( GETDESKTOPWINDOW(), GW_CHILD ) 

    WHILE hWnd != 0 
        IF UPPER( cTitle ) $ UPPER( GETWINDOWTEXT( hWnd ) ) 
            RETURN hWnd 
        ENDIF 

        hWnd = GETWINDOW( hWnd, GW_HWNDNEXT ) 
    ENDDO

RETURN NIL 

Posted: Thu Oct 09, 2008 4:04 pm
by MarcoBoschi
It would be better if there were not those two windows.
We use an Innovaphone PBX TAPI Service provider
Some demonstration software work fine.
Outlook also works fine.
I wonder which functions they use..
good evening

Posted: Thu Oct 09, 2008 6:32 pm
by driessen
James,

Your suggestion should be useful if .... the concerning windows had a title bar. So we don't know what the window title is.

Any ideas ?

Thanks.

Posted: Thu Oct 09, 2008 7:07 pm
by James Bott
The issue seems to be that the tapiRequestMakeCall api is designed to use the common windows dialer (EXE), so I don't think it can be turned off. The only other idea I have is to bring your app window to the top, thus hiding the other window(s) behind.

You can access the TAPI API directly, but I don't know how since it requires C functions to do so and I am not a C programmer.

Perhaps Antonio or someone else that knows C can help.

Regards,
James

Re: TAPI

Posted: Sat Oct 11, 2008 2:13 pm
by Sheng
driessen wrote:Hello,

TAPI is a Windows API. TAPI stands for "Telephony Appliction Programming Interface". This is a API to connect to a telephone system.

Does someone have any experience in TAPI ?

What is needed to use TAPI ? How is it accomplished ?

Thanks a lot in advance.
You can use 'TurboPower Async Professional' for ActiveX,
It's Opensource.

Posted: Sat Oct 11, 2008 3:54 pm
by James Bott
Here is another TAPI OCX. The developer's license is only US$89. There is a free test version. I have not tried it.

http://www.smart-activex.com/tapi.html

Regards,
James

Re: TAPI

Posted: Wed Sep 30, 2009 10:20 am
by PeterHarmes
Hi,

I've just been asked by a client if it is possible to connect to a TAPI driver, so that when the phone rings, my application will popup a screen depending if the telephone number is recognised or not.

Is this possible? If so, how do you "listen" for the phone? Do you have to poll a port or could you do something similar to:

oDlg:bCommNotify := { | nComm, nStatus | get_card( nComm, nStatus ), EnableCommNotification( nComm, oDlg:hWnd, 1, -1 ) }

Many Thanks

Pete