Logo Search packages:      
Sourcecode: capisuite version File versions  Download package

Capi Class Reference

#include <capi.h>

List of all members.


Detailed Description

Main Class for communication with CAPI.

This class is the main encapsulation to use the CAPI ISDN interface.

There are only a small subset of methods which are of use for the application layer. These are for general purposes like enabling listening to calls and getting some nice formatted info strings.

The biggest amount are shadow methods for nearly all CAPI messages, which do the dumb stuff like increasing message numbers, testing for errors, building message structures and so on. Not each parameter of these is described in every detail here. For more details please have a look in the CAPI 2.0 specification, available from http://www.capi.org

There's also a big message handling routine (readMessage()) which calls special handlers for incoming messages of the CAPI.

A Capi object creates a new thread (with body run()) which waits for incoming messages in an endless loop and hands them to readMessage().

This class only does the general things - for handling single connections see Connection. Connection objects will be automatically created by this class for incoming connections and can be created manually to initiate an outgoing connection.

The application is supposed to create one single object of this class.

To communicate with the application via callback functions, the application must provide an implementation of the ApplicationInterface. The methods of this interface are called when some special events are received.

Author:
Gernot Hillier

Definition at line 60 of file capi.h.


Public Member Functions

 Capi (ostream &debug, unsigned short debug_level, ostream &error, unsigned short DDILength=0, unsigned short DDIBaseLength=0, vector< string > DDIStopNumbers=vector< string >(), unsigned maxLogicalConnection=2, unsigned maxBDataBlocks=7, unsigned maxBDataLen=2048) throw (CapiError, CapiMsgError)
 Constructor. Registers our App at CAPI and start the communication thread.
string getInfo (bool verbose=false)
 Static Returns some info about the installed Controllers.
void registerApplicationInterface (ApplicationInterface *application_in)
 Register the instance implementing the ApplicationInterface.
void setListenFaxG3 (_cdword Controller=0) throw (CapiMsgError,CapiError)
 Tell capi that we want to _additionally_ listen to Fax G3 calls.
void setListenTelephony (_cdword Controller=0) throw (CapiMsgError,CapiError)
 Tell capi that we want to _additionally_ listen to Telephony calls.
 ~Capi ()
 Destructor. Unregister App at CAPI.

Private Member Functions

void alert_req (_cdword plci) throw (CapiMsgError)
 Send ALERT_REQ to CAPI.
void connect_active_resp (_cword messageNumber, _cdword plci) throw (CapiMsgError)
 send CONNECT_ACTIVE_RESP to CAPI
void connect_b3_active_resp (_cword messageNumber, _cdword ncci) throw (CapiMsgError)
 send CONNECT_B3_ACTIVE_RESP to CAPI
void connect_b3_req (_cdword plci) throw (CapiMsgError)
 send CONNECT_B3_REQ to CAPI
void connect_b3_resp (_cword messageNumber, _cdword ncci, _cword reject, _cstruct ncpi) throw (CapiMsgError)
 send CONNECT_B3_RESP to CAPI
void connect_req (Connection *conn, _cdword Controller, _cword CIPvalue, _cstruct calledPartyNumber, _cstruct callingPartyNumber, _cword B1protocol, _cword B2protocol, _cword B3protocol, _cstruct B1configuration, _cstruct B2configuration, _cstruct B3configuration) throw (CapiMsgError)
 Send CONNECT_REQ to CAPI.
void connect_resp (_cword messageNumber, _cdword plci, _cword reject, _cword B1protocol, _cword B2protocol, _cword B3protocol, _cstruct B1configuration, _cstruct B2configuration, _cstruct B3configuration) throw (CapiMsgError)
 send CONNECT_RESP to CAPI
void data_b3_req (_cdword ncci, void *Data, _cword DataLength, _cword DataHandle, _cword Flags) throw (CapiMsgError)
 send DATA_B3_REQ to CAPI
void data_b3_resp (_cword messageNumber, _cdword ncci, _cword dataHandle) throw (CapiMsgError)
 send DATA_B3_RESP to CAPI
void disconnect_b3_req (_cdword ncci, _cstruct ncpi=NULL) throw (CapiMsgError)
 send DISCONNECT_B3_REQ to CAPI
void disconnect_b3_resp (_cword messageNumber, _cdword ncci) throw (CapiMsgError)
 send DISCONNECT_B3_RESP to CAPI
void disconnect_req (_cdword plci, _cstruct Keypadfacility=NULL, _cstruct Useruserdata=NULL, _cstruct Facilitydataarray=NULL) throw (CapiMsgError)
 send DISCONNECT_REQ to CAPI
void disconnect_resp (_cword messageNumber, _cdword plci) throw (CapiMsgError)
 send DISCONNECT_RESP to CAPI
void facility_req (_cdword address, _cword FacilitySelector, _cstruct FacilityRequestParameter) throw (CapiMsgError)
 send FACILITY_REQ to CAPI
void facility_resp (_cword messageNumber, _cdword address, _cword facilitySelector, _cstruct facilityResponseParameter=NULL) throw (CapiMsgError)
 send FACILITY_RESP to CAPI
unsigned short getApplId (void)
 getApplId returns the application id we got from CAPI
void info_resp (_cword messageNumber, _cdword address) throw (CapiMsgError)
 send INFO_RESP to CAPI
void listen_req (_cdword Controller, _cdword InfoMask=0x03FF, _cdword CIPMask=0x1FFF03FF) throw (CapiMsgError)
 Send LISTEN_REQ to CAPI.
string prefix ()
 return a prefix containing this pointer and date for log messages
void readMessage (void) throw (CapiMsgError, CapiError, CapiWrongState, CapiExternalError)
 read Message from CAPI and process it accordingly
void readProfile () throw (CapiMsgError)
 Get informations about CAPI driver and installed controllers.
virtual void run (void)
 Thread body - endless loop, will be blocked until message is received and then call readMessage().
void select_b_protocol_req (_cdword plci, _cword B1protocol, _cword B2protocol, _cword B3protocol, _cstruct B1configuration, _cstruct B2configuration, _cstruct B3configuration) throw (CapiMsgError)
 send SELECT_B_PROTOCOL_REQ to CAPI
void unregisterConnection (_cdword plci)
 erase Connection object in connections map

Static Private Member Functions

static string describeParamInfo (unsigned int info)
 textual description for Parameter Info

Private Attributes

ApplicationInterfaceapplication
 pointer to the application object implementing ApplicationInterface
unsigned applId
 containing the ID we got from CAPI after successful registration
string capiManufacturer
 manufacturer of the general CAPI driver
string capiVersion
 version of the general CAPI driver
map< _cdword, Connection * > connections
 objects, referenced by PLCI (or 0xFACE & messageNum when Connection is in plci_state Connection::P01
unsigned short DDIBaseLength
 base number length for the ISDN interface if PtP mode is used
unsigned short DDILength
 length of extension number (DDI) when ISDN PtP mode is used (0=PtMP)
vector< string > DDIStopNumbers
 list of DDIs shorten than DDILength we'll accept
ostream & debug
 stream to write debug info to
unsigned short debug_level
 debug level
ostream & error
 stream for error messages
_cword messageNumber
 sequencial message number, must be increased for every sent message
short numControllers
 number of installed controllers, set by readProfile() method
vector< CardProfileTprofiles
 while CAPI numbers controllers starting by 1 (sigh)
pthread_t thread_handle
 handle for the created message reading thread
_cdword usedCIPMask
 CIPMask currently used (in last listen_req).
_cdword usedInfoMask
 InfoMask currently used (in last listen_req).

Friends

void * capi_exec_handler (void *)
 Thread exec handler for Capi class.
class Connection

Classes

class  CardProfileT
 type for storing controller profiles More...

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index