Author: Brian Yule (byule at PembrokeTechnology.com)
Download... the project. (72 kb)
Scroll to the bottom of the document for the details of running this piece of code.
If you ever wanted to use your PC as an enhanced phone, you've definetely
run into TAPI: Telephony Application Programming Interface. Normally, the domain of
C/C++ programmers, this wrapper code will allow you to skip all the complexity and
get to work straight away.
This wrapper was necessary to group and process calls to the telephone application-programming interface (TAPI). TAPI is a Windows standard for accessing a TAPI compliant device on your computer for setting up, managing and clearing down of calls to other people or other systems.
It can be used to set up a call between two computers and once the transmission link is established then it is possible to send and receive data between the two computers. Other applications include caller identification, Call logging, Telephone dialer, fax application, etc.
Object Class View
This application is to allow the applications programmer an easy way to access the functions of TAPI. It handles all the low level processing of API calls and call back events.
Most of the events are transitions of call state. Others include requests and call information messages.
The selected country code in windows
The selected city code in windows
This can be set to true to create debug logs for the application
This gives access to a collection of device objects.
This gives access to the request object
This gives access to the priority object
This un-registers your application for receiving requests
This registers your application for receiving requests
Each TAPI application can have a different priority. For example one application may only want to use data. Then that application would set its priority so that it handles all data calls. There are only two levels of priority, on or off.
Priority can be set for these items:
- Interactive voice
- Automated voice
- Data modem
- Digital data
Application Priority Object
This object allows you to set the priority you wish to have for the different call types. Because there are only two levels of priority I use a Boolean variable to hold the priority state.
If your application has priority then you will be expected to handle the calls for which you have priority.
The calls come into your application as requests. There are three types of request.
Depending on your application you can choose to either handle or not handle these requests.
- Make call
- Media call
When the request comes in from another application we receive a call back
from TAPI telling us that there is a request. Upon receiving the request I fill
this object with the information available on the request. The information is as
The application programmer we must notify the parent application that the
request has been made fills once the data into the object for access.
- Application Name
- Called Party
- Destination Address
- Device Class
- Device Id
- Request Id
- Request Type
Depending on the request type one of the following events are fired.
- Request Drop
- Request Make Call
- Request Media Call
Because there can be many TAPI compliant devices on a given machine we need
to be able to hold information and interact with each one.
Visual Basic allows us to create collections. Collections not only hold
variables of predefined data types but can also hold object classes. Therefore I
have created a collection of devices. The amount of items in my collection will
be the amount of TAPI devices on the machine.
This is a single TAPI compliant hardware device for dealing with Telephone
calls. For example a 56Kb Modem, ISDN Modem, etc.
The following are the call states that TAPI uses. Depending on what type of
TAPI compliant device a subset of these call states are used.
- Dial tone
- Ring back
- Special info
- On hold
- In Conference
- On hold pending conf
- On hold pending transfer
- Download... the project. (72 kb)
- Unzip and run g.vbg
- g.vbg contains 2 projects: the wrapper DLL and the project that test the functionality
- The test project is in the Debug Prog folder
- The documentation is in the Docs folder
To get in touch with the author of this example, email Brian Yule at byule at PembrokeTechnology.com