sipXcallLib home page


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

#include <PtProvider.h>

Collaboration diagram for PtProvider:
Collaboration graph
[legend]

Public Types

enum  ProviderState { IN_SERVICE, OUT_OF_SERVICE, SHUTDOWN }
 

Public Member Functions

virtual PtStatus addProviderListener (PtProviderListener &rListener)
 param: (in) login - user identifier (used for authentication) param: (in) password - password (used for authentication) param: (in) server - Pingtel server expressed as "host:port" param: (in) options - (not presently used) param: (in) pCallManager - Pointer to the call manager param: (out) rProvider - set to refer to a PtProvider object More...
 
virtual PtStatus createCall (PtCall &rCall)
 param: (in) rListener - the listener to add to this provider retcode: PT_SUCCESS - success retcode: PT_EXISTS - rListener is already registered retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus removeProviderListener (PtProviderListener &rListener)
 param: (out) rCall - reference to the newly created call retcode: PT_SUCCESS - success retcode: PT_RESOURCE_UNAVAILABLE - insufficient resources retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus shutdown (void)
 param: (in) rListener - the listener to remove from this provider retcode: PT_SUCCESS - success retcode: PT_NOT_FOUND - rListener not registered retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus getAddress (const char *phoneURL, PtAddress &rAddress)
 retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus getAddresses (PtAddress arAddresses[], int size, int &nItems)
 param: (in) phoneURL - a URL representing the phone number to look up param: (out) rAddress - reference to the address object corresponding to phoneURL retcode: PT_SUCCESS - success retcode: PT_INVALID_ARGUMENT - phoneURL was not recognized retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus getCalls (PtCall arCalls[], int size, int &nItems)
 param: (out) arAddresses - the array of PtAddress references 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 getProviderListeners (PtProviderListener *listeners[], int size, int &nItems)
 param: (out) arCalls - the array of PtCall pointers param: (in) size - the number of elements in the calls array param: (out) nItems - the number of items assigned retcode: PT_SUCCESS - success retcode: PT_MORE_DATA - there are more than size calls retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual int getState (void)
 param: (out) listeners - the array of PtProviderListener pointers param: (in) size - the number of elements in the pListeners 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 getTerminal (const char *name, PtTerminal &rTerminal)
 retcode: IN_SERVICE - the provider is available for use retcode: OUT_OF_SERVICE - the provider is temporarily unavailable retcode: SHUTDOWN - the provider is permanently unavailable More...
 
virtual PtStatus getTerminals (PtTerminal arTerms[], int size, int &nItems)
 param: (in) name - the name to look up (typically the phone extension) param: (out) rpTerminal - the terminal object for name retcode: PT_SUCCESS - success retcode: PT_INVALID_ARGUMENT - name was not recognized retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus numAddresses (int &count)
 param: (out) arTerms - the array of PtTerminal references param: (in) size - the number of elements in the terms array param: (out) nItems - the number of items assigned retcode: PT_SUCCESS - success retcode: PT_MORE_DATA - there are more than size terminals retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus numCalls (int &count)
 param: (out) count - the number of addresses known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus numProviderListeners (int &count)
 param: (out) count - the number of calls known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 
virtual PtStatus numTerminals (int &count)
 param: (out) count - the number of listeners known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 

Static Public Member Functions

static PtStatus getProvider (const char *login, const char *password, const char *server, const char *options, CpCallManager *pCallMgr, PtProvider *&rpProvider)
 enumcode: IN_SERVICE - the provider is currently available for use enumcode: OUT_OF_SERVICE - the provider is currently not available for use enumcode: SHUTDOWN - the provider is permanently no longer available for use More...
 

Protected Member Functions

void initialize ()
 
PtStatus createProvider (const char *login, const char *password, const char *server, const char *options, CpCallManager *pCallMgr=NULL)
 
 PtProvider (const char *login, const char *password, const char *server, const char *options, CpCallManager *pCallMgr=NULL)
 
 PtProvider (const PtProvider &rPtProvider)
 
PtProvideroperator= (const PtProvider &rhs)
 
 PtProvider (UtlString &rLogin, UtlString &rPass)
 
 PtProvider ()
 
virtual ~PtProvider ()
 

Protected Attributes

UtlString mLogin
 
UtlString mPass
 
ProviderState mState
 
OsTime mTimeOut
 

Static Protected Attributes

static OsBSem semInit
 
static PtProviderspInstance = 0L
 
static TaoClientTaskmpClient = 0
 
static TaoReferencempTransactionCnt = 0
 
static TaoObjectMapmpCalls = 0
 
static TaoReferencempCallCnt = 0
 
static TaoObjectMapmpAddresses = 0
 
static TaoReferencempAddressCnt = 0
 
static unsigned int mRef = 0
 

Static Private Member Functions

static UtlBoolean isLocal (const char *host)
 

Private Attributes

OsProtectEventMgr * mpEventMgr
 

Static Private Attributes

static UtlBoolean mbInvalidIP = FALSE
 
static OsBSem sLock
 

Friends

class PtTerminal
 param: (out) count - the number of terminals known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available More...
 

Member Enumeration Documentation

Enumerator
IN_SERVICE 
OUT_OF_SERVICE 
SHUTDOWN 

Constructor & Destructor Documentation

PtProvider ( const char *  login,
const char *  password,
const char *  server,
const char *  options,
CpCallManager pCallMgr = NULL 
)
protected
PtProvider ( const PtProvider rPtProvider)
protected
PtProvider ( UtlString &  rLogin,
UtlString &  rPass 
)
protected
PtProvider ( )
protected
~PtProvider ( )
protectedvirtual

Member Function Documentation

PtStatus addProviderListener ( PtProviderListener rListener)
virtual

param: (in) login - user identifier (used for authentication) param: (in) password - password (used for authentication) param: (in) server - Pingtel server expressed as "host:port" param: (in) options - (not presently used) param: (in) pCallManager - Pointer to the call manager param: (out) rProvider - set to refer to a PtProvider object

retcode: PT_SUCCESS - rProvider reference to a PtProvider object retcode: PT_PROVIDER_UNAVAILABLE - the Pingtel server did not respond retcode: PT_HOST_NOT_FOUND - Invalid host or port for server retcode: PT_AUTH_FAILED - Invalid login name or password

PtStatus createCall ( PtCall rCall)
virtual

param: (in) rListener - the listener to add to this provider retcode: PT_SUCCESS - success retcode: PT_EXISTS - rListener is already registered retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

PtStatus createProvider ( const char *  login,
const char *  password,
const char *  server,
const char *  options,
CpCallManager pCallMgr = NULL 
)
protected
PtStatus getAddress ( const char *  phoneURL,
PtAddress rAddress 
)
virtual

retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

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

param: (in) phoneURL - a URL representing the phone number to look up param: (out) rAddress - reference to the address object corresponding to phoneURL retcode: PT_SUCCESS - success retcode: PT_INVALID_ARGUMENT - phoneURL was not recognized retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

PtStatus getCalls ( PtCall  arCalls[],
int  size,
int &  nItems 
)
virtual

param: (out) arAddresses - the array of PtAddress references 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 getProvider ( const char *  login,
const char *  password,
const char *  server,
const char *  options,
CpCallManager pCallMgr,
PtProvider *&  rpProvider 
)
static

enumcode: IN_SERVICE - the provider is currently available for use enumcode: OUT_OF_SERVICE - the provider is currently not available for use enumcode: SHUTDOWN - the provider is permanently no longer available for use

PtStatus getProviderListeners ( PtProviderListener listeners[],
int  size,
int &  nItems 
)
virtual

param: (out) arCalls - the array of PtCall pointers param: (in) size - the number of elements in the calls array param: (out) nItems - the number of items assigned retcode: PT_SUCCESS - success retcode: PT_MORE_DATA - there are more than size calls retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

int getState ( void  )
virtual

param: (out) listeners - the array of PtProviderListener pointers param: (in) size - the number of elements in the pListeners 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 getTerminal ( const char *  name,
PtTerminal rTerminal 
)
virtual

retcode: IN_SERVICE - the provider is available for use retcode: OUT_OF_SERVICE - the provider is temporarily unavailable retcode: SHUTDOWN - the provider is permanently unavailable

PtStatus getTerminals ( PtTerminal  arTerms[],
int  size,
int &  nItems 
)
virtual

param: (in) name - the name to look up (typically the phone extension) param: (out) rpTerminal - the terminal object for name retcode: PT_SUCCESS - success retcode: PT_INVALID_ARGUMENT - name was not recognized retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

void initialize ( )
protected
UtlBoolean isLocal ( const char *  host)
staticprivate
PtStatus numAddresses ( int &  count)
virtual

param: (out) arTerms - the array of PtTerminal references param: (in) size - the number of elements in the terms array param: (out) nItems - the number of items assigned retcode: PT_SUCCESS - success retcode: PT_MORE_DATA - there are more than size terminals retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

PtStatus numCalls ( int &  count)
virtual

param: (out) count - the number of addresses known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

PtStatus numProviderListeners ( int &  count)
virtual

param: (out) count - the number of calls known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

PtStatus numTerminals ( int &  count)
virtual

param: (out) count - the number of listeners known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

PtProvider & operator= ( const PtProvider rhs)
protected
PtStatus removeProviderListener ( PtProviderListener rListener)
virtual

param: (out) rCall - reference to the newly created call retcode: PT_SUCCESS - success retcode: PT_RESOURCE_UNAVAILABLE - insufficient resources retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

PtStatus shutdown ( void  )
virtual

param: (in) rListener - the listener to remove from this provider retcode: PT_SUCCESS - success retcode: PT_NOT_FOUND - rListener not registered retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

Friends And Related Function Documentation

friend class PtTerminal
friend

param: (out) count - the number of terminals known to this provider retcode: PT_SUCCESS - success retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available

Member Data Documentation

UtlBoolean mbInvalidIP = FALSE
staticprivate
UtlString mLogin
protected
TaoReference * mpAddressCnt = 0
staticprotected
TaoObjectMap * mpAddresses = 0
staticprotected
UtlString mPass
protected
TaoReference * mpCallCnt = 0
staticprotected
TaoObjectMap * mpCalls = 0
staticprotected
TaoClientTask * mpClient = 0
staticprotected
OsProtectEventMgr* mpEventMgr
private
TaoReference * mpTransactionCnt = 0
staticprotected
unsigned int mRef = 0
staticprotected
ProviderState mState
protected
OsTime mTimeOut
protected
OsBSem semInit
staticprotected
OsBSem sLock
staticprivate
PtProvider * spInstance = 0L
staticprotected