sipXcallLib home page


Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
PtTerminal Class Reference

#include <PtTerminal.h>

Inheritance diagram for PtTerminal:
Inheritance graph
[legend]
Collaboration diagram for PtTerminal:
Collaboration graph
[legend]

Public Member Functions

 PtTerminal ()
 
 PtTerminal (const char *terminalName, TaoClientTask *pClient=NULL)
 
virtual ~PtTerminal ()
 
 PtTerminal (const PtTerminal &rPtTerminal)
 
PtTerminaloperator= (const PtTerminal &rhs)
 
virtual PtStatus addCallListener (PtCallListener &rCallListener)
 
virtual PtStatus addTerminalListener (PtTerminalListener &rTerminalListener)
 param: (in) rCallListener - the listener to add to calls associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_EXISTS - rCallListener is already registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
PtStatus setGatewayInterface (PtGatewayInterface &rGatewayInterface)
 param: (in) rTerminalListener - The listener to add to this terminal retcode: PT_SUCCESS - Success retcode: PT_EXISTS - rTerminalListener is already registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus pickup (PtAddress &rPickupAddress, PtAddress &rTerminalAddress, PtTerminalConnection *&rpNewTermConnection)
 param: (in) rGatewayInterface - reference to the gateway interface on which media setup methods are invoked during in/out going call setup for this terminal. retcode: PT_SUCCESS - Success retcode: PT_EXISTS - rGatewayInterface is already registered on this terminal. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus removeCallListener (PtCallListener &rCallListener)
 param: rPickupAddress - The PtAddress that is to be picked up param: rTerminalAddress - The PtAddress associated with this terminal on which to pick up the call param: rpNewTermConnection - Set to point to the PtTerminalConnection corresponding to the picked up PtConnection. retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - There is no connection for rTerminalAddress in either the QUEUED or ALERTING state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus removeTerminalListener (PtTerminalListener &rTerminalListener)
 param: (in) rCallListener - The listener to remove retcode: PT_SUCCESS - Success retcode: PT_NOT_FOUND - rCallListener not registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus setDoNotDisturb (PtBoolean flag)
 param: (in) rTerminalListener - The listener to remove from this terminal retcode: PT_SUCCESS - Success retcode: PT_NOT_FOUND - rTerminalListener not registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus setCodecCPULimit (int limit)
 param: (in) flag - TRUE ==> enable, FALSE ==> disable retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getAddresses (PtAddress addresses[], int size, int &nItems)
 param (in) limit - The codec/CPU limit for this call. The value can More...
 
virtual PtStatus getCallListeners (PtCallListener aCallListeners[], int size, int &nItems)
 param: (out) aAddresses - The array of PtAddress's param: (in) size - The number of elements in the addresses array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size addresses retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getComponent (const char *componentName, PtComponent &rComponent)
 param: (out) aCallListeners - The array of known call listeners param: (in) size - The number of elements in the callListeners array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size listeners retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getComponents (PtComponent *components[], int size, int &nItems)
 param: (in) componentName - The name of the desired component param: (out) rpComponent - Set to point to the component that corresponds to componentName retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getComponentGroups (PtComponentGroup componentGroup[], int size, int &nItems)
 param: (out) components - The array of PtComponent's param: (in) size - The number of elements in the components array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size components retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getConfiguration (PtConfigDb &rpConfigDb)
 param: (out) pComponentGroup - The array of PtComponetGroups param: (in) size - The number of elements in the components array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size components retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getDoNotDisturb (PtBoolean &rFlag)
 retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
PtStatus getName (char *rpName, int maxLen)
 param: (out) rFlag - TRUE ==> enabled, FALSE ==> disabled retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getTerminalListeners (PtTerminalListener aTermListeners[], int size, int &nItems)
 param: (out) rpName - The reference used to return the name retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getProvider (PtProvider &rpProvider)
 param: (out) aTermListeners - The array of known terminal listeners param: (in) size - The number of elements in the termListeners array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size listeners retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getTerminalConnections (PtTerminalConnection termConnections[], int size, int &nItems)
 param: (out) rpProvider - a reference to the PtProvider object associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus numAddresses (int &count)
 param: (out) aTermConnections - The array of PtTerminalConnection objects param: (in) size - The number of elements in the termConnections array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size terminal connections retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus numCallListeners (int &count)
 param: (out) count - The number of addresses associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus numComponents (int &count)
 param: (out) count - The number of call listeners associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus numTerminalConnections (int &count)
 param: (out) count - The number of components associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus numTerminalListeners (int &count)
 param: (out) count - The number of terminal connections associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 

Protected Types

enum  PtComponentId {
  HEAD_SET = 1, HAND_SET, PHONE_SET, SPEAKER_PHONE,
  OTHER, BUTTON, DISPLAY, GRAPHIC_DISPLAY,
  HOOKSWITCH, LAMP, MICROPHONE, RINGER,
  SPEAKER, EXTERNAL_SPEAKER
}
 

Protected Member Functions

void initialize (const char *name)
 

Protected Attributes

OsTime mTimeOut
 
char mTerminalName [PTTERMINAL_MAX_NAME_LENGTH+1]
 
TaoClientTaskmpClient
 

Static Protected Attributes

static OsBSem semInit
 
static TaoReferencempTransactionCnt = 0
 
static TaoObjectMapmpComponents = 0
 
static TaoObjectMapmpComponentGroups = 0
 
static int mRef = 0
 

Private Member Functions

void setName (const char *name)
 

Private Attributes

OsProtectEventMgr * mpEventMgr
 

Friends

class PtProvider
 param: (out) count - The number of terminal listeners associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
class PtTerminalConnection
 
class PtTerminalEvent
 

Member Enumeration Documentation

enum PtComponentId
protected
Enumerator
HEAD_SET 
HAND_SET 
PHONE_SET 
SPEAKER_PHONE 
OTHER 
BUTTON 
DISPLAY 
GRAPHIC_DISPLAY 
HOOKSWITCH 
LAMP 
MICROPHONE 
RINGER 
SPEAKER 
EXTERNAL_SPEAKER 

Constructor & Destructor Documentation

PtTerminal ( const char *  terminalName,
TaoClientTask pClient = NULL 
)
~PtTerminal ( )
virtual
PtTerminal ( const PtTerminal rPtTerminal)

Member Function Documentation

PtStatus addCallListener ( PtCallListener rCallListener)
virtual
PtStatus addTerminalListener ( PtTerminalListener rTerminalListener)
virtual

param: (in) rCallListener - the listener to add to calls associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_EXISTS - rCallListener is already registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getAddresses ( PtAddress  arAddresses[],
int  size,
int &  nItems 
)
virtual

param (in) limit - The codec/CPU limit for this call. The value can

getAddresses() basically does the same thing as PtProvider:getAddresses() in this implementation.

retcode: PT_SUCCESS - Success retcode: PT_BUSY - Unable to communicate with call processing

It returns the user lines as addresses.

PtStatus getCallListeners ( PtCallListener  aCallListeners[],
int  size,
int &  nItems 
)
virtual

param: (out) aAddresses - The array of PtAddress's param: (in) size - The number of elements in the addresses array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size addresses retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getComponent ( const char *  componentName,
PtComponent rComponent 
)
virtual

param: (out) aCallListeners - The array of known call listeners param: (in) size - The number of elements in the callListeners array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size listeners retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getComponentGroups ( PtComponentGroup  componentGroup[],
int  size,
int &  nItems 
)
virtual

param: (out) components - The array of PtComponent's param: (in) size - The number of elements in the components array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size components retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getComponents ( PtComponent components[],
int  size,
int &  nItems 
)
virtual

param: (in) componentName - The name of the desired component param: (out) rpComponent - Set to point to the component that corresponds to componentName retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getConfiguration ( PtConfigDb rpConfigDb)
virtual

param: (out) pComponentGroup - The array of PtComponetGroups param: (in) size - The number of elements in the components array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size components retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getDoNotDisturb ( PtBoolean rFlag)
virtual

retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getName ( char *  rpName,
int  maxLen 
)

param: (out) rFlag - TRUE ==> enabled, FALSE ==> disabled retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getProvider ( PtProvider rpProvider)
virtual

param: (out) aTermListeners - The array of known terminal listeners param: (in) size - The number of elements in the termListeners array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size listeners retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getTerminalConnections ( PtTerminalConnection  termConnections[],
int  size,
int &  nItems 
)
virtual

param: (out) rpProvider - a reference to the PtProvider object associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getTerminalListeners ( PtTerminalListener  aTermListeners[],
int  size,
int &  nItems 
)
virtual

param: (out) rpName - The reference used to return the name retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

void initialize ( const char *  name)
protected
PtStatus numAddresses ( int &  count)
virtual

param: (out) aTermConnections - The array of PtTerminalConnection objects param: (in) size - The number of elements in the termConnections array param: (out) nItems - The number of items assigned retcode: PT_SUCCESS - Success retcode: PT_MORE_DATA - There are more than size terminal connections retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus numCallListeners ( int &  count)
virtual

param: (out) count - The number of addresses associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus numComponents ( int &  count)
virtual

param: (out) count - The number of call listeners associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus numTerminalConnections ( int &  count)
virtual

param: (out) count - The number of components associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus numTerminalListeners ( int &  count)
virtual

param: (out) count - The number of terminal connections associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtTerminal & operator= ( const PtTerminal rhs)
PtStatus pickup ( PtAddress rPickupAddress,
PtAddress rTerminalAddress,
PtTerminalConnection *&  rpNewTermConnection 
)
virtual

param: (in) rGatewayInterface - reference to the gateway interface on which media setup methods are invoked during in/out going call setup for this terminal. retcode: PT_SUCCESS - Success retcode: PT_EXISTS - rGatewayInterface is already registered on this terminal. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus removeCallListener ( PtCallListener rCallListener)
virtual

param: rPickupAddress - The PtAddress that is to be picked up param: rTerminalAddress - The PtAddress associated with this terminal on which to pick up the call param: rpNewTermConnection - Set to point to the PtTerminalConnection corresponding to the picked up PtConnection. retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - There is no connection for rTerminalAddress in either the QUEUED or ALERTING state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus removeTerminalListener ( PtTerminalListener rTerminalListener)
virtual

param: (in) rCallListener - The listener to remove retcode: PT_SUCCESS - Success retcode: PT_NOT_FOUND - rCallListener not registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus setCodecCPULimit ( int  limit)
virtual

param: (in) flag - TRUE ==> enable, FALSE ==> disable retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus setDoNotDisturb ( PtBoolean  flag)
virtual

param: (in) rTerminalListener - The listener to remove from this terminal retcode: PT_SUCCESS - Success retcode: PT_NOT_FOUND - rTerminalListener not registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus setGatewayInterface ( PtGatewayInterface rGatewayInterface)

param: (in) rTerminalListener - The listener to add to this terminal retcode: PT_SUCCESS - Success retcode: PT_EXISTS - rTerminalListener is already registered retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

void setName ( const char *  name)
private

Friends And Related Function Documentation

friend class PtProvider
friend

param: (out) count - The number of terminal listeners associated with this terminal retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

friend class PtTerminalConnection
friend
friend class PtTerminalEvent
friend

Member Data Documentation

TaoClientTask* mpClient
protected
TaoObjectMap * mpComponentGroups = 0
staticprotected
TaoObjectMap * mpComponents = 0
staticprotected
OsProtectEventMgr* mpEventMgr
private
TaoReference * mpTransactionCnt = 0
staticprotected
int mRef = 0
staticprotected
char mTerminalName[PTTERMINAL_MAX_NAME_LENGTH+1]
protected
OsTime mTimeOut
protected
OsBSem semInit
staticprotected