OpalManager Class Reference

#include <manager.h>

List of all members.

Public Member Functions

void GarbageCollection ()
virtual void OnNewConnection (OpalConnection &conn)
virtual void SetDefaultSecurityMode (const PString &v)
virtual PString GetDefaultSecurityMode () const
virtual BOOL UseRTPAggregation () const
OpalRecordManagerGetRecordManager ()
virtual BOOL StartRecording (const PString &callToken, const PFilePath &fn)
virtual void StopRecording (const PString &callToken)
virtual BOOL IsRTPNATEnabled (OpalConnection &conn, const PIPSocket::Address &localAddr, const PIPSocket::Address &peerAddr, const PIPSocket::Address &sigAddr, BOOL incoming)
Endpoint management
void AttachEndPoint (OpalEndPoint *endpoint)
void DetachEndPoint (OpalEndPoint *endpoint)
OpalEndPointFindEndPoint (const PString &prefix)
const PList< OpalEndPoint > & GetEndPoints () const
Call management
virtual BOOL SetUpCall (const PString &partyA, const PString &partyB, PString &token, void *userData=NULL, unsigned options=0, OpalConnection::StringOptions *stringOptions=NULL)
virtual void OnEstablishedCall (OpalCall &call)
virtual BOOL HasCall (const PString &token)
virtual BOOL IsCallEstablished (const PString &token)
PSafePtr< OpalCallFindCallWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite)
virtual BOOL ClearCall (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PSyncPoint *sync=NULL)
virtual BOOL ClearCallSynchronous (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser)
virtual void ClearAllCalls (OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, BOOL wait=TRUE)
virtual void OnClearedCall (OpalCall &call)
virtual OpalCallCreateCall ()
virtual OpalCallCreateCall (void *userData)
virtual void DestroyCall (OpalCall *call)
PString GetNextCallToken ()
Connection management
virtual BOOL MakeConnection (OpalCall &call, const PString &party, void *userData=NULL, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL)
virtual BOOL OnIncomingConnection (OpalConnection &connection, unsigned options, OpalConnection::StringOptions *stringOptions)
virtual BOOL OnIncomingConnection (OpalConnection &connection, unsigned options)
virtual BOOL OnIncomingConnection (OpalConnection &connection)
virtual PString OnRouteConnection (OpalConnection &connection)
virtual void OnAlerting (OpalConnection &connection)
virtual OpalConnection::AnswerCallResponse OnAnswerCall (OpalConnection &connection, const PString &caller)
virtual void OnConnected (OpalConnection &connection)
virtual void OnEstablished (OpalConnection &connection)
virtual void OnReleased (OpalConnection &connection)
virtual void OnHold (OpalConnection &connection)
virtual BOOL OnForwarded (OpalConnection &connection, const PString &remoteParty)
Media Streams management
virtual void AdjustMediaFormats (const OpalConnection &connection, OpalMediaFormatList &mediaFormats) const
virtual BOOL IsMediaBypassPossible (const OpalConnection &source, const OpalConnection &destination, unsigned sessionID) const
virtual BOOL OnOpenMediaStream (OpalConnection &connection, OpalMediaStream &stream)
virtual void OnRTPStatistics (const OpalConnection &connection, const RTP_Session &session)
virtual void OnClosedMediaStream (const OpalMediaStream &stream)
virtual OpalMediaPatchCreateMediaPatch (OpalMediaStream &source, BOOL requiresPatchThread=TRUE)
virtual void DestroyMediaPatch (OpalMediaPatch *patch)
virtual BOOL OnStartMediaPatch (const OpalMediaPatch &patch)
User indications
virtual void OnUserInputString (OpalConnection &connection, const PString &value)
virtual void OnUserInputTone (OpalConnection &connection, char tone, int duration)
virtual PString ReadUserInput (OpalConnection &connection, const char *terminators="#\r\n", unsigned lastDigitTimeout=4, unsigned firstDigitTimeout=30)
Other services
 PLIST (RouteTable, RouteEntry)
virtual BOOL AddRouteEntry (const PString &spec)
BOOL SetRouteTable (const PStringArray &specs)
void SetRouteTable (const RouteTable &table)
const RouteTable & GetRouteTable () const
virtual PString ApplyRouteTable (const PString &proto, const PString &addr)
Member variable access
const OpalProductInfoGetProductInfo () const
void SetProductInfo (const OpalProductInfo &info)
const PString & GetDefaultUserName () const
void SetDefaultUserName (const PString &name)
const PString & GetDefaultDisplayName () const
void SetDefaultDisplayName (const PString &name)
virtual BOOL IsLocalAddress (const PIPSocket::Address &remoteAddress) const
virtual BOOL TranslateIPAddress (PIPSocket::Address &localAddress, const PIPSocket::Address &remoteAddress)
const PIPSocket::Address & GetTranslationAddress () const
void SetTranslationAddress (const PIPSocket::Address &address)
PSTUNClient * GetSTUN (const PIPSocket::Address &address=0) const
PSTUNClient::NatTypes SetSTUNServer (const PString &server)
const PString & GetSTUNServer () const
WORD GetTCPPortBase () const
WORD GetTCPPortMax () const
void SetTCPPorts (unsigned tcpBase, unsigned tcpMax)
WORD GetNextTCPPort ()
WORD GetUDPPortBase () const
WORD GetUDPPortMax () const
void SetUDPPorts (unsigned udpBase, unsigned udpMax)
WORD GetNextUDPPort ()
WORD GetRtpIpPortBase () const
WORD GetRtpIpPortMax () const
void SetRtpIpPorts (unsigned udpBase, unsigned udpMax)
WORD GetRtpIpPortPair ()
BYTE GetRtpIpTypeofService () const
void SetRtpIpTypeofService (unsigned tos)
unsigned GetMinAudioJitterDelay () const
unsigned GetMaxAudioJitterDelay () const
void SetAudioJitterDelay (unsigned minDelay, unsigned maxDelay)
const PStringArray & GetMediaFormatOrder () const
void SetMediaFormatOrder (const PStringArray &order)
const PStringArray & GetMediaFormatMask () const
void SetMediaFormatMask (const PStringArray &mask)
virtual void SetSilenceDetectParams (const OpalSilenceDetector::Params &params)
const OpalSilenceDetector::ParamsGetSilenceDetectParams () const
virtual void SetEchoCancelParams (const OpalEchoCanceler::Params &params)
const OpalEchoCanceler::ParamsGetEchoCancelParams () const
BOOL DetectInBandDTMFDisabled () const
void DisableDetectInBandDTMF (BOOL mode)
const PTimeInterval & GetNoMediaTimeout () const
BOOL SetNoMediaTimeout (const PTimeInterval &newInterval)
const PString & GetDefaultILSServer () const
void SetDefaultILSServer (const PString &server)

Protected Member Functions

 PDECLARE_NOTIFIER (PThread, OpalManager, GarbageMain)
friend OpalCall::OpalCall (OpalManager &mgr)

Protected Attributes

OpalProductInfo productInfo
PString defaultUserName
PString defaultDisplayName
BYTE rtpIpTypeofService
unsigned minAudioJitterDelay
unsigned maxAudioJitterDelay
PStringArray mediaFormatOrder
PStringArray mediaFormatMask
BOOL disableDetectInBandDTMF
PTimeInterval noMediaTimeout
PString ilsServer
OpalSilenceDetector::Params silenceDetectParams
OpalEchoCanceler::Params echoCancelParams
OpalManager::PortInfo tcpPorts
OpalManager::PortInfo udpPorts
OpalManager::PortInfo rtpIpPorts
PIPSocket::Address translationAddress
PString stunServer
PSTUNClient * stun
RouteTable routeTable
PMutex routeTableMutex
PList< OpalEndPointendpoints
PReadWriteMutex endpointsMutex
PAtomicInteger lastCallTokenID
OpalManager::CallDict activeCalls
BOOL clearingAllCalls
PSyncPoint allCallsCleared
PThread * garbageCollector
PSyncPoint garbageCollectExit
PString defaultSecurityMode
OpalRecordManager recordManager

Friends

void OpalCall::OnReleased (OpalConnection &connection)

Classes

class  CallDict
struct  PortInfo
class  RouteEntry


Detailed Description

This class is the central manager for OPAL. The OpalManager embodies the root of the tree of objects that constitute an OPAL system. It contains all of the endpoints that make up the system. Other entities such as media streams etc are in turn contained in these objects. It is expected that an application would only ever have one instance of this class, and also descend from it to override call back functions.

The manager is the eventual destination for call back indications from various other objects. It is possible, for instance, to get an indication of a completed call by creating a descendant of the OpalCall and overriding the OnClearedCall() virtual. However, this could quite unwieldy for all of the possible classes, so the default behaviour is to call the equivalent function on the OpalManager. This allows most applications to only have to create a descendant of the OpalManager and override virtual functions there to get all the indications it needs.


Constructor & Destructor Documentation

OpalManager::OpalManager (  ) 

Create a new manager.

OpalManager::~OpalManager (  ) 

Destroy the manager. This will clear all calls, then delete all endpoints still attached to the manager.

OpalManager::OpalManager (  ) 

Create a new manager.

OpalManager::~OpalManager (  ) 

Destroy the manager. This will clear all calls, then delete all endpoints still attached to the manager.


Member Function Documentation

void OpalManager::AttachEndPoint ( OpalEndPoint endpoint  ) 

Attach a new endpoint to the manager. This is an internal function called by the OpalEndPoint constructor.

Note that any endpoint is automatically "owned" by the manager. They should not be deleted directly. The RemoveEndPoint() command should be used to do this.

void OpalManager::DetachEndPoint ( OpalEndPoint endpoint  ) 

Remove an endpoint from the manager. This will delete the endpoint object.

OpalEndPoint* OpalManager::FindEndPoint ( const PString &  prefix  ) 

Find an endpoint instance that is using the specified prefix.

const PList<OpalEndPoint>& OpalManager::GetEndPoints (  )  const [inline]

Get the endpoints attached to this manager.

virtual BOOL OpalManager::SetUpCall ( const PString &  partyA,
const PString &  partyB,
PString &  token,
void *  userData = NULL,
unsigned  options = 0,
OpalConnection::StringOptions stringOptions = NULL 
) [virtual]

Set up a call between two parties. This is used to initiate a call. Incoming calls are "answered" using a different mechanism.

The A party and B party strings indicate the protocol and address of the party to call in the style of a URL. The A party is the initiator of the call and the B party is the remote system being called. See the MakeConnection() function for more details on the format of these strings.

The token returned is a unique identifier for the call that allows an application to gain access to the call at later time. This is necesary as any pointer being returned could become invalid (due to being deleted) at any time due to the multithreaded nature of the OPAL system. While this function does return a pointer it is only safe to use immediately after the function returns. At any other time the FindCallWithLock() function should be used to gain a locked pointer to the call.

Parameters:
partyA  The A party of call
partyB  The B party of call
token  Token for call
userData  user data passed to Call and Connection
options  options passed to connection
stringOptions  complex string options passed to call

virtual void OpalManager::OnEstablishedCall ( OpalCall call  )  [virtual]

A call back function whenever a call is completed. In telephony terminology a completed call is one where there is an established link between two parties.

This called from the OpalCall::OnEstablished() function.

The default behaviour does nothing.

Parameters:
call  Call that was completed

virtual BOOL OpalManager::HasCall ( const PString &  token  )  [inline, virtual]

Determine if a call is active. Return TRUE if there is an active call with the specified token. Note that the call could clear any time (even milliseconds) after this function returns TRUE.

Parameters:
token  Token for identifying call

virtual BOOL OpalManager::IsCallEstablished ( const PString &  token  )  [virtual]

Determine if a call is established. Return TRUE if there is an active call with the specified token and that call has at least two parties with media flowing between them. Note that the call could clear any time (even milliseconds) after this function returns TRUE.

Parameters:
token  Token for identifying call

PSafePtr<OpalCall> OpalManager::FindCallWithLock ( const PString &  token,
PSafetyMode  mode = PSafeReadWrite 
) [inline]

Find a call with the specified token. This searches the manager database for the call that contains the token as provided by functions such as SetUpCall().

Note the caller of this function MUST call the OpalCall::Unlock() function if this function returns a non-NULL pointer. If it does not then a deadlock can occur.

Parameters:
token  Token to identify connection

virtual BOOL OpalManager::ClearCall ( const PString &  token,
OpalConnection::CallEndReason  reason = OpalConnection::EndedByLocalUser,
PSyncPoint *  sync = NULL 
) [virtual]

Clear a call. This finds the call by using the token then calls the OpalCall::Clear() function on it. All connections are released, and the connections and call are disposed of. Note that this function returns quickly and the disposal happens at some later time in a background thread. It is safe to call this function from anywhere.

Parameters:
token  Token for identifying connection
reason  Reason for call clearing
sync  Sync point to wait on.

virtual BOOL OpalManager::ClearCallSynchronous ( const PString &  token,
OpalConnection::CallEndReason  reason = OpalConnection::EndedByLocalUser 
) [virtual]

Clear a call. This finds the call by using the token then calls the OpalCall::Clear() function on it. All connections are released, and the connections and caller disposed of. Note that this function waits until the call has been cleared and all responses timeouts etc completed. Care must be used as to when it is called as deadlocks may result.

Parameters:
token  Token for identifying connection
reason  Reason for call clearing

virtual void OpalManager::ClearAllCalls ( OpalConnection::CallEndReason  reason = OpalConnection::EndedByLocalUser,
BOOL  wait = TRUE 
) [virtual]

Clear all current calls. This effectively executes OpalCall::Clear() on every call that the manager has active. This function can not be called from several threads at the same time.

Parameters:
reason  Reason for call clearing
wait  Flag to wait for calls to e cleared.

virtual void OpalManager::OnClearedCall ( OpalCall call  )  [virtual]

A call back function whenever a call is cleared. A call is cleared whenever there is no longer any connections attached to it. This function is called just before the call is deleted. However, it may be used to display information on the call after completion, eg the call parties and duration.

Note that there is not a one to one relationship with the OnEstablishedCall() function. This function may be called without that function being called. For example if MakeConnection() was used but the call never completed.

The default behaviour removes the call from the activeCalls dictionary.

Parameters:
call  Connection that was established

virtual OpalCall* OpalManager::CreateCall (  )  [virtual]

Create a call object. This function allows an application to have the system create desccendants of the OpalCall class instead of instances of that class directly. The application can thus override call backs or add extra information that it wishes to maintain on a call by call basis.

The default behavious returns an instance of OpalCall.

virtual OpalCall* OpalManager::CreateCall ( void *  userData  )  [virtual]

Parameters:
userData  user data passed to SetUpCall

virtual void OpalManager::DestroyCall ( OpalCall call  )  [virtual]

Destroy a call object. This gets called from background thread that garbage collects all calls and connections. If an application has object lifetime issues with the threading, it can override this function and take responsibility for deleting the object at some later time.

The default behaviour simply calls "delete call".

PString OpalManager::GetNextCallToken (  ) 

Get next unique token ID for calls. This is an internal function called by the OpalCall constructor.

virtual BOOL OpalManager::MakeConnection ( OpalCall call,
const PString &  party,
void *  userData = NULL,
unsigned int  options = 0,
OpalConnection::StringOptions stringOptions = NULL 
) [virtual]

Set up a connection to a remote party. An appropriate protocol (endpoint) is determined from the party parameter. That endpoint is then called to create a connection and that connection is attached to the call provided.

If the endpoint is already occupied in a call then the endpoints list is further searched for additional endpoints that support the protocol. For example multiple pstn endpoints may be present for multiple LID's.

The general form for this party parameter is:

[proto:][alias@][transport$]address[:port]

where the various fields will have meanings specific to the endpoint type. For example, with H.323 it could be "h323:Fred@site.com" which indicates a user Fred at gatekeeper size.com. Whereas for the PSTN endpoint it could be "pstn:5551234" which is to call 5551234 on the first available PSTN line.

The default for the proto is the name of the protocol for the first endpoint attached to the manager. Other fields default to values on an endpoint basis.

This function usually returns almost immediately with the connection continuing to occur in a new background thread.

If FALSE is returned then the connection could not be established. For example if a PSTN endpoint is used and the associated line is engaged then it may return immediately. Returning a non-NULL value does not mean that the connection will succeed, only that an attempt is being made.

The default behaviour is pure.

Parameters:
call  Owner of connection
party  Party to call
userData  user data to pass to connections
options  options to pass to conneciton

virtual BOOL OpalManager::OnIncomingConnection ( OpalConnection connection,
unsigned  options,
OpalConnection::StringOptions stringOptions 
) [virtual]

Call back for answering an incoming call. This function is used for an application to control the answering of incoming calls.

If TRUE is returned then the connection continues. If FALSE then the connection is aborted.

Note this function should not block for any length of time. If the decision to answer the call may take some time eg waiting for a user to pick up the phone, then AnswerCallPending or AnswerCallDeferred should be returned.

If an application overrides this function, it should generally call the ancestor version to complete calls. Unless the application completely takes over that responsibility. Generally, an application would only intercept this function if it wishes to do some form of logging. For this you can obtain the name of the caller by using the function OpalConnection::GetRemotePartyName().

The default behaviour is to call OnRouteConnection to determine a B party for the connection.

If the call associated with the incoming call already had two parties and this connection is a third party for a conference call then AnswerCallNow is returned as a B party is not required.

Parameters:
connection  Connection that is calling
options  options for new connection (can't use default as overrides will fail)

virtual BOOL OpalManager::OnIncomingConnection ( OpalConnection connection,
unsigned  options 
) [virtual]

Parameters:
connection  Connection that is calling
options  options for new connection (can't use default as overrides will fail)

virtual BOOL OpalManager::OnIncomingConnection ( OpalConnection connection  )  [virtual]

Parameters:
connection  Connection that is calling

virtual PString OpalManager::OnRouteConnection ( OpalConnection connection  )  [virtual]

Route a connection to another connection from an endpoint.

The default behaviour gets the destination address from the connection and translates it into an address by using the routeTable member variable.

Parameters:
connection  Connection being routed

virtual void OpalManager::OnAlerting ( OpalConnection connection  )  [virtual]

Call back for remote party being alerted on outgoing call. This function is called after the connection is informed that the remote endpoint is "ringing". This function is generally called some time after the MakeConnection() function was called.

If FALSE is returned the connection is aborted.

If an application overrides this function, it should generally call the ancestor version for correct operation. An application would typically only intercept this function if it wishes to do some form of logging. For this you can obtain the name of the caller by using the function OpalConnection::GetRemotePartyName().

The default behaviour calls the OnAlerting() on the connection's associated OpalCall object.

Parameters:
connection  Connection that was established

virtual OpalConnection::AnswerCallResponse OpalManager::OnAnswerCall ( OpalConnection connection,
const PString &  caller 
) [virtual]

virtual void OpalManager::OnConnected ( OpalConnection connection  )  [virtual]

A call back function whenever a connection is "connected". This indicates that a connection to an endpoint was connected. That is the endpoint received acknowledgement via whatever protocol it uses that the connection may now start media streams.

In the context of H.323 this means that the CONNECT pdu has been received.

The default behaviour calls the OnConnected() on the connections associated OpalCall object.

Parameters:
connection  Connection that was established

virtual void OpalManager::OnEstablished ( OpalConnection connection  )  [virtual]

A call back function whenever a connection is "established". This indicates that a connection to an endpoint was connected and that media streams are opened.

In the context of H.323 this means that the CONNECT pdu has been received and either fast start was in operation or the subsequent Open Logical Channels have occurred. For SIP it indicates the INVITE/OK/ACK sequence is complete.

The default behaviour calls the OnEstablished() on the connection's associated OpalCall object.

Parameters:
connection  Connection that was established

virtual void OpalManager::OnReleased ( OpalConnection connection  )  [virtual]

A call back function whenever a connection is released. This function can do any internal cleaning up and waiting on background threads that may be using the connection object.

Classes that override this function should make sure they call the ancestor version for correct operation.

An application will not typically call this function as it is used by the OpalManager during a release of the connection.

The default behaviour calls OnReleased() on the connection's associated OpalCall object. This indicates to the call that the connection has been released so it can release the last remaining connection and then returns TRUE.

Parameters:
connection  Connection that was established

virtual void OpalManager::OnHold ( OpalConnection connection  )  [virtual]

A call back function whenever a connection is "held" or "retrieved". This indicates that a connection to an endpoint was held, or retrieved, either locally or by the remote endpoint.

The default behaviour does nothing.

Parameters:
connection  Connection that was held

virtual BOOL OpalManager::OnForwarded ( OpalConnection connection,
const PString &  remoteParty 
) [virtual]

A call back function whenever a connection is forwarded.

The default behaviour does nothing.

Parameters:
connection  Connection that was held
remoteParty  The new remote party

virtual void OpalManager::AdjustMediaFormats ( const OpalConnection connection,
OpalMediaFormatList mediaFormats 
) const [virtual]

Adjust media formats available on a connection. This is called by a connection after it has called OpalCall::GetMediaFormats() to get all media formats that it can use so that an application may remove or reorder the media formats before they are used to open media streams.

The default behaviour uses the mediaFormatOrder and mediaFormatMask member variables to adjust the mediaFormats list.

Parameters:
connection  Connection that is about to use formats
mediaFormats  Media formats to use

virtual BOOL OpalManager::IsMediaBypassPossible ( const OpalConnection source,
const OpalConnection destination,
unsigned  sessionID 
) const [virtual]

See if the media can bypass the local host.

Parameters:
source  Source connection
destination  Destination connection
sessionID  Session ID for media channel

virtual BOOL OpalManager::OnOpenMediaStream ( OpalConnection connection,
OpalMediaStream stream 
) [virtual]

Call back when opening a media stream. This function is called when a connection has created a new media stream according to the logic of its underlying protocol.

The usual requirement is that media streams are created on all other connections participating in the call and all of the media streams are attached to an instance of an OpalMediaPatch object that will read from one of the media streams passing data to the other media streams.

The default behaviour achieves the above using the FindMatchingCodecs() to determine what (if any) software codecs are required, the OpalConnection::CreateMediaStream() function to open streams and the CreateMediaPatch() function to create a patch for all of the streams and codecs just produced.

Parameters:
connection  Connection that owns the media stream
stream  New media stream being opened

virtual void OpalManager::OnRTPStatistics ( const OpalConnection connection,
const RTP_Session session 
) [virtual]

Callback from the RTP session for statistics monitoring. This is called every so many packets on the transmitter and receiver threads of the RTP session indicating that the statistics have been updated.

The default behaviour does nothing.

Parameters:
connection  Connection for the channel
session  Session with statistics

virtual void OpalManager::OnClosedMediaStream ( const OpalMediaStream stream  )  [virtual]

Call back for closed a media stream.

The default behaviour does nothing.

Parameters:
stream  Stream being closed

virtual OpalMediaPatch* OpalManager::CreateMediaPatch ( OpalMediaStream source,
BOOL  requiresPatchThread = TRUE 
) [virtual]

Create a OpalMediaPatch instance. This function allows an application to have the system create descendant class versions of the OpalMediPatch class. The application could use this to modify the default behaviour of a patch.

The default behaviour returns an instance of OpalMediaPatch.

Parameters:
source  Source media stream

virtual void OpalManager::DestroyMediaPatch ( OpalMediaPatch patch  )  [virtual]

Destroy a OpalMediaPatch instance.

The default behaviour simply calls delete patch.

virtual BOOL OpalManager::OnStartMediaPatch ( const OpalMediaPatch patch  )  [virtual]

Call back for a media patch thread starting. This function is called within the context of the thread associated with the media patch. It may be used to do any last checks on if the patch should proceed.

The default behaviour simply returns TRUE.

Parameters:
patch  Media patch being started

virtual void OpalManager::OnUserInputString ( OpalConnection connection,
const PString &  value 
) [virtual]

Call back for remote endpoint has sent user input as a string.

The default behaviour call OpalConnection::SetUserInput() which saves the value so the GetUserInput() function can return it.

Parameters:
connection  Connection input has come from
value  String value of indication

virtual void OpalManager::OnUserInputTone ( OpalConnection connection,
char  tone,
int  duration 
) [virtual]

Call back for remote enpoint has sent user input as tones. If duration is zero then this indicates the beginning of the tone. If duration is non-zero then it indicates the end of the tone output.

The default behaviour calls the OpalCall function of the same name.

Parameters:
connection  Connection input has come from
tone  Tone received
duration  Duration of tone

virtual PString OpalManager::ReadUserInput ( OpalConnection connection,
const char *  terminators = "#\r\n",
unsigned  lastDigitTimeout = 4,
unsigned  firstDigitTimeout = 30 
) [virtual]

Read a sequence of user indications from connection with timeouts.

Parameters:
connection  Connection to read input from
terminators  Characters that can terminte input
lastDigitTimeout  Timeout on last digit in string
firstDigitTimeout  Timeout on receiving any digits

OpalManager::PLIST ( RouteTable  ,
RouteEntry   
)

virtual BOOL OpalManager::AddRouteEntry ( const PString &  spec  )  [virtual]

Parse a route table specification list for the manager. Add a route entry to the route table.

The specification string is of the form pattern=destination where pattern is a regular expression matching the incoming calls destination address and will translate it to the outgoing destination address for making an outgoing call. For example, picking up a PhoneJACK handset and dialing 2, 6 would result in an address of "pots:26" which would then be matched against, say, a specification of pots:26=h323:10.0.1.1, resulting in a call from the pots handset to 10.0.1.1 using H.323.

As the pattern field is a regular expression, you could have used in the above .*:26=h323:10.0.1.1 to achieve the same result with the addition that an incoming call from a SIP client would also be routed to the H.323 client.

Note that the pattern has an implicit ^ and $ at the beginning and end of the regular expression. So it must match the entire address.

If the specification is of the form , then the file is read with each line consisting of a pattern=destination route specification. Lines without an equal sign or beginning with '#' are ignored.

Returns TRUE if an entry was added.

Parameters:
spec  Specification string to add

BOOL OpalManager::SetRouteTable ( const PStringArray &  specs  ) 

Parse a route table specification list for the manager. This removes the current routeTable and calls AddRouteEntry for every string in the array.

Returns TRUE if at least one entry was added.

Parameters:
specs  Array of specification strings.

void OpalManager::SetRouteTable ( const RouteTable &  table  ) 

Set a route table for the manager. Note that this will make a copy of the table and not maintain a reference.

Parameters:
table  New table to set for routing

const RouteTable& OpalManager::GetRouteTable (  )  const [inline]

Get the active route table for the manager.

virtual PString OpalManager::ApplyRouteTable ( const PString &  proto,
const PString &  addr 
) [virtual]

Route the source address to a destination using the route table.

const OpalProductInfo& OpalManager::GetProductInfo (  )  const [inline]

Get the product info for all endpoints.

void OpalManager::SetProductInfo ( const OpalProductInfo info  )  [inline]

Set the product info for all endpoints.

const PString& OpalManager::GetDefaultUserName (  )  const [inline]

Get the default username for all endpoints.

void OpalManager::SetDefaultUserName ( const PString &  name  )  [inline]

Set the default username for all endpoints.

const PString& OpalManager::GetDefaultDisplayName (  )  const [inline]

Get the default display name for all endpoints.

void OpalManager::SetDefaultDisplayName ( const PString &  name  )  [inline]

Set the default display name for all endpoints.

virtual BOOL OpalManager::IsLocalAddress ( const PIPSocket::Address &  remoteAddress  )  const [virtual]

Determine if the address is "local", ie does not need any address translation (fixed or via STUN) to access.

The default behaviour checks if remoteAddress is a RFC1918 private IP address: 10.x.x.x, 172.16.x.x or 192.168.x.x.

virtual BOOL OpalManager::TranslateIPAddress ( PIPSocket::Address &  localAddress,
const PIPSocket::Address &  remoteAddress 
) [virtual]

Provide address translation hook. This will check to see that remoteAddress is NOT a local address by using IsLocalAddress() and if not, set localAddress to the translationAddress (if valid) which would normally be the router address of a NAT system.

const PIPSocket::Address& OpalManager::GetTranslationAddress (  )  const [inline]

Get the translation address to use for TranslateIPAddress().

void OpalManager::SetTranslationAddress ( const PIPSocket::Address &  address  )  [inline]

Set the translation address to use for TranslateIPAddress().

PSTUNClient* OpalManager::GetSTUN ( const PIPSocket::Address &  address = 0  )  const

Return the STUN server to use. Returns NULL if address is a local address as per IsLocalAddress(). Always returns the STUN server if address is zero. Note, the pointer is NOT to be deleted by the user.

PSTUNClient::NatTypes OpalManager::SetSTUNServer ( const PString &  server  ) 

Set the STUN server address, is of the form host[:port] Note that if the STUN server is found then the translationAddress is automatically set to the router address as determined by STUN.

const PString& OpalManager::GetSTUNServer (  )  const [inline]

Get the current host name and optional port for the STUN server.

WORD OpalManager::GetTCPPortBase (  )  const [inline]

Get the TCP port number base for H.245 channels

WORD OpalManager::GetTCPPortMax (  )  const [inline]

Get the TCP port number base for H.245 channels.

void OpalManager::SetTCPPorts ( unsigned  tcpBase,
unsigned  tcpMax 
)

Set the TCP port number base and max for H.245 channels.

WORD OpalManager::GetNextTCPPort (  ) 

Get the next TCP port number for H.245 channels

WORD OpalManager::GetUDPPortBase (  )  const [inline]

Get the UDP port number base for RAS channels

WORD OpalManager::GetUDPPortMax (  )  const [inline]

Get the UDP port number base for RAS channels.

void OpalManager::SetUDPPorts ( unsigned  udpBase,
unsigned  udpMax 
)

Set the TCP port number base and max for H.245 channels.

WORD OpalManager::GetNextUDPPort (  ) 

Get the next UDP port number for RAS channels

WORD OpalManager::GetRtpIpPortBase (  )  const [inline]

Get the UDP port number base for RTP channels.

WORD OpalManager::GetRtpIpPortMax (  )  const [inline]

Get the max UDP port number for RTP channels.

void OpalManager::SetRtpIpPorts ( unsigned  udpBase,
unsigned  udpMax 
)

Set the UDP port number base and max for RTP channels.

WORD OpalManager::GetRtpIpPortPair (  ) 

Get the UDP port number pair for RTP channels.

BYTE OpalManager::GetRtpIpTypeofService (  )  const [inline]

Get the IP Type Of Service byte for media (eg RTP) channels.

void OpalManager::SetRtpIpTypeofService ( unsigned  tos  )  [inline]

Set the IP Type Of Service byte for media (eg RTP) channels.

unsigned OpalManager::GetMinAudioJitterDelay (  )  const [inline]

Get the default maximum audio jitter delay parameter. Defaults to 50ms

unsigned OpalManager::GetMaxAudioJitterDelay (  )  const [inline]

Get the default maximum audio jitter delay parameter. Defaults to 250ms.

void OpalManager::SetAudioJitterDelay ( unsigned  minDelay,
unsigned  maxDelay 
)

Set the maximum audio jitter delay parameter.

Parameters:
minDelay  New minimum jitter buffer delay in milliseconds
maxDelay  New maximum jitter buffer delay in milliseconds

const PStringArray& OpalManager::GetMediaFormatOrder (  )  const [inline]

Get the default media format order.

void OpalManager::SetMediaFormatOrder ( const PStringArray &  order  )  [inline]

Set the default media format order.

const PStringArray& OpalManager::GetMediaFormatMask (  )  const [inline]

Get the default media format mask.

void OpalManager::SetMediaFormatMask ( const PStringArray &  mask  )  [inline]

Set the default media format mask.

virtual void OpalManager::SetSilenceDetectParams ( const OpalSilenceDetector::Params params  )  [inline, virtual]

Set the default parameters for the silence detector.

const OpalSilenceDetector::Params& OpalManager::GetSilenceDetectParams (  )  const [inline]

Get the default parameters for the silence detector.

virtual void OpalManager::SetEchoCancelParams ( const OpalEchoCanceler::Params params  )  [inline, virtual]

Set the default parameters for the echo cancelation.

const OpalEchoCanceler::Params& OpalManager::GetEchoCancelParams (  )  const [inline]

Get the default parameters for the silence detector.

BOOL OpalManager::DetectInBandDTMFDisabled (  )  const [inline]

void OpalManager::DisableDetectInBandDTMF ( BOOL  mode  )  [inline]

Set the default H.245 tunneling mode.

Parameters:
mode  New default mode

const PTimeInterval& OpalManager::GetNoMediaTimeout (  )  const [inline]

Get the amount of time with no media that should cause a call to clear

BOOL OpalManager::SetNoMediaTimeout ( const PTimeInterval &  newInterval  ) 

Set the amount of time with no media that should cause a call to clear

Parameters:
newInterval  New timeout for media

const PString& OpalManager::GetDefaultILSServer (  )  const [inline]

Get the default ILS server to use for user lookup.

void OpalManager::SetDefaultILSServer ( const PString &  server  )  [inline]

Set the default ILS server to use for user lookup.

void OpalManager::GarbageCollection (  ) 

virtual void OpalManager::OnNewConnection ( OpalConnection conn  )  [virtual]

virtual void OpalManager::SetDefaultSecurityMode ( const PString &  v  )  [inline, virtual]

virtual PString OpalManager::GetDefaultSecurityMode (  )  const [inline, virtual]

virtual BOOL OpalManager::UseRTPAggregation (  )  const [virtual]

OpalRecordManager& OpalManager::GetRecordManager (  )  [inline]

virtual BOOL OpalManager::StartRecording ( const PString &  callToken,
const PFilePath &  fn 
) [virtual]

virtual void OpalManager::StopRecording ( const PString &  callToken  )  [virtual]

virtual BOOL OpalManager::IsRTPNATEnabled ( OpalConnection conn,
const PIPSocket::Address &  localAddr,
const PIPSocket::Address &  peerAddr,
const PIPSocket::Address &  sigAddr,
BOOL  incoming 
) [virtual]

OpalManager::PDECLARE_NOTIFIER ( PThread  ,
OpalManager  ,
GarbageMain   
) [protected]

OpalManager::OpalCall::OpalCall ( OpalManager mgr  )  [protected]


Friends And Related Function Documentation

void OpalCall::OnReleased ( OpalConnection connection  )  [friend]


Member Data Documentation

OpalProductInfo OpalManager::productInfo [protected]

PString OpalManager::defaultUserName [protected]

PString OpalManager::defaultDisplayName [protected]

BYTE OpalManager::rtpIpTypeofService [protected]

unsigned OpalManager::minAudioJitterDelay [protected]

unsigned OpalManager::maxAudioJitterDelay [protected]

PStringArray OpalManager::mediaFormatOrder [protected]

PStringArray OpalManager::mediaFormatMask [protected]

BOOL OpalManager::disableDetectInBandDTMF [protected]

PTimeInterval OpalManager::noMediaTimeout [protected]

PString OpalManager::ilsServer [protected]

OpalSilenceDetector::Params OpalManager::silenceDetectParams [protected]

OpalEchoCanceler::Params OpalManager::echoCancelParams [protected]

struct OpalManager::PortInfo OpalManager::tcpPorts [protected]

struct OpalManager::PortInfo OpalManager::udpPorts [protected]

struct OpalManager::PortInfo OpalManager::rtpIpPorts [protected]

PIPSocket::Address OpalManager::translationAddress [protected]

PString OpalManager::stunServer [protected]

PSTUNClient* OpalManager::stun [protected]

RouteTable OpalManager::routeTable [protected]

PMutex OpalManager::routeTableMutex [protected]

PList<OpalEndPoint> OpalManager::endpoints [protected]

PReadWriteMutex OpalManager::endpointsMutex [protected]

PAtomicInteger OpalManager::lastCallTokenID [protected]

OpalManager::CallDict OpalManager::activeCalls [protected]

BOOL OpalManager::clearingAllCalls [protected]

PSyncPoint OpalManager::allCallsCleared [protected]

PThread* OpalManager::garbageCollector [protected]

PSyncPoint OpalManager::garbageCollectExit [protected]

PString OpalManager::defaultSecurityMode [protected]

OpalRecordManager OpalManager::recordManager [protected]


The documentation for this class was generated from the following file:
Generated on Fri Mar 7 06:34:05 2008 for OPAL by  doxygen 1.5.1