sipXcallLib home page


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

#include <PtTerminalConnection.h>

Collaboration diagram for PtTerminalConnection:
Collaboration graph
[legend]

Public Types

enum  TerminalConnectionState {
  IDLE = 0x60, RINGING = 0x61, TALKING = 0x62, HELD = 0x63,
  BRIDGED = 0x64, IN_USE = 0x65, DROPPED = 0x66, UNKNOWN = 0x67
}
 

Public Member Functions

 PtTerminalConnection ()
 
 PtTerminalConnection (TaoClientTask *pClient, const char *address, const char *termName, const char *callId, int nIsLocal)
 
 PtTerminalConnection (const PtTerminalConnection &rPtTerminalConnection)
 
virtual ~PtTerminalConnection ()
 
PtTerminalConnectionoperator= (const PtTerminalConnection &rhs)
 
virtual PtStatus answer ()
 
virtual PtStatus hold ()
 retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - Connection is in the PtConnection::DISCONNECTED state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus unhold ()
 retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - This terminal connection is not in the PtTerminalConnection::TALKING state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus startTone (int toneId, UtlBoolean local, UtlBoolean remote, const char *locale=NULL)
 retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - This terminal connection is not in the PtTerminalConnection::HELD state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus stopTone (void)
 DTMF_0 = '0' DTMF_1 = '1' DTMF_2 = '2' DTMF_3 = '3' DTMF_4 = '4' DTMF_5 = '5' DTMF_6 = '6' DTMF_7 = '7' DTMF_8 = '8' DTMF_9 = '9' DTMF_* = '*' DTMP_# = '#' DTMF_TONE_DIALTONE = (DTMF_TONES_BASE + 0) DTMF_TONE_BUSY = (DTMF_TONES_BASE + 1) DTMF_TONE_RINGBACK = (DTMF_TONES_BASE + 2) DTMF_TONE_RINGTONE = (DTMF_TONES_BASE + 3) DTMF_TONE_CALLFAILED = (DTMF_TONES_BASE + 4) DTMF_TONE_SILENCE = (DTMF_TONES_BASE + 5) More...
 
virtual PtStatus playFile (const char *audioFileName, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote)
 
virtual PtStatus playFile (FILE *audioFilePtr, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote)
 if "repeat" is TRUE, then play the audio file in a loop if "local" is TRUE, then play the audio for the near end listener if "remote" is TRUE, then play the audio for the far end listener More...
 
virtual PtStatus stopPlay (UtlBoolean closeFile)
 if "repeat" is TRUE, then play the audio file in a loop if "local" is TRUE, then play the audio for the near end listener if "remote" is TRUE, then play the audio for the far end listener More...
 
virtual PtStatus createPlayer (MpStreamPlayer **pPlayer, const char *szStream, int flags)
 if "closeFile is TRUE, then close the audio file. More...
 
virtual PtStatus destroyPlayer (MpStreamPlayer *pPlayer)
 
virtual PtStatus createPlaylistPlayer (MpStreamPlaylistPlayer **pPlayer)
 
virtual PtStatus destroyPlaylistPlayer (MpStreamPlaylistPlayer *pPlayer)
 
virtual PtStatus getConnection (PtConnection &rConnection)
 
virtual PtStatus getState (int &rState)
 param: (out) rpConnection - Reference to the PtConnection object corresponding to this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getTerminal (PtTerminal &rTerminal)
 param: (out) rState - Set to the current state of the terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getTerminalName (UtlString &rTerminalName)
 param: (out) rpTerminal - Reference to the PtTerminal object corresponding to this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getAddressName (UtlString &rAddress)
 param: (out) rTerminalName - Reference to the terminal name of this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus getCallId (UtlString &rCallId)
 param: (out) rAddress - Reference to the adrress name of this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 
virtual PtStatus isLocal (UtlBoolean &local)
 param: (out) rCallId - Reference to the call id of this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available More...
 

Protected Member Functions

 PtTerminalConnection (const char *address, const char *terminalName, const char *callId, int isLocal)
 
void initialize ()
 

Protected Attributes

OsTime mTimeOut
 
UtlString mAddress
 
UtlString mTerminalName
 
UtlString mCallId
 
char mState
 
int mIsLocal
 
TaoClientTaskmpClient
 

Static Protected Attributes

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

Private Attributes

OsProtectEventMgr * mpEventMgr
 

Friends

class PtTerminalConnectionEvent
 

Member Enumeration Documentation

Enumerator
IDLE 
RINGING 
TALKING 
HELD 
BRIDGED 
IN_USE 
DROPPED 
UNKNOWN 

Constructor & Destructor Documentation

PtTerminalConnection ( TaoClientTask pClient,
const char *  address,
const char *  termName,
const char *  callId,
int  nIsLocal 
)
PtTerminalConnection ( const PtTerminalConnection rPtTerminalConnection)
~PtTerminalConnection ( )
virtual
PtTerminalConnection ( const char *  address,
const char *  terminalName,
const char *  callId,
int  isLocal 
)
protected

Member Function Documentation

PtStatus answer ( )
virtual
PtStatus createPlayer ( MpStreamPlayer **  pPlayer,
const char *  szStream,
int  flags 
)
virtual

if "closeFile is TRUE, then close the audio file.

PtStatus createPlaylistPlayer ( MpStreamPlaylistPlayer **  pPlayer)
virtual
PtStatus destroyPlayer ( MpStreamPlayer *  pPlayer)
virtual
PtStatus destroyPlaylistPlayer ( MpStreamPlaylistPlayer *  pPlayer)
virtual
PtStatus getAddressName ( UtlString &  rAddress)
virtual

param: (out) rTerminalName - Reference to the terminal name of this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getCallId ( UtlString &  rCallId)
virtual

param: (out) rAddress - Reference to the adrress name of this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getConnection ( PtConnection rConnection)
virtual
PtStatus getState ( int &  rState)
virtual

param: (out) rpConnection - Reference to the PtConnection object corresponding to this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getTerminal ( PtTerminal rTerminal)
virtual

param: (out) rState - Set to the current state of the terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus getTerminalName ( UtlString &  rTerminalName)
virtual

param: (out) rpTerminal - Reference to the PtTerminal object corresponding to this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus hold ( )
virtual

retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - Connection is in the PtConnection::DISCONNECTED state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

void initialize ( )
protected
PtStatus isLocal ( UtlBoolean &  local)
virtual

param: (out) rCallId - Reference to the call id of this terminal connection retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtTerminalConnection & operator= ( const PtTerminalConnection rhs)
PtStatus playFile ( const char *  audioFileName,
UtlBoolean  repeat,
UtlBoolean  local,
UtlBoolean  remote 
)
virtual
PtStatus playFile ( FILE *  audioFilePtr,
UtlBoolean  repeat,
UtlBoolean  local,
UtlBoolean  remote 
)
virtual

if "repeat" is TRUE, then play the audio file in a loop if "local" is TRUE, then play the audio for the near end listener if "remote" is TRUE, then play the audio for the far end listener

PtStatus startTone ( int  toneId,
UtlBoolean  local,
UtlBoolean  remote,
const char *  locale = NULL 
)
virtual

retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - This terminal connection is not in the PtTerminalConnection::HELD state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

PtStatus stopPlay ( UtlBoolean  closeFile)
virtual

if "repeat" is TRUE, then play the audio file in a loop if "local" is TRUE, then play the audio for the near end listener if "remote" is TRUE, then play the audio for the far end listener

PtStatus stopTone ( void  )
virtual

DTMF_0 = '0' DTMF_1 = '1' DTMF_2 = '2' DTMF_3 = '3' DTMF_4 = '4' DTMF_5 = '5' DTMF_6 = '6' DTMF_7 = '7' DTMF_8 = '8' DTMF_9 = '9' DTMF_* = '*' DTMP_# = '#' DTMF_TONE_DIALTONE = (DTMF_TONES_BASE + 0) DTMF_TONE_BUSY = (DTMF_TONES_BASE + 1) DTMF_TONE_RINGBACK = (DTMF_TONES_BASE + 2) DTMF_TONE_RINGTONE = (DTMF_TONES_BASE + 3) DTMF_TONE_CALLFAILED = (DTMF_TONES_BASE + 4) DTMF_TONE_SILENCE = (DTMF_TONES_BASE + 5)

PtStatus unhold ( )
virtual

retcode: PT_SUCCESS - Success retcode: PT_INVALID_STATE - This terminal connection is not in the PtTerminalConnection::TALKING state. retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available

Friends And Related Function Documentation

friend class PtTerminalConnectionEvent
friend

Member Data Documentation

UtlString mAddress
protected
UtlString mCallId
protected
int mIsLocal
protected
TaoClientTask* mpClient
protected
OsProtectEventMgr* mpEventMgr
private
TaoReference * mpTransactionCnt = 0
staticprotected
int mRef = 0
staticprotected
char mState
protected
UtlString mTerminalName
protected
OsTime mTimeOut
protected
OsBSem semInit
staticprotected