May 20, 2024, 03:51:50 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


TAPI and Voice Calls

Started by ckoehn, April 03, 2010, 06:58:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ckoehn

I need to be able to enumerate available TAPI Devices, be able to point the Text-to-Speech to that TAPI device, and monitor the digits that someone presses on the phone keypad.  I have done this with ExceleTel Teletools in VB6, but I would like to do this in EBASIC.  I know it must be possible but I haven't been able to do it.  Even the TAPI examples on this forum give me an Access Violation.  Could someone help me get started in accessing the TAPI3.DLL?

Thanks,
Clint

DennisL

Hi Clint,

Sounds very much like you are building yourself an IVR system; I am very interested in how you go, and even more so if you intend to extend functionality to include an answering machine (i.e. recording from the TAPI wave device as well).

I can't give any examples to you, or even help in any major way, but maybe can point something out that should steer you in the right direction.

It is my understanding (could be wrong), that TAPI3 is based on the COM object model which would only work with COM languages like VB6 and the new .NET languages through interop.

EB is not a COM capable language (as far as I'm aware), so you will have to revert back to using the TAPI2 (latest should be v2.2) interfaces that should be compatible with EB and it's external DLL usage.

I haven't done this myself yet as it looked very involved and messy, but if you do manage to get this working, you could create an EB add-on library that I'm sure others would be interested in - I will be anyway.

Good luck, DennisL.

Brian

Hi,

Tony Moran has written a small program to look for voice-enabled telephones

His read-me states he is not bothered about what anyone does with the
code, so he shouldn't mind me posting it here

It might give you a start, or some ideas . . .

Brian

sapero

April 04, 2010, 07:07:57 AM #3 Last Edit: April 05, 2010, 04:07:25 AM by sapero
And thre are examples from PSDK, for tapi3 interfaces:

Initialize TAPI
Select an Address
Register Events
Select a Terminal
Make a Call
Receive a Call
Create a Simple Conference
Transfer a Call

With some bugfixes, and one small modification: the "Select an Address" example (subroutine) dumps basic properties for each address. Compile for console.
http://msdn.microsoft.com/en-us/library/ms734850.aspx

EDIT: included two fixed header files, two different callback interfaces, selected address indicator.

ckoehn

April 04, 2010, 11:38:13 AM #4 Last Edit: April 04, 2010, 08:07:57 PM by ckoehn
DennisL: It is actually for a data acquisition and control program that will alert the operator if there are alarms and allow selections.

Brian:  I tried ebdial and received an Access Violation error.

Sapero: Will check out your code.

Thanks everyone for your response.

Later,
Clint

ckoehn

sapero,

I think when I ran your code the first time it ran OK.  The second time on I received the error below (jpg file).

Thanks,
Clint

sapero

April 05, 2010, 04:03:54 AM #6 Last Edit: April 05, 2010, 04:09:20 AM by sapero
I'm a newbie in TAPI thema, I receive this error too when selecting the first address (calling TapiSelectAnAddress with NULL), or when modem software is not running. Maybe this is not supported in the current address.
MaybepMediaSupport->QueryMediaType(TAPIMEDIATYPE_AUDIO|TAPIMEDIATYPE_VIDEO, &bSupport)

I have noticed a small bug in TapiRegisterEvents:*pTapiEventNotification.Release()Shoul be moved to the end of subroutine: if (pTapiEventNotification) then *pTapiEventNotification.Release()
return hr
endsub

I have added the call to Release later, when editing my post, so when you release TAPI, it will call Release again, automatically deleting the class.

The CTAPIEventNotification class (ITTAPIDispatchEventNotification) inherits from IUnknown and IDispatch. There is also ITTAPIEventNotification callback interface, and I think the second one should be used (both are accepted in Advise).
To switch from ITTAPIDispatchEventNotification to ITTAPIEventNotification, remove GetTypeInfoCount, GetTypeInfo, GetIDsOfNames, Invoke methods, and then replace _DIID_ITTAPIDispatchEventNotification guid with _IID_ITTAPIEventNotification.

I have reuploaded the example. It will show which modem is selected, has a $define for the callback interface type, and the Release fix.

ckoehn

Sapero,

If you're a newbie I don't even want to mention what I am!   ;D

I still am receiving the same error when I run the code that you re-uploaded.

I went and made a change it the media type wanted.  I only want audio so I removed video.  I received the below error.   What does that mean?

Thanks for you help.  I wouldn't even know how to get this far.

Clint

ckoehn

I found the problem.  I have no device on this computer that has audio and video.  That is why removing video stopped that error.  It looks like if you query for a device that is not on the system is why the error occurs.  I also needed to remove the "video" from another place in the program.

Now it works fine.  Is there a way to monitor the digits or is that part of the event routine?  I need to read your code more thoroughly and try to understand it.

Thanks for your help,
Clint

TonyMUK

Quote from: Brian Pugh on April 04, 2010, 06:05:03 AM
Hi,

Tony Moran has written a small program to look for voice-enabled telephones

His read-me states he is not bothered about what anyone does with the
code, so he shouldn't mind me posting it here

It might give you a start, or some ideas . . .

Brian

Don't mind at all. Just glad if it helps someone out.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.