OPAL  Version 3.18.8
OpalLineEndPoint Class Reference

#include <lidep.h>

Inheritance diagram for OpalLineEndPoint:
Collaboration diagram for OpalLineEndPoint:

Public Member Functions

Construction
 OpalLineEndPoint (OpalManager &manager)
 
 ~OpalLineEndPoint ()
 Make sure thread has stopped before exiting. More...
 
Overrides from OpalEndPoint
virtual PSafePtr< OpalConnectionMakeConnection (OpalCall &call, const PString &party, void *userData=NULL, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
virtual OpalMediaFormatList GetMediaFormats () const
 
Connection management
virtual OpalLineConnectionCreateConnection (OpalCall &call, OpalLine &line, void *userData, const PString &number)
 
LID management
PSafePtr< OpalLineConnectionGetLIDConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite)
 
PBoolean AddLine (OpalLine *line)
 
void RemoveLine (OpalLine *line)
 
const PList< OpalLine > & GetLines () const
 
void RemoveLine (const PString &token)
 
void RemoveAllLines ()
 
virtual PBoolean AddLinesFromDevice (OpalLineInterfaceDevice &device)
 
void RemoveLinesFromDevice (OpalLineInterfaceDevice &device)
 
PBoolean AddDeviceNames (const PStringArray &descriptors)
 
PBoolean AddDeviceName (const PString &descriptor)
 
const OpalLineInterfaceDeviceGetDeviceByName (const PString &descriptor)
 
virtual PBoolean AddDevice (OpalLineInterfaceDevice *device)
 
void RemoveDevice (OpalLineInterfaceDevice *device)
 
void RemoveDevices ()
 
OpalLineGetLine (const PString &lineName, bool enableAudio=false, bool terminating=true)
 
void SetDefaultLine (const PString &lineName)
 
bool SetCountryCode (OpalLineInterfaceDevice::T35CountryCodes country)
 
bool SetCountryCodeName (const PString &countryName)
 
- Public Member Functions inherited from OpalEndPoint
 P_DECLARE_BITWISE_ENUM (Attributes, 2,(NoAttributes, IsNetworkEndPoint, SupportsE164))
 
 OpalEndPoint (OpalManager &manager, const PCaselessString &prefix, Attributes attributes)
 
 ~OpalEndPoint ()
 
virtual void ShutDown ()
 
void PrintOn (ostream &strm) const
 
bool StartListeners (const PStringArray &interfaces, bool add=true)
 
virtual bool StartListener (const PString &address)
 
virtual bool StartListener (OpalListener *listener)
 
virtual PStringArray GetDefaultListeners () const
 
virtual PString GetDefaultTransport () const
 
virtual WORD GetDefaultSignalPort () const
 
OpalListenerFindListener (const OpalTransportAddress &iface)
 
bool FindListenerForProtocol (const char *proto, OpalTransportAddress &addr)
 
PBoolean StopListener (const OpalTransportAddress &iface)
 
PBoolean RemoveListener (OpalListener *listener)
 
OpalTransportAddressArray GetInterfaceAddresses (const OpalTransport *associatedTransport=NULL) const
 
 PDECLARE_AcceptHandlerNotifier (OpalEndPoint, NewIncomingConnection)
 
virtual void OnNewConnection (OpalCall &call, OpalConnection &connection)
 
virtual PBoolean OnSetUpConnection (OpalConnection &connection)
 
virtual PBoolean OnIncomingConnection (OpalConnection &connection, unsigned options, OpalConnection::StringOptions *stringOptions)
 
virtual void OnProceeding (OpalConnection &connection)
 
virtual void OnAlerting (OpalConnection &connection, bool withMedia)
 
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, bool fromRemote, bool onHold)
 
virtual void OnHold (OpalConnection &connection)
 
virtual PBoolean OnForwarded (OpalConnection &connection, const PString &remoteParty)
 
virtual bool OnTransferNotify (OpalConnection &connection, const PStringToString &info, const OpalConnection *transferringConnection)
 
virtual PBoolean ClearCall (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PSyncPoint *sync=NULL)
 
virtual PBoolean ClearCallSynchronous (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PSyncPoint *sync=NULL)
 
virtual void ClearAllCalls (OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PBoolean wait=true)
 
PSafePtr< OpalConnectionGetConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite) const
 
template<class ConnClass >
PSafePtr< ConnClass > GetConnectionWithLockAs (const PString &token, PSafetyMode mode=PSafeReadWrite) const
 
PStringList GetAllConnections ()
 
PINDEX GetConnectionCount () const
 
virtual PBoolean HasConnection (const PString &token)
 
virtual void DestroyConnection (OpalConnection *connection)
 
virtual void AdjustMediaFormats (bool local, const OpalConnection &connection, OpalMediaFormatList &mediaFormats) const
 
virtual bool GetMediaTransportAddresses (const OpalConnection &provider, const OpalConnection &consumer, unsigned sessionId, const OpalMediaType &mediaType, OpalTransportAddressArray &transports) const
 
virtual PBoolean OnOpenMediaStream (OpalConnection &connection, OpalMediaStream &stream)
 
virtual void OnClosedMediaStream (const OpalMediaStream &stream)
 
virtual void OnFailedMediaStream (OpalConnection &connection, bool fromRemote, const PString &reason)
 
void SetMediaCryptoSuites (const PStringArray &security)
 
PStringArray GetMediaCryptoSuites () const
 
virtual PStringArray GetAllMediaCryptoSuites () const
 
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)
 
virtual PBoolean Message (const PString &to, const PString &body)
 
virtual PBoolean Message (const PURL &to, const PString &type, const PString &body, PURL &from, PString &conversationId)
 
virtual PBoolean Message (OpalIM &Message)
 
virtual void OnMessageReceived (const OpalIM &message)
 
virtual void OnMWIReceived (const PString &party, OpalManager::MessageWaitingType type, const PString &extraInfo)
 
virtual bool GetConferenceStates (OpalConferenceStates &states, const PString &name=PString::Empty()) const
 
virtual void OnConferenceStatusChanged (OpalEndPoint &endpoint, const PString &uri, OpalConferenceState::ChangeType change)
 
virtual PStringList GetNetworkURIs (const PString &name) const
 
virtual PBoolean GarbageCollection ()
 
OpalManagerGetManager () const
 
const PString & GetPrefixName () const
 
bool HasAttribute (Attributes opt) const
 
const OpalProductInfoGetProductInfo () const
 
void SetProductInfo (const OpalProductInfo &info)
 
const PString & GetDefaultLocalPartyName () const
 
virtual void SetDefaultLocalPartyName (const PString &name)
 
const PString & GetDefaultDisplayName () const
 
void SetDefaultDisplayName (const PString &name)
 
OpalBandwidth GetInitialBandwidth (OpalBandwidth::Direction dir) const
 
bool SetInitialBandwidth (OpalBandwidth::Direction dir, OpalBandwidth bandwidth)
 
const OpalListenerList & GetListeners () const
 
const
OpalConnection::StringOptions
GetDefaultStringOptions () const
 
void SetDefaultStringOptions (const OpalConnection::StringOptions &opts, bool overwrite=false)
 
void SetDefaultStringOption (const PCaselessString &key, const PString &data)
 
void RemoveDefaultStringOption (const PCaselessString &key)
 
virtual PStringList GetAvailableStringOptions () const
 
OpalConnection::SendUserInputModes GetSendUserInputMode () const
 
void SetSendUserInputMode (OpalConnection::SendUserInputModes mode)
 
const PIPSocket::QoS & GetSignalQoS () const
 
void SetSignalQoS (const PIPSocket::QoS &qos)
 
const PIPSocket::QoS & GetMediaQoS (const OpalMediaType &type) const
 
void SetMediaQoS (const OpalMediaType &type, const PIPSocket::QoS &qos)
 
PINDEX GetMaxSizeUDP () const
 
void SetMaxSizeUDP (PINDEX size)
 

Protected Member Functions

 PDECLARE_NOTIFIER (PThread, OpalLineEndPoint, MonitorLines)
 
virtual void MonitorLine (OpalLine &line)
 
 PDECLARE_MUTEX (m_linesMutex)
 
- Protected Member Functions inherited from OpalEndPoint
OpalConnectionAddConnection (OpalConnection *connection)
 

Protected Attributes

OpalLIDList m_devices
 
OpalLineList m_lines
 
PString m_defaultLine
 
PThread * m_monitorThread
 
PSyncPoint m_exitFlag
 
- Protected Attributes inherited from OpalEndPoint
OpalManagerm_manager
 
PCaselessString m_prefixName
 
Attributes m_attributes
 
PINDEX m_maxSizeUDP
 
OpalProductInfo m_productInfo
 
PString m_defaultLocalPartyName
 
PString m_defaultDisplayName
 
PStringArray m_mediaCryptoSuites
 
PIPSocket::QoS m_signalQoS
 
OpalManager::MediaQoSMap m_mediaQoS
 
OpalBandwidth m_initialRxBandwidth
 
OpalBandwidth m_initialTxBandwidth
 
OpalConnection::StringOptions m_defaultStringOptions
 
OpalConnection::SendUserInputModes m_defaultSendUserInputMode
 
OpalListenerList m_listeners
 
OpalEndPoint::ConnectionDict m_connectionsActive
 

Detailed Description

This class describes and endpoint that handles LID lines. This is the ancestor class to the LID endpoints that handle PSTN lines and POTS lines respectively.

Constructor & Destructor Documentation

OpalLineEndPoint::OpalLineEndPoint ( OpalManager manager)

Create a new endpoint.

Parameters
managerManager of all endpoints.
OpalLineEndPoint::~OpalLineEndPoint ( )

Make sure thread has stopped before exiting.

Member Function Documentation

virtual PBoolean OpalLineEndPoint::AddDevice ( OpalLineInterfaceDevice device)
virtual

Add a line interface device to the endpoint. This will add the OpalLineInterfaceDevice descendent and all of the lines that it has to the endpoint.

The lid is then "owned" by the endpoint and will be deleted automatically when the endpoint is destroyed.

Note the device should already be open or no lines are added.

Returns true if at least one line was added.

Parameters
deviceDevice to add
PBoolean OpalLineEndPoint::AddDeviceName ( const PString &  descriptor)

Add a line interface device to the endpoint by name. This will add the registered OpalLineInterfaceDevice descendent and all of the lines that it has to the endpoint. The parameter is a string as would be returned from the OpalLineInterfaceDevice::GetAllDevices() function.

Returns true if at least one line was added or the descriptor was already present.

Parameters
descriptorDevice descritption to add
PBoolean OpalLineEndPoint::AddDeviceNames ( const PStringArray &  descriptors)

Add a line interface devices to the endpoint by name. This calls AddDeviceName() for each entry in the array.

Returns true if at least one line from one device was added.

Parameters
descriptorsDevice descritptions to add
PBoolean OpalLineEndPoint::AddLine ( OpalLine line)

Add a line to the endpoint. Note that once the line is added it is "owned" by the endpoint and should not be deleted directly. Use the RemoveLine() function to delete the line.

Returns true if the lines device was open and the line was added.

virtual PBoolean OpalLineEndPoint::AddLinesFromDevice ( OpalLineInterfaceDevice device)
virtual

Add all lines on a device to the endpoint. Note that once the line is added it is "owned" by the endpoint and should not be deleted directly. Use the RemoveLine() function to delete the line.

Note the device should already be open or no lines are added.

Returns true if at least one line was added.

Parameters
deviceDevice to add lines
virtual OpalLineConnection* OpalLineEndPoint::CreateConnection ( OpalCall call,
OpalLine line,
void *  userData,
const PString &  number 
)
virtual
Parameters
callCall that owns the connection
lineLine connection is to use
userDataArbitrary user data from MakeConnection
numberNumber to dial in outgoing call
const OpalLineInterfaceDevice* OpalLineEndPoint::GetDeviceByName ( const PString &  descriptor)

Indicate if the line interface device is in use by the endpoint.

Parameters
descriptorDevice descritption to add
PSafePtr<OpalLineConnection> OpalLineEndPoint::GetLIDConnectionWithLock ( const PString &  token,
PSafetyMode  mode = PSafeReadWrite 
)
inline

Find a connection that uses the specified token. This searches the endpoint for the connection that contains the token as provided by functions such as MakeConnection().

Parameters
tokenToken to identify connection
modeLock mode

References OpalEndPoint::GetConnectionWithLock().

OpalLine* OpalLineEndPoint::GetLine ( const PString &  lineName,
bool  enableAudio = false,
bool  terminating = true 
)

Get the line by name. The lineName parameter may be "*" to matche the first line.

If the enableAudio flag is true then the EnableAudio() function is called on the line and it is returns only if successful. This effectively locks the line for exclusive use of the caller.

Parameters
lineNameName of line to get.
enableAudioFlag to enable audio on the line.
terminatingFlag to indicate should be a terminating line
const PList<OpalLine>& OpalLineEndPoint::GetLines ( ) const
inline

get all lines of the endpopint

Returns
the constant list of all lines belonged to the endpoint

References m_lines.

virtual OpalMediaFormatList OpalLineEndPoint::GetMediaFormats ( ) const
virtual

Get the data formats this endpoint is capable of operating. This provides a list of media data format names that may be used by an OpalMediaStream may be created by a connection from this endpoint.

Note that a specific connection may not actually support all of the media formats returned here, but should return no more.

The default behaviour is pure.

Implements OpalEndPoint.

virtual PSafePtr<OpalConnection> OpalLineEndPoint::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. This is called from the OpalManager::MakeConnection() function once it has determined that this is the endpoint for the protocol.

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 proto field is optional when passed to a specific endpoint. If it is present, however, it must agree with the endpoints protocol name or false is returned.

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 assiciated 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
callOwner of connection
partyRemote party to call
userDataArbitrary data to pass to connection
optionsoptions to pass to conneciton
stringOptionsOptions to pass to connection

Implements OpalEndPoint.

virtual void OpalLineEndPoint::MonitorLine ( OpalLine line)
protectedvirtual
OpalLineEndPoint::PDECLARE_MUTEX ( m_linesMutex  )
protected
OpalLineEndPoint::PDECLARE_NOTIFIER ( PThread  ,
OpalLineEndPoint  ,
MonitorLines   
)
protected
void OpalLineEndPoint::RemoveAllLines ( )

Remove all lines from the endpoint. The line is removed from the endpoints processing and deleted. All devices are also deleted from the endpoint

Referenced by RemoveDevices().

void OpalLineEndPoint::RemoveDevice ( OpalLineInterfaceDevice device)

Remove the device and all its lines from the endpoint. The device will be automatically deleted.

Parameters
deviceDevice to remove
void OpalLineEndPoint::RemoveDevices ( )
inline

Remove all devices from the endpoint.

References RemoveAllLines().

void OpalLineEndPoint::RemoveLine ( OpalLine line)

Remove a line from the endpoint. The line is removed from the endpoints processing and deleted.

void OpalLineEndPoint::RemoveLine ( const PString &  token)

Remove a line from the endpoint. The line is removed from the endpoints processing and deleted.

void OpalLineEndPoint::RemoveLinesFromDevice ( OpalLineInterfaceDevice device)

Remove all lines on a device from the endpoint. The lines are removed from the endpoints processing and deleted.

Parameters
deviceDevice to remove lines
bool OpalLineEndPoint::SetCountryCode ( OpalLineInterfaceDevice::T35CountryCodes  country)

Set the country code set for the device. This may change the line analogue coefficients, ring detect, call disconnect detect and call progress tones to fit the countries telephone network.

Parameters
countryCountry code for device
bool OpalLineEndPoint::SetCountryCodeName ( const PString &  countryName)

Set the country code set for the device.

Parameters
countryNameCountry code for device
void OpalLineEndPoint::SetDefaultLine ( const PString &  lineName)

Set the default line to be used on call. If the lineName is "*" then the first available line is used.

Parameters
lineNameName of line to set to default.

Field Documentation

PString OpalLineEndPoint::m_defaultLine
protected
OpalLIDList OpalLineEndPoint::m_devices
protected
PSyncPoint OpalLineEndPoint::m_exitFlag
protected
OpalLineList OpalLineEndPoint::m_lines
protected

Referenced by GetLines().

PThread* OpalLineEndPoint::m_monitorThread
protected

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