Carapace

TAPI -- Telephone API

The Tapi module gives you access to a modem attached to your computer. For modem communications, Carapace uses TAPI to provide a uniform interface onto a wide variety of different modem hardware.

The Tapi module sits at the bottom of a communications stack -- other protocol modules may be stacked on top of it.

Tapi Creation

To make TAPI communications available, load the library caratapi.dll as follows:

    (loadLibrary "caratapi")

The create function can be used to create a Tapi module eg.

    (create Tapi)
Once created, this module is tailored using its properties and methods.

Tapi Properties

A Tapi module supports the following properties:

property name property type description
phoneNo String this is the telephone number to dial which will connect you through to the desired service
log Log a log for the communications
connectTimeout Integer time (in milliseconds) to wait for a successful connection - the default is 60000 (ie. a minute)
disconnectTimeout Integer time (in milliseconds) to wait for a successful disconnection - the default is 60000 (ie. a minute)
statusReporter Object this object is required to have a method called status which takes a single string argument -- the Tapi module will then invoke this method whenever the Tapi state changes
device String the name of the device to use for communications -- the default is any which means that any suitable TAPI device should be used.
maxRings Integer the maximum no. of rings to wait before picking up a call -- used by accept

Tapi Methods

The Tapi module supports the following methods:

method name description
dial dial the supplied telephone number
hangup hangup the current call

as well as the standard comms module methods:

method name description
connect connect this module
receive receive data
receiveInto receive data into the supplied buffer
send send data
disconnect disconnect this module
bind bind address information for this module
listen prepare to listen for new connections
accept wait for a new connection to arrive and, if it does, accept it


dial

Dial the supplied telephone number. If no connection is made in time, as determined by the connectTimeout property, an error is raised.

Arguments:

phoneNoString
connectTimeout (optional)Integer

Return type: the empty List ()


hangup

Hangup the current call.

Arguments: none

Return type: the empty List ()


Contents Index Current topic: communications Related topics: communications classes, objects