#include <manager.h>
Other services | |
enum | MessageWaitingType { NoMessageWaiting, VoiceMessageWaiting, FaxMessageWaiting, PagerMessageWaiting, MultimediaMessageWaiting, TextMessageWaiting, NumMessageWaitingTypes } |
virtual void | OnMWIReceived (const PString &party, MessageWaitingType type, const PString &extraInfo) |
PARRAY (RouteTable, RouteEntry) | |
virtual PBoolean | AddRouteEntry (const PString &spec) |
PBoolean | SetRouteTable (const PStringArray &specs) |
void | SetRouteTable (const RouteTable &table) |
const RouteTable & | GetRouteTable () const |
virtual PString | ApplyRouteTable (const PString &source, const PString &destination, PINDEX &entry) |
Media Streams management | |
virtual OpalMediaFormatList | GetCommonMediaFormats (bool transportable, bool pcmAudio) const |
virtual void | AdjustMediaFormats (bool local, const OpalConnection &connection, OpalMediaFormatList &mediaFormats) const |
virtual PBoolean | IsMediaBypassPossible (const OpalConnection &source, const OpalConnection &destination, unsigned sessionID) const |
virtual PBoolean | OnOpenMediaStream (OpalConnection &connection, OpalMediaStream &stream) |
virtual RTP_UDP * | CreateRTPSession (const RTP_Session::Params ¶ms) |
virtual void | OnRTPStatistics (const OpalConnection &connection, const RTP_Session &session) |
virtual bool | OnLocalRTP (OpalConnection &connection1, OpalConnection &connection2, unsigned sessionID, bool opened) const |
bool | SetMediaBypass (const PString &token1, const PString &token2, bool bypass, unsigned sessionID=0, bool network=true) |
virtual void | OnClosedMediaStream (const OpalMediaStream &stream) |
virtual PBoolean | CreateVideoInputDevice (const OpalConnection &connection, const OpalMediaFormat &mediaFormat, PVideoInputDevice *&device, PBoolean &autoDelete) |
virtual PBoolean | CreateVideoOutputDevice (const OpalConnection &connection, const OpalMediaFormat &mediaFormat, PBoolean preview, PVideoOutputDevice *&device, PBoolean &autoDelete) |
virtual OpalMediaPatch * | CreateMediaPatch (OpalMediaStream &source, PBoolean requiresPatchThread=PTrue) |
virtual void | DestroyMediaPatch (OpalMediaPatch *patch) |
virtual void | OnStartMediaPatch (OpalConnection &connection, OpalMediaPatch &patch) |
virtual void | OnStopMediaPatch (OpalConnection &connection, OpalMediaPatch &patch) |
static bool | SetMediaBypass (OpalConnection &connection1, OpalConnection &connection2, bool bypass, unsigned sessionID=0) |
Public Member Functions | |
void | GarbageCollection () |
virtual void | OnApplyStringOptions (OpalConnection &conn, OpalConnection::StringOptions &stringOptions) |
Construction | |
OpalManager () | |
~OpalManager () | |
Endpoint management | |
void | AttachEndPoint (OpalEndPoint *endpoint, const PString &prefix=PString::Empty()) |
void | DetachEndPoint (const PString &prefix) |
void | DetachEndPoint (OpalEndPoint *endpoint) |
OpalEndPoint * | FindEndPoint (const PString &prefix) |
PList< OpalEndPoint > | GetEndPoints () const |
void | ShutDownEndpoints () |
Call management | |
virtual PSafePtr< OpalCall > | SetUpCall (const PString &partyA, const PString &partyB, void *userData=NULL, unsigned options=0, OpalConnection::StringOptions *stringOptions=NULL) |
virtual PBoolean | 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 PBoolean | HasCall (const PString &token) |
PINDEX | GetCallCount () const |
virtual PBoolean | IsCallEstablished (const PString &token) |
PSafePtr< OpalCall > | FindCallWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite) |
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) |
virtual void | ClearAllCalls (OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PBoolean wait=PTrue) |
virtual void | OnClearedCall (OpalCall &call) |
virtual OpalCall * | CreateCall (void *userData) |
OpalCall * | InternalCreateCall () |
virtual void | DestroyCall (OpalCall *call) |
virtual PString | GetNextToken (char prefix) |
Presence & Instant Messaging management | |
virtual PSafePtr< OpalPresentity > | AddPresentity (const PString &presentity) |
virtual PSafePtr< OpalPresentity > | GetPresentity (const PString &presentity, PSafetyMode mode=PSafeReference) |
virtual PStringList | GetPresentities () const |
virtual bool | RemovePresentity (const PString &presentity) |
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 void | OnMessageReceived (const PURL &from, const PString &fromName, const PURL &to, const PString &type, const PString &body, const PString &conversationId) |
virtual bool | TransmitExternalIM (OpalConnection &conn, const OpalMediaFormat &format, RTP_IMFrame &frame) |
Connection management | |
virtual PSafePtr< OpalConnection > | MakeConnection (OpalCall &call, const PString &party, void *userData=NULL, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL) |
virtual void | OnNewConnection (OpalConnection &connection) |
virtual PBoolean | OnIncomingConnection (OpalConnection &connection, unsigned options, OpalConnection::StringOptions *stringOptions) |
virtual bool | OnRouteConnection (PStringSet &routesTried, const PString &a_party, const PString &b_party, OpalCall &call, unsigned options, OpalConnection::StringOptions *stringOptions) |
virtual void | OnProceeding (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, bool fromRemote, bool onHold) |
virtual void | OnHold (OpalConnection &connection) |
virtual PBoolean | OnForwarded (OpalConnection &connection, const PString &remoteParty) |
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) |
Call recording | |
virtual PBoolean | StartRecording (const PString &callToken, const PFilePath &filename, const OpalRecordManager::Options &options=false) |
virtual bool | IsRecording (const PString &callToken) |
virtual bool | StopRecording (const PString &callToken) |
Member variable access | |
const OpalProductInfo & | GetProductInfo () const |
void | SetProductInfo (const OpalProductInfo &info, bool updateAll=true) |
const PString & | GetDefaultUserName () const |
void | SetDefaultUserName (const PString &name, bool updateAll=true) |
const PString & | GetDefaultDisplayName () const |
void | SetDefaultDisplayName (const PString &name, bool updateAll=true) |
bool | CanAutoStartReceiveVideo () const |
void | SetAutoStartReceiveVideo (bool can) |
bool | CanAutoStartTransmitVideo () const |
void | SetAutoStartTransmitVideo (bool can) |
virtual PBoolean | IsLocalAddress (const PIPSocket::Address &remoteAddress) const |
virtual PBoolean | IsRTPNATEnabled (OpalConnection &connection, const PIPSocket::Address &localAddr, const PIPSocket::Address &peerAddr, const PIPSocket::Address &signalAddr, PBoolean incoming) |
virtual PBoolean | TranslateIPAddress (PIPSocket::Address &localAddress, const PIPSocket::Address &remoteAddress) |
const PString & | GetTranslationHost () const |
bool | SetTranslationHost (const PString &host) |
const PIPSocket::Address & | GetTranslationAddress () const |
void | SetTranslationAddress (const PIPSocket::Address &address) |
virtual PNatMethod * | GetNatMethod (const PIPSocket::Address &remoteAddress=PIPSocket::GetDefaultIpAny()) const |
PSTUNClient::NatTypes | SetSTUNServer (const PString &server) |
const PString & | GetSTUNServer () const |
PSTUNClient * | GetSTUNClient () 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) |
PINDEX | GetMaxRtpPayloadSize () const |
void | SetMaxRtpPayloadSize (PINDEX size, bool mtu=false) |
PINDEX | GetMaxRtpPacketSize () const |
void | SetMaxRtpPacketSize (PINDEX size) |
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 ¶ms) |
const OpalSilenceDetector::Params & | GetSilenceDetectParams () const |
virtual PBoolean | SetVideoInputDevice (const PVideoDevice::OpenArgs &deviceArgs) |
const PVideoDevice::OpenArgs & | GetVideoInputDevice () const |
virtual PBoolean | SetVideoPreviewDevice (const PVideoDevice::OpenArgs &deviceArgs) |
const PVideoDevice::OpenArgs & | GetVideoPreviewDevice () const |
virtual PBoolean | SetVideoOutputDevice (const PVideoDevice::OpenArgs &deviceArgs) |
const PVideoDevice::OpenArgs & | GetVideoOutputDevice () const |
PBoolean | DetectInBandDTMFDisabled () const |
void | DisableDetectInBandDTMF (PBoolean mode) |
const PTimeInterval & | GetNoMediaTimeout () const |
PBoolean | SetNoMediaTimeout (const PTimeInterval &newInterval) |
const PString & | GetDefaultILSServer () const |
void | SetDefaultILSServer (const PString &server) |
Protected Member Functions | |
void | InternalClearAllCalls (OpalConnection::CallEndReason reason, bool wait, bool first) |
PDECLARE_NOTIFIER (PThread, OpalManager, GarbageMain) | |
friend | OpalCall::OpalCall (OpalManager &mgr) |
Protected Attributes | |
OpalProductInfo | productInfo |
PString | defaultUserName |
PString | defaultDisplayName |
BYTE | rtpIpTypeofService |
PINDEX | rtpPayloadSizeMax |
PINDEX | rtpPacketSizeMax |
unsigned | minAudioJitterDelay |
unsigned | maxAudioJitterDelay |
PStringArray | mediaFormatOrder |
PStringArray | mediaFormatMask |
PBoolean | disableDetectInBandDTMF |
PTimeInterval | noMediaTimeout |
PString | ilsServer |
OpalSilenceDetector::Params | silenceDetectParams |
PVideoDevice::OpenArgs | videoInputDevice |
PVideoDevice::OpenArgs | videoPreviewDevice |
PVideoDevice::OpenArgs | videoOutputDevice |
OpalManager::PortInfo | tcpPorts |
OpalManager::PortInfo | udpPorts |
OpalManager::PortInfo | rtpIpPorts |
PString | translationHost |
PIPSocket::Address | translationAddress |
PString | stunServer |
PSTUNClient * | stun |
InterfaceMonitor * | interfaceMonitor |
RouteTable | m_routeTable |
PMutex | m_routeMutex |
PReadWriteMutex | endpointsMutex |
PList< OpalEndPoint > | endpointList |
std::map< PString, OpalEndPoint * > | endpointMap |
PAtomicInteger | lastCallTokenID |
OpalManager::CallDict | activeCalls |
PSafeDictionary< PString, OpalPresentity > | m_presentities |
PAtomicInteger | m_clearingAllCallsCount |
PMutex | m_clearingAllCallsMutex |
PSyncPoint | m_allCallsCleared |
PThread * | garbageCollector |
PSyncPoint | garbageCollectExit |
Friends | |
void | OpalCall::InternalOnClear () |
Data Structures | |
class | CallDict |
class | InterfaceMonitor |
struct | PortInfo |
class | RouteEntry |
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.
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.
virtual PSafePtr<OpalPresentity> OpalManager::AddPresentity | ( | const PString & | presentity | ) | [virtual] |
Add a presentity. Returns a Read/Write locked pointer to presentity.
presentity | Presentity URI |
virtual PBoolean OpalManager::AddRouteEntry | ( | const PString & | spec | ) | [virtual] |
Add a route entry to the route table.
The specification string is of the form:
pattern '=' destination where:
pattern regular expression used to select route
destination destination for the call
The "pattern" string regex is compared against routing strings that are built as follows:
a_party '\t' b_party
where:
a_party name associated with a local connection i.e. "pots:vpb:1/2" or "h323:myname@myhost.com".
b_party destination specified by the call, which may be a full URI or a simple digit string
Note that all "pattern" strings have an implied '^' at the beginning and a '$' at the end. This forces the "pattern" to match the entire source string. For convenience, the sub-expression ".*\\t" is inserted immediately after any ':' character if no '\t' is present.
Route entries are stored and searched in the route table in the order they are added.
The "destination" string is determines the endpoint used for the outbound leg of the route, when a match to the "pattern" is found. It can be a literal string, or can be constructed using various meta-strings that correspond to parts of the source. See below for a list of the available meta-strings
A "destination" starting with the string 'label:' causes the router to restart searching from the beginning of the route table using the new string as the "a_party". Thus, a route table with the folllwing entries:
"label:speeddial=h323:10.0.1.1" "pots:26=label:speeddial"
will produce the same result as the single entry "pots:26=h323:10.0.1.1".
If the "destination" parameter is of the form , then the file is read with each line consisting of a pattern=destination route specification.
"destination" strings without an equal sign or beginning with '#' are ignored.
Pattern Regex Examples: -----------------------
1) A local H.323 endpoint with with name of "myname@myhost.com" that receives a call with a destination h323Id of "boris" would generate:
"h323:myname@myhost.com\\tboris"
2) A local SIP endpoint with with name of "fred@nurk.com" that receives a call with a destination of "sip:fred@nurk.com" would generate:
"sip:fred@nurk.com\\tsip:fred@nurk.com"
3) Using line 0 of a PhoneJACK handset with a serial # of 01AB3F4 to dial the digits 2, 6 and # would generate:
"pots:Quicknet:01AB3F4:0\\t26"
Destination meta-strings: -------------------------
The available meta-strings are:
<da> Replaced by the "b_party" string. For example "pc:.*\\t.* = sip:<da>" directs calls to the SIP protocol. In this case there is a special condition where if the original destination had a valid protocol, eg h323:fred.com, then the entire string is replaced not just the <da> part.
<db> Same as <da>, but without the special condtion.
<du> Copy the "user" part of the "b_party" string. This is essentially the component after the : and before the '@', or the whole "b_party" string if these are not present.
<!du> The rest of the "b_party" string after the <du> section. The protocol is still omitted. This is usually the '@' and onward. Note if there is already an '@' in the destination before the <!du> and what is abour to replace it also has an '@' then everything between the @ and the <!du> (inclusive) is deleted, then the substitution is made so a legal URL can result.
<dn> Copy all valid consecutive E.164 digits from the "b_party" so pots:0061298765:1/2 becomes sip:0061298765@carrier.com
<dnX> As above but skip X digits, eg <dn2> skips 2 digits, so pots:00612198765 becomes sip:61298765@carrier.com
<!dn> The rest of the "b_party" after the <dn> or <dnX> sections.
<dn2ip> Translate digits separated by '*' characters to an IP address. e.g. 10*0*1*1 becomes 10.0.1.1, also 1234*10*0*1*1 becomes 1234.0.1.1 and 1234*10*0*1*1*1722 becomes 1234.0.1.1:1722.
Returns true if an entry was added.
spec | Specification string to add |
virtual void OpalManager::AdjustMediaFormats | ( | bool | local, | |
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.
local | Media formats a local ones to be presented to remote |
connection | Connection that is about to use formats |
mediaFormats | Media formats to use |
virtual PString OpalManager::ApplyRouteTable | ( | const PString & | source, | |
const PString & | destination, | |||
PINDEX & | entry | |||
) | [virtual] |
Route the source address to a destination using the route table. The source parameter may be something like pots:vpb:1/2 or sip:fred@nurk.com.
The destination parameter is a partial URL, it does not include the protocol, but may be of the form user, or simply digits.
destination | Source address, including endpoint protocol |
entry | Destination address read from source protocol |
void OpalManager::AttachEndPoint | ( | OpalEndPoint * | endpoint, | |
const PString & | prefix = PString::Empty() | |||
) |
Attach a new endpoint to the manager. This is an internal function called by the OpalEndPoint constructor.
Note that usually the endpoint is automatically "owned" by the manager. They should not be deleted directly. The DetachEndPoint() command should be used to do this.
endpoint | EndPoint to add to the manager |
prefix | Prefix to use, if empty uses endpoint->GetPrefixName() |
bool OpalManager::CanAutoStartReceiveVideo | ( | ) | const [inline] |
See if should auto-start receive video channels on connection.
bool OpalManager::CanAutoStartTransmitVideo | ( | ) | const [inline] |
See if should auto-start transmit video channels on connection.
virtual void OpalManager::ClearAllCalls | ( | OpalConnection::CallEndReason | reason = OpalConnection::EndedByLocalUser , |
|
PBoolean | wait = PTrue | |||
) | [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.
reason | Reason for call clearing |
wait | Flag to wait for calls to e cleared. |
virtual PBoolean 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.
token | Token for identifying connection |
reason | Reason for call clearing |
sync | Sync point to wait on. |
virtual PBoolean 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.
token | Token for identifying connection |
reason | Reason for call clearing |
virtual OpalCall* OpalManager::CreateCall | ( | void * | userData | ) | [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.
userData | user data passed to SetUpCall |
virtual OpalMediaPatch* OpalManager::CreateMediaPatch | ( | OpalMediaStream & | source, | |
PBoolean | requiresPatchThread = PTrue | |||
) | [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.
source | Source media stream |
virtual RTP_UDP* OpalManager::CreateRTPSession | ( | const RTP_Session::Params & | params | ) | [virtual] |
Create an RTP session. This function allows an application to have the system create descendant class versions of the RTP_UDP class. The application could use this to modify the default RTP transfer behaviour. This is called when a connection determines that RTP is required for transporting media. The default behaviour returns a new RTP_UDP.
virtual PBoolean OpalManager::CreateVideoInputDevice | ( | const OpalConnection & | connection, | |
const OpalMediaFormat & | mediaFormat, | |||
PVideoInputDevice *& | device, | |||
PBoolean & | autoDelete | |||
) | [virtual] |
Create a PVideoInputDevice for a source media stream.
connection | Connection needing created video device |
mediaFormat | Media format for stream |
device | Created device |
autoDelete | Flag for auto delete device |
virtual PBoolean OpalManager::CreateVideoOutputDevice | ( | const OpalConnection & | connection, | |
const OpalMediaFormat & | mediaFormat, | |||
PBoolean | preview, | |||
PVideoOutputDevice *& | device, | |||
PBoolean & | autoDelete | |||
) | [virtual] |
Create an PVideoOutputDevice for a sink media stream or the preview display for a source media stream.
connection | Connection needing created video device |
mediaFormat | Media format for stream |
preview | Flag indicating is a preview output |
device | Created device |
autoDelete | Flag for auto delete device |
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".
virtual void OpalManager::DestroyMediaPatch | ( | OpalMediaPatch * | patch | ) | [virtual] |
Destroy a OpalMediaPatch instance.
The default behaviour simply calls delete patch.
void OpalManager::DetachEndPoint | ( | OpalEndPoint * | endpoint | ) |
void OpalManager::DetachEndPoint | ( | const PString & | prefix | ) |
Remove an endpoint from the manager. This will delete the endpoint object.
PBoolean OpalManager::DetectInBandDTMFDisabled | ( | ) | const [inline] |
void OpalManager::DisableDetectInBandDTMF | ( | PBoolean | mode | ) | [inline] |
Set the default H.245 tunneling mode.
mode | New default mode |
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.
token | Token to identify connection |
OpalEndPoint* OpalManager::FindEndPoint | ( | const PString & | prefix | ) |
Find an endpoint instance that is using the specified prefix.
void OpalManager::GarbageCollection | ( | ) |
PINDEX OpalManager::GetCallCount | ( | ) | const [inline] |
Return the number of active calls.
virtual OpalMediaFormatList OpalManager::GetCommonMediaFormats | ( | bool | transportable, | |
bool | pcmAudio | |||
) | const [virtual] |
Get common media formats. This is called by various places to get common media formats for the basic connection classes.
The default behaviour uses the mediaFormatOrder and mediaFormatMask member variables to adjust the mediaFormats list.
transportable | Include transportable media formats |
pcmAudio | Include raw PCM audio media formats |
const PString& OpalManager::GetDefaultDisplayName | ( | ) | const [inline] |
Get the default display name for all endpoints.
const PString& OpalManager::GetDefaultILSServer | ( | ) | const [inline] |
Get the default ILS server to use for user lookup.
const PString& OpalManager::GetDefaultUserName | ( | ) | const [inline] |
Get the default username for all endpoints.
PList<OpalEndPoint> OpalManager::GetEndPoints | ( | ) | const |
Get the endpoints attached to this manager.
unsigned OpalManager::GetMaxAudioJitterDelay | ( | ) | const [inline] |
Get the default maximum audio jitter delay parameter. Defaults to 250ms.
PINDEX OpalManager::GetMaxRtpPacketSize | ( | ) | const [inline] |
Get the maximum received RTP packet size. Defaults to 2048.
PINDEX OpalManager::GetMaxRtpPayloadSize | ( | ) | const [inline] |
Get the maximum transmitted RTP payload size. Defaults to maximum safe MTU size (576 bytes as per RFC879) minus the typical size of the IP, UDP an RTP headers.
const PStringArray& OpalManager::GetMediaFormatMask | ( | ) | const [inline] |
Get the default media format mask. The is the default list of media format names to be removed from media format lists bfeore use by a connection. See OpalMediaFormatList::Remove() for more information.
const PStringArray& OpalManager::GetMediaFormatOrder | ( | ) | const [inline] |
Get the default media format order.
unsigned OpalManager::GetMinAudioJitterDelay | ( | ) | const [inline] |
Get the default maximum audio jitter delay parameter. Defaults to 50ms
virtual PNatMethod* OpalManager::GetNatMethod | ( | const PIPSocket::Address & | remoteAddress = PIPSocket::GetDefaultIpAny() |
) | const [virtual] |
Return the NAT method to use. Returns NULL if address is a local address as per IsLocalAddress(). Always returns the NAT method if address is zero. Note, the pointer is NOT to be deleted by the user.
WORD OpalManager::GetNextTCPPort | ( | ) |
Get the next TCP port number for H.245 channels
virtual PString OpalManager::GetNextToken | ( | char | prefix | ) | [virtual] |
Get next unique token ID for calls or connections. This is an internal function called by the OpalCall and other constructors.
WORD OpalManager::GetNextUDPPort | ( | ) |
Get the next UDP port number for RAS channels
const PTimeInterval& OpalManager::GetNoMediaTimeout | ( | ) | const [inline] |
Get the amount of time with no media that should cause a call to clear
virtual PStringList OpalManager::GetPresentities | ( | ) | const [virtual] |
Get all presentities.
virtual PSafePtr<OpalPresentity> OpalManager::GetPresentity | ( | const PString & | presentity, | |
PSafetyMode | mode = PSafeReference | |||
) | [virtual] |
Get a presentity.
presentity | Presentity URI |
mode | Safety mode for presentity |
const OpalProductInfo& OpalManager::GetProductInfo | ( | ) | const [inline] |
Get the product info for all endpoints.
const RouteTable& OpalManager::GetRouteTable | ( | ) | const [inline] |
Get the active route table for the manager.
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.
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.
const OpalSilenceDetector::Params& OpalManager::GetSilenceDetectParams | ( | ) | const [inline] |
Get the default parameters for the silence detector.
PSTUNClient* OpalManager::GetSTUNClient | ( | ) | const [inline] |
Return the STUN client instance in use.
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.
const PIPSocket::Address& OpalManager::GetTranslationAddress | ( | ) | const [inline] |
Get the translation address to use for TranslateIPAddress().
const PString& OpalManager::GetTranslationHost | ( | ) | const [inline] |
Get the translation host to use for TranslateIPAddress().
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.
const PVideoDevice::OpenArgs& OpalManager::GetVideoInputDevice | ( | ) | const [inline] |
Get the parameters for the video device to be used for input. This defaults to the value of the PSoundChannel::GetInputDeviceNames()[0].
const PVideoDevice::OpenArgs& OpalManager::GetVideoOutputDevice | ( | ) | const [inline] |
Get the parameters for the video device to be used for input. This defaults to the value of the PSoundChannel::GetOutputDeviceNames()[0].
const PVideoDevice::OpenArgs& OpalManager::GetVideoPreviewDevice | ( | ) | const [inline] |
Get the parameters for the video device to be used for input. This defaults to the value of the PSoundChannel::GetInputDeviceNames()[0].
virtual PBoolean OpalManager::HasCall | ( | const PString & | token | ) | [inline, virtual] |
Determine if a call is active. Return PTrue if there is an active call with the specified token. Note that the call could clear any time (even milliseconds) after this function returns PTrue.
token | Token for identifying call |
void OpalManager::InternalClearAllCalls | ( | OpalConnection::CallEndReason | reason, | |
bool | wait, | |||
bool | first | |||
) | [protected] |
OpalCall* OpalManager::InternalCreateCall | ( | ) |
virtual PBoolean OpalManager::IsCallEstablished | ( | const PString & | token | ) | [virtual] |
Determine if a call is established. Return PTrue 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 PTrue.
token | Token for identifying call |
virtual PBoolean 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 PBoolean OpalManager::IsMediaBypassPossible | ( | const OpalConnection & | source, | |
const OpalConnection & | destination, | |||
unsigned | sessionID | |||
) | const [virtual] |
See if the media can bypass the local host.
source | Source connection |
destination | Destination connection |
sessionID | Session ID for media channel |
virtual bool OpalManager::IsRecording | ( | const PString & | callToken | ) | [virtual] |
Indicate if recording is currently active on call.
callToken | Call token for call to check if recording |
virtual PBoolean OpalManager::IsRTPNATEnabled | ( | OpalConnection & | connection, | |
const PIPSocket::Address & | localAddr, | |||
const PIPSocket::Address & | peerAddr, | |||
const PIPSocket::Address & | signalAddr, | |||
PBoolean | incoming | |||
) | [virtual] |
Determine if the RTP session needs to accommodate a NAT router. For endpoints that do not use STUN or something similar to set up all the correct protocol embeddded addresses correctly when a NAT router is between the endpoints, it is possible to still accommodate the call, with some restrictions. This function determines if the RTP can proceed with special NAT allowances.
The special allowance is that the RTP code will ignore whatever the remote indicates in the protocol for the address to send RTP data and wait for the first packet to arrive from the remote and will then proceed to send all RTP data back to that address AND port.
The default behaviour checks the values of the physical link (localAddr/peerAddr) against the signaling address the remote indicated in the protocol, eg H.323 SETUP sourceCallSignalAddress or SIP "To" or "Contact" fields, and makes a guess that the remote is behind a NAT router.
connection | Connection being checked |
localAddr | Local physical address of connection |
peerAddr | Remote physical address of connection |
signalAddr | Remotes signaling address as indicated by protocol of connection |
incoming | Incoming/outgoing connection |
virtual PSafePtr<OpalConnection> 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 PFalse 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.
call | Owner of connection |
party | Party to call |
userData | user data to pass to connections |
options | options to pass to conneciton |
virtual PBoolean OpalManager::Message | ( | const PURL & | to, | |
const PString & | type, | |||
const PString & | body, | |||
PURL & | from, | |||
PString & | conversationId | |||
) | [virtual] |
virtual PBoolean OpalManager::Message | ( | const PString & | to, | |
const PString & | body | |||
) | [virtual] |
Send text message
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 PFalse 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.
connection | Connection that was established |
virtual OpalConnection::AnswerCallResponse OpalManager::OnAnswerCall | ( | OpalConnection & | connection, | |
const PString & | caller | |||
) | [virtual] |
Call back for answering an incoming call. This function is called after the connection has been acknowledged but before the connection is established
This gives the application time to wait for some event before signalling to the endpoint that the connection is to proceed. For example the user pressing an "Answer call" button.
If AnswerCallDenied is returned the connection is aborted and the connetion specific end call PDU is sent. If AnswerCallNow is returned then the connection proceeding, Finally if AnswerCallPending is returned then the protocol negotiations are paused until the AnsweringCall() function is called.
The default behaviour simply returns AnswerNow.
connection | connection that is being answered |
caller | caller |
virtual void OpalManager::OnApplyStringOptions | ( | OpalConnection & | conn, | |
OpalConnection::StringOptions & | stringOptions | |||
) | [virtual] |
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.
call | Connection that was established |
virtual void OpalManager::OnClosedMediaStream | ( | const OpalMediaStream & | stream | ) | [virtual] |
Call back for closed a media stream.
The default behaviour does nothing.
stream | Stream being closed |
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.
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 established. This usually occurs after OnConnected() and indicates that the connection is both connected and has media flowing.
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.
connection | Connection that was established |
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.
call | Call that was completed |
virtual PBoolean OpalManager::OnForwarded | ( | OpalConnection & | connection, | |
const PString & | remoteParty | |||
) | [virtual] |
A call back function whenever a connection is forwarded.
The default behaviour does nothing.
connection | Connection that was held |
remoteParty | The new remote party |
virtual void OpalManager::OnHold | ( | OpalConnection & | connection | ) | [virtual] |
virtual void OpalManager::OnHold | ( | OpalConnection & | connection, | |
bool | fromRemote, | |||
bool | onHold | |||
) | [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.
connection | Connection that was held/retrieved |
fromRemote | Indicates remote has held local connection |
onHold | Indicates have just been held/retrieved. |
virtual PBoolean 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 PTrue is returned then the connection continues. If PFalse 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.
connection | Connection that is calling |
options | options for new connection (can't use default as overrides will fail) |
virtual bool OpalManager::OnLocalRTP | ( | OpalConnection & | connection1, | |
OpalConnection & | connection2, | |||
unsigned | sessionID, | |||
bool | opened | |||
) | const [virtual] |
Indicate is a local RTP connection. This is called when a new media stream has been created and it has been detected that media will be flowing between two RTP sessions within the same process. An application could take advantage of this by optimising the transfer in some way, rather than the full media path of codecs and sockets which might not be necessary.
Note this is the complement to SetMediaBypass() as this function stops RTP data from being sent/received, while SetMediaBypass() transfers RTP data between the two endpoints.
The default behaviour returns false.
connection1 | First connection |
connection2 | Second connection |
sessionID | Session ID of RTP session |
opened | Media streams are opened/closed |
virtual void OpalManager::OnMessageReceived | ( | const PURL & | from, | |
const PString & | fromName, | |||
const PURL & | to, | |||
const PString & | type, | |||
const PString & | body, | |||
const PString & | conversationId | |||
) | [virtual] |
Called when text message received
virtual void OpalManager::OnMWIReceived | ( | const PString & | party, | |
MessageWaitingType | type, | |||
const PString & | extraInfo | |||
) | [virtual] |
Callback called when Message Waiting Indication (MWI) is received
party | Name of party MWI is for |
type | Type of message that is waiting |
extraInfo | Addition information on the MWI |
virtual void OpalManager::OnNewConnection | ( | OpalConnection & | connection | ) | [virtual] |
Call back for a new connection has been constructed. This is called after CreateConnection has returned a new connection. It allows an application to make any custom adjustments to the connection before it begins to process the protocol. behind it.
connection | New connection just created |
virtual PBoolean 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.
connection | Connection that owns the media stream |
stream | New media stream being opened |
virtual void OpalManager::OnProceeding | ( | OpalConnection & | connection | ) | [virtual] |
Call back for remote party is now responsible for completing the call. This function is called when the remote system has been contacted and it has accepted responsibility for completing, or failing, the call. This is distinct from OnAlerting() in that it is not known at this time if anything is ringing. This indication may be used to distinguish between "transport" level error, in which case another host may be tried, and that finalising the call has moved "upstream" and the local system has no more to do but await a result.
If an application overrides this function, it should generally call the ancestor version for correct operation.
The default behaviour calls the OnProceeding() on the connection's associated OpalCall object.
connection | Connection that is proceeeding |
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 PTrue.
connection | Connection that was established |
virtual bool OpalManager::OnRouteConnection | ( | PStringSet & | routesTried, | |
const PString & | a_party, | |||
const PString & | b_party, | |||
OpalCall & | call, | |||
unsigned | options, | |||
OpalConnection::StringOptions * | stringOptions | |||
) | [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 and uses MakeConnection() to start the B-party connection.
routesTried | Set of routes already tried |
a_party | Source local address |
b_party | Destination indicated by source |
call | Call for new connection |
options | Options for new connection (can't use default as overrides will fail) |
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.
connection | Connection for the channel |
session | Session with statistics |
virtual void OpalManager::OnStartMediaPatch | ( | OpalConnection & | connection, | |
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.
The default behaviour does nothing
connection | Connection patch is in |
patch | Media patch being started |
virtual void OpalManager::OnStopMediaPatch | ( | OpalConnection & | connection, | |
OpalMediaPatch & | patch | |||
) | [virtual] |
Call back when media stream patch thread stops.
connection | Connection patch is in |
patch | Media Patch being stopped |
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.
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.
connection | Connection input has come from |
tone | Tone received |
duration | Duration of tone |
OpalManager::OpalCall::OpalCall | ( | OpalManager & | mgr | ) | [protected] |
OpalManager::PARRAY | ( | RouteTable | , | |
RouteEntry | ||||
) |
OpalManager::PDECLARE_NOTIFIER | ( | PThread | , | |
OpalManager | , | |||
GarbageMain | ||||
) | [protected] |
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.
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 |
virtual bool OpalManager::RemovePresentity | ( | const PString & | presentity | ) | [virtual] |
Remove a presentity.
presentity | Presentity URI |
void OpalManager::SetAudioJitterDelay | ( | unsigned | minDelay, | |
unsigned | maxDelay | |||
) |
Set the maximum audio jitter delay parameter.
If minDelay is set to zero then both the minimum and maximum will be set to zero which will disable the jitter buffer entirely.
If maxDelay is zero, or just less that minDelay, then the maximum jitter is set to the minimum and this disables the adaptive jitter, a fixed value is used.
minDelay | New minimum jitter buffer delay in milliseconds |
maxDelay | New maximum jitter buffer delay in milliseconds |
void OpalManager::SetAutoStartReceiveVideo | ( | bool | can | ) | [inline] |
Set if should auto-start receive video channels on connection.
void OpalManager::SetAutoStartTransmitVideo | ( | bool | can | ) | [inline] |
Set if should auto-start transmit video channels on connection.
void OpalManager::SetDefaultDisplayName | ( | const PString & | name, | |
bool | updateAll = true | |||
) |
Set the default display name for all endpoints.
name | New name |
updateAll | Update all registered endpoints |
void OpalManager::SetDefaultILSServer | ( | const PString & | server | ) | [inline] |
Set the default ILS server to use for user lookup.
void OpalManager::SetDefaultUserName | ( | const PString & | name, | |
bool | updateAll = true | |||
) |
Set the default username for all endpoints.
name | New name |
updateAll | Update all registered endpoints |
void OpalManager::SetMaxRtpPacketSize | ( | PINDEX | size | ) | [inline] |
Get the maximum transmitted RTP payload size. Defaults to 2048.
void OpalManager::SetMaxRtpPayloadSize | ( | PINDEX | size, | |
bool | mtu = false | |||
) | [inline] |
Get the maximum transmitted RTP payload size. Defaults to maximum safe MTU size (576 bytes as per RFC879) minus the typical size of the IP, UDP an RTP headers.
static bool OpalManager::SetMediaBypass | ( | OpalConnection & | connection1, | |
OpalConnection & | connection2, | |||
bool | bypass, | |||
unsigned | sessionID = 0 | |||
) | [static] |
connection1 | First connection |
connection2 | Second connection |
bypass | Bypass the media |
sessionID | Session ID of media stream, 0 indicates all |
bool OpalManager::SetMediaBypass | ( | const PString & | token1, | |
const PString & | token2, | |||
bool | bypass, | |||
unsigned | sessionID = 0 , |
|||
bool | network = true | |||
) |
Set bypass mode for media.
Bypass the internal media handling, passing RTP data directly from one call/connection to another.
This can be useful for back to back calls that happen to be the same media format and you wish to avoid double decoding and encoding of media. Note this scenario is not the same as two OpalConnections within the same OpalCall, but two completely independent OpalCall where one connection is to be bypassed. For example, two OpalCall instances might have two SIPConnection instances and two OpalMixerConnection instances connected via a single OpalMixerNode. Now while there are ONLY two calls in the node, it is a waste to decode the audio, add to mixer and re-encode it again. In practice this is identical to just bypassing the mixer node completely, until a third party is added, then we need to switch back to normal (non-bypassed) operation.
Note this is the complement to OnLocalRTP() as this function transfers RTP data directly between the two endpoints, while OnLocalRTP() stops the RTP data from being sent/received.
token1 | First calls token |
token2 | Second calls token |
bypass | Bypass the media |
sessionID | Session ID of media stream, 0 indicates all |
network | Bypass the network connections of the calls |
void OpalManager::SetMediaFormatMask | ( | const PStringArray & | mask | ) |
Set the default media format mask. The is the default list of media format names to be removed from media format lists bfeore use by a connection. See OpalMediaFormatList::Remove() for more information.
void OpalManager::SetMediaFormatOrder | ( | const PStringArray & | order | ) |
Set the default media format order.
order | New order |
PBoolean OpalManager::SetNoMediaTimeout | ( | const PTimeInterval & | newInterval | ) |
Set the amount of time with no media that should cause a call to clear
newInterval | New timeout for media |
void OpalManager::SetProductInfo | ( | const OpalProductInfo & | info, | |
bool | updateAll = true | |||
) |
Set the product info for all endpoints.
info | New information |
updateAll | Update all registered endpoints |
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.
table | New table to set for routing |
PBoolean 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 PTrue if at least one entry was added.
specs | Array of specification strings. |
void OpalManager::SetRtpIpPorts | ( | unsigned | udpBase, | |
unsigned | udpMax | |||
) |
Set the UDP port number base and max for RTP channels.
void OpalManager::SetRtpIpTypeofService | ( | unsigned | tos | ) | [inline] |
Set the IP Type Of Service byte for media (eg RTP) channels.
virtual void OpalManager::SetSilenceDetectParams | ( | const OpalSilenceDetector::Params & | params | ) | [inline, virtual] |
Set the default parameters for the silence detector.
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.
void OpalManager::SetTCPPorts | ( | unsigned | tcpBase, | |
unsigned | tcpMax | |||
) |
Set the TCP port number base and max for H.245 channels.
void OpalManager::SetTranslationAddress | ( | const PIPSocket::Address & | address | ) |
Set the translation address to use for TranslateIPAddress().
bool OpalManager::SetTranslationHost | ( | const PString & | host | ) |
Set the translation host to use for TranslateIPAddress().
void OpalManager::SetUDPPorts | ( | unsigned | udpBase, | |
unsigned | udpMax | |||
) |
Set the TCP port number base and max for H.245 channels.
virtual PBoolean OpalManager::SetUpCall | ( | const PString & | partyA, | |
const PString & | partyB, | |||
PString & | token, | |||
void * | userData = NULL , |
|||
unsigned | options = 0 , |
|||
OpalConnection::StringOptions * | stringOptions = NULL | |||
) | [virtual] |
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 PSafePtr<OpalCall> OpalManager::SetUpCall | ( | const PString & | partyA, | |
const PString & | partyB, | |||
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.
partyA | The A party of call |
partyB | The B party of call |
userData | user data passed to Call and Connection |
options | options passed to connection |
stringOptions | complex string options passed to call |
virtual PBoolean OpalManager::SetVideoInputDevice | ( | const PVideoDevice::OpenArgs & | deviceArgs | ) | [virtual] |
Set the parameters for the video device to be used for input. If the name is not suitable for use with the PVideoInputDevice class then the function will return PFalse and not change the device.
This defaults to the value of the PVideoInputDevice::GetInputDeviceNames() function.
deviceArgs | Full description of device |
virtual PBoolean OpalManager::SetVideoOutputDevice | ( | const PVideoDevice::OpenArgs & | deviceArgs | ) | [virtual] |
Set the parameters for the video device to be used for output. If the name is not suitable for use with the PVideoOutputDevice class then the function will return PFalse and not change the device.
This defaults to the value of the PVideoInputDevice::GetOutputDeviceNames() function.
deviceArgs | Full description of device |
virtual PBoolean OpalManager::SetVideoPreviewDevice | ( | const PVideoDevice::OpenArgs & | deviceArgs | ) | [virtual] |
Set the parameters for the video device to be used to preview input. If the name is not suitable for use with the PVideoOutputDevice class then the function will return PFalse and not change the device.
This defaults to the value of the PVideoInputDevice::GetOutputDeviceNames() function.
deviceArgs | Full description of device |
void OpalManager::ShutDownEndpoints | ( | ) |
Shut down all of the endpoints, clearing all calls. This is synchonous and will wait till everything is shut down. This will also assure no new calls come in whilein the process of shutting down.
virtual PBoolean OpalManager::StartRecording | ( | const PString & | callToken, | |
const PFilePath & | filename, | |||
const OpalRecordManager::Options & | options = false | |||
) | [virtual] |
Start recording a call. Current version saves to a WAV file. It may either mix the receive and transmit audio stream to a single mono file, or the streams are placed into the left and right channels of a stereo WAV file.
Returns true if the call exists and there is no recording in progress for the call.
callToken | Call token for call to record |
filename | File into which to record |
options | Record mixing options |
virtual bool OpalManager::StopRecording | ( | const PString & | callToken | ) | [virtual] |
Stop a recording. Returns true if the call does exists, that recording is active is not indicated.
callToken | Call token for call to stop recording |
virtual PBoolean 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.
virtual bool OpalManager::TransmitExternalIM | ( | OpalConnection & | conn, | |
const OpalMediaFormat & | format, | |||
RTP_IMFrame & | frame | |||
) | [virtual] |
Called when text message to be sent to remote end of a connection
void OpalCall::InternalOnClear | ( | ) | [friend] |
OpalManager::CallDict OpalManager::activeCalls [protected] |
PString OpalManager::defaultDisplayName [protected] |
PString OpalManager::defaultUserName [protected] |
PBoolean OpalManager::disableDetectInBandDTMF [protected] |
PList<OpalEndPoint> OpalManager::endpointList [protected] |
std::map<PString, OpalEndPoint *> OpalManager::endpointMap [protected] |
PReadWriteMutex OpalManager::endpointsMutex [protected] |
PSyncPoint OpalManager::garbageCollectExit [protected] |
PThread* OpalManager::garbageCollector [protected] |
PString OpalManager::ilsServer [protected] |
InterfaceMonitor* OpalManager::interfaceMonitor [protected] |
PAtomicInteger OpalManager::lastCallTokenID [protected] |
PSyncPoint OpalManager::m_allCallsCleared [protected] |
PAtomicInteger OpalManager::m_clearingAllCallsCount [protected] |
PMutex OpalManager::m_clearingAllCallsMutex [protected] |
PSafeDictionary<PString, OpalPresentity> OpalManager::m_presentities [protected] |
PMutex OpalManager::m_routeMutex [protected] |
RouteTable OpalManager::m_routeTable [protected] |
unsigned OpalManager::maxAudioJitterDelay [protected] |
PStringArray OpalManager::mediaFormatMask [protected] |
PStringArray OpalManager::mediaFormatOrder [protected] |
unsigned OpalManager::minAudioJitterDelay [protected] |
PTimeInterval OpalManager::noMediaTimeout [protected] |
OpalProductInfo OpalManager::productInfo [protected] |
struct OpalManager::PortInfo OpalManager::rtpIpPorts [protected] |
BYTE OpalManager::rtpIpTypeofService [protected] |
PINDEX OpalManager::rtpPacketSizeMax [protected] |
PINDEX OpalManager::rtpPayloadSizeMax [protected] |
PSTUNClient* OpalManager::stun [protected] |
PString OpalManager::stunServer [protected] |
struct OpalManager::PortInfo OpalManager::tcpPorts [protected] |
PIPSocket::Address OpalManager::translationAddress [protected] |
PString OpalManager::translationHost [protected] |
struct OpalManager::PortInfo OpalManager::udpPorts [protected] |
PVideoDevice::OpenArgs OpalManager::videoInputDevice [protected] |
PVideoDevice::OpenArgs OpalManager::videoOutputDevice [protected] |
PVideoDevice::OpenArgs OpalManager::videoPreviewDevice [protected] |