OPAL  Version 3.10.4
manager.h
Go to the documentation of this file.
00001 /*
00002  * manager.h
00003  *
00004  * OPAL system manager.
00005  *
00006  * Open Phone Abstraction Library (OPAL)
00007  * Formally known as the Open H323 project.
00008  *
00009  * Copyright (c) 2001 Equivalence Pty. Ltd.
00010  *
00011  * The contents of this file are subject to the Mozilla Public License
00012  * Version 1.0 (the "License"); you may not use this file except in
00013  * compliance with the License. You may obtain a copy of the License at
00014  * http://www.mozilla.org/MPL/
00015  *
00016  * Software distributed under the License is distributed on an "AS IS"
00017  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00018  * the License for the specific language governing rights and limitations
00019  * under the License.
00020  *
00021  * The Original Code is Open Phone Abstraction Library.
00022  *
00023  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00024  *
00025  * Contributor(s): ______________________________________.
00026  *
00027  * $Revision: 26937 $
00028  * $Author: rjongbloed $
00029  * $Date: 2012-02-06 19:54:19 -0600 (Mon, 06 Feb 2012) $
00030  */
00031 
00032 #ifndef OPAL_OPAL_MANAGER_H
00033 #define OPAL_OPAL_MANAGER_H
00034 
00035 #ifdef P_USE_PRAGMA
00036 #pragma interface
00037 #endif
00038 
00039 #include <opal/buildopts.h>
00040 
00041 #include <opal/pres_ent.h>
00042 #include <opal/call.h>
00043 #include <opal/connection.h> //OpalConnection::AnswerCallResponse
00044 #include <opal/guid.h>
00045 #include <codec/silencedetect.h>
00046 #include <codec/echocancel.h>
00047 #include <ptclib/pstun.h>
00048 #include <ptclib/url.h>
00049 
00050 #if OPAL_VIDEO
00051 #include <ptlib/videoio.h>
00052 #endif
00053 
00054 class OpalEndPoint;
00055 class OpalMediaPatch;
00056 
00057 
00074 class OpalManager : public PObject
00075 {
00076     PCLASSINFO(OpalManager, PObject);
00077   public:
00082     OpalManager();
00083 
00088     ~OpalManager();
00090 
00100     void AttachEndPoint(
00101       OpalEndPoint * endpoint,    
00102       const PString & prefix = PString::Empty()  
00103     );
00104 
00108     void DetachEndPoint(
00109       const PString & prefix
00110     );
00111     void DetachEndPoint(
00112       OpalEndPoint * endpoint
00113     );
00114 
00117     OpalEndPoint * FindEndPoint(
00118       const PString & prefix
00119     );
00120 
00123     PList<OpalEndPoint> GetEndPoints() const;
00124 
00130     void ShutDownEndpoints();
00132 
00151     virtual PSafePtr<OpalCall> SetUpCall(
00152       const PString & partyA,       
00153       const PString & partyB,       
00154       void * userData = NULL,       
00155       unsigned options = 0,         
00156       OpalConnection::StringOptions * stringOptions = NULL 
00157     );
00158     virtual PBoolean SetUpCall(
00159       const PString & partyA,       
00160       const PString & partyB,       
00161       PString & token,              
00162       void * userData = NULL,       
00163       unsigned options = 0,         
00164       OpalConnection::StringOptions * stringOptions = NULL 
00165     );
00166 
00172     virtual PBoolean HasCall(
00173       const PString & token  
00174     ) { return activeCalls.FindWithLock(token, PSafeReference) != NULL; }
00175 
00178     PINDEX GetCallCount() const { return activeCalls.GetSize(); }
00179 
00182      PArray<PString> GetAllCalls() const { return activeCalls.GetKeys(); }
00183 
00192     PSafePtr<OpalCall> FindCallWithLock(
00193       const PString & token,  
00194       PSafetyMode mode = PSafeReadWrite 
00195     ) { return activeCalls.FindWithLock(token, mode); }
00196 
00205     virtual void OnEstablishedCall(
00206       OpalCall & call   
00207     );
00208 
00215     virtual PBoolean IsCallEstablished(
00216       const PString & token  
00217     );
00218 
00226     virtual PBoolean ClearCall(
00227       const PString & token,    
00228       OpalConnection::CallEndReason reason = OpalConnection::EndedByLocalUser, 
00229       PSyncPoint * sync = NULL  
00230     );
00231 
00239     virtual PBoolean ClearCallSynchronous(
00240       const PString & token,    
00241       OpalConnection::CallEndReason reason = OpalConnection::EndedByLocalUser 
00242     );
00243 
00249     virtual void ClearAllCalls(
00250       OpalConnection::CallEndReason reason = OpalConnection::EndedByLocalUser, 
00251       PBoolean wait = true   
00252     );
00253 
00267     virtual void OnClearedCall(
00268       OpalCall & call   
00269     );
00270 
00279     virtual OpalCall * CreateCall(
00280       void * userData            
00281     );
00282     OpalCall * InternalCreateCall();
00283 
00292     virtual void DestroyCall(
00293       OpalCall * call
00294     );
00295 
00300     virtual PString GetNextToken(char prefix);
00302 
00311     virtual PSafePtr<OpalPresentity> AddPresentity(
00312       const PString & presentity  
00313     );
00314 
00317     virtual PSafePtr<OpalPresentity> GetPresentity(
00318       const PString & presentity,         
00319       PSafetyMode mode = PSafeReference   
00320     );
00321 
00324     virtual PStringList GetPresentities() const;
00325 
00328     virtual bool RemovePresentity(
00329       const PString & presentity  
00330     );
00332 
00337     virtual PBoolean Message(
00338       const PString & to, 
00339       const PString & body
00340     );
00341     virtual PBoolean Message(
00342       const PURL & to, 
00343       const PString & type,
00344       const PString & body,
00345       PURL & from, 
00346       PString & conversationId
00347     );
00348     virtual PBoolean Message(
00349       OpalIM & message
00350     );
00351 
00354     virtual void OnMessageReceived(
00355       const OpalIM & message
00356     );
00357 
00359 
00396     virtual PSafePtr<OpalConnection> MakeConnection(
00397       OpalCall & call,                   
00398       const PString & party,             
00399       void * userData = NULL,            
00400       unsigned int options = 0,          
00401       OpalConnection::StringOptions * stringOptions = NULL 
00402     );
00403 
00409     virtual void OnNewConnection(
00410       OpalConnection & connection   
00411     );
00412 
00439     virtual PBoolean OnIncomingConnection(
00440       OpalConnection & connection,   
00441       unsigned options,              
00442       OpalConnection::StringOptions * stringOptions 
00443     );
00444 
00451     virtual bool OnRouteConnection(
00452       PStringSet & routesTried,     
00453       const PString & a_party,      
00454       const PString & b_party,      
00455       OpalCall & call,              
00456       unsigned options,             
00457       OpalConnection::StringOptions * stringOptions 
00458     );
00459 
00475     virtual void OnProceeding(
00476       OpalConnection & connection   
00477     );
00478 
00495     virtual void OnAlerting(
00496       OpalConnection & connection   
00497     );
00498 
00515     virtual OpalConnection::AnswerCallResponse OnAnswerCall(
00516       OpalConnection & connection,    
00517        const PString & caller         
00518     );
00519 
00531     virtual void OnConnected(
00532       OpalConnection & connection   
00533     );
00534 
00548     virtual void OnEstablished(
00549       OpalConnection & connection   
00550     );
00551 
00567     virtual void OnReleased(
00568       OpalConnection & connection   
00569     );
00570     
00577     virtual void OnHold(
00578       OpalConnection & connection,   
00579       bool fromRemote,               
00580       bool onHold                    
00581     );
00582     virtual void OnHold(OpalConnection & connection); // For backward compatibility
00583 
00588     virtual PBoolean OnForwarded(
00589       OpalConnection & connection,  
00590       const PString & remoteParty         
00591     );
00592 
00638     virtual bool OnTransferNotify(
00639       OpalConnection & connection,  
00640       const PStringToString & info  
00641     );
00643 
00644 
00654     virtual OpalMediaFormatList GetCommonMediaFormats(
00655       bool transportable,  
00656       bool pcmAudio        
00657     ) const;
00658 
00668     virtual void AdjustMediaFormats(
00669       bool local,                         
00670       const OpalConnection & connection,  
00671       OpalMediaFormatList & mediaFormats  
00672     ) const;
00673 
00676     virtual PBoolean IsMediaBypassPossible(
00677       const OpalConnection & source,      
00678       const OpalConnection & destination, 
00679       unsigned sessionID                  
00680     ) const;
00681 
00697     virtual PBoolean OnOpenMediaStream(
00698       OpalConnection & connection,  
00699       OpalMediaStream & stream    
00700     );
00701 
00710         virtual RTP_UDP * CreateRTPSession (const RTP_Session::Params & params);
00711 
00719     virtual void OnRTPStatistics(
00720       const OpalConnection & connection,  
00721       const RTP_Session & session         
00722     );
00723 
00740     virtual bool OnLocalRTP(
00741       OpalConnection & connection1, 
00742       OpalConnection & connection2, 
00743       unsigned sessionID,           
00744       bool opened                   
00745     ) const;
00746 
00772     bool SetMediaPassThrough(
00773       const PString & token1, 
00774       const PString & token2, 
00775       bool bypass,            
00776       unsigned sessionID = 0, 
00777       bool network  = true    
00778     );
00779     static bool SetMediaPassThrough(
00780       OpalConnection & connection1, 
00781       OpalConnection & connection2, 
00782       bool bypass,                  
00783       unsigned sessionID = 0        
00784     );
00785 
00790     virtual void OnClosedMediaStream(
00791       const OpalMediaStream & stream     
00792     );
00793 
00794 #if OPAL_VIDEO
00795 
00797     virtual PBoolean CreateVideoInputDevice(
00798       const OpalConnection & connection,    
00799       const OpalMediaFormat & mediaFormat,  
00800       PVideoInputDevice * & device,         
00801       PBoolean & autoDelete                     
00802     );
00803 
00807     virtual PBoolean CreateVideoOutputDevice(
00808       const OpalConnection & connection,    
00809       const OpalMediaFormat & mediaFormat,  
00810       PBoolean preview,                         
00811       PVideoOutputDevice * & device,        
00812       PBoolean & autoDelete                     
00813     );
00814 #endif
00815 
00823     virtual OpalMediaPatch * CreateMediaPatch(
00824       OpalMediaStream & source,         
00825       PBoolean requiresPatchThread = true  
00826     );
00827 
00832     virtual void DestroyMediaPatch(
00833       OpalMediaPatch * patch
00834     );
00835 
00842     virtual void OnStartMediaPatch(
00843       OpalConnection & connection,  
00844       OpalMediaPatch & patch        
00845     );
00846 
00849     virtual void OnStopMediaPatch(
00850       OpalConnection & connection,  
00851       OpalMediaPatch & patch        
00852     );
00854 
00862     virtual void OnUserInputString(
00863       OpalConnection & connection,  
00864       const PString & value         
00865     );
00866 
00873     virtual void OnUserInputTone(
00874       OpalConnection & connection,  
00875       char tone,                    
00876       int duration                  
00877     );
00878 
00881     virtual PString ReadUserInput(
00882       OpalConnection & connection,        
00883       const char * terminators = "#\r\n", 
00884       unsigned lastDigitTimeout = 4,      
00885       unsigned firstDigitTimeout = 30     
00886     );
00888 
00891 
00892     enum MessageWaitingType { 
00893       NoMessageWaiting,
00894       VoiceMessageWaiting, 
00895       FaxMessageWaiting,
00896       PagerMessageWaiting,
00897       MultimediaMessageWaiting,
00898       TextMessageWaiting,
00899       NumMessageWaitingTypes
00900     };
00901 
00912     virtual void OnMWIReceived(
00913       const PString & party,    
00914       MessageWaitingType type,  
00915       const PString & extraInfo 
00916     );
00917     
00918     
00919     class RouteEntry : public PObject
00920     {
00921         PCLASSINFO(RouteEntry, PObject);
00922       public:
00923         RouteEntry(const PString & pat, const PString & dest);
00924         void PrintOn(ostream & strm) const;
00925         PString            pattern;
00926         PString            destination;
00927         PRegularExpression regex;
00928     };
00929     PARRAY(RouteTable, RouteEntry);
00930 
01041     virtual PBoolean AddRouteEntry(
01042       const PString & spec  
01043     );
01044 
01051     PBoolean SetRouteTable(
01052       const PStringArray & specs  
01053     );
01054 
01059     void SetRouteTable(
01060       const RouteTable & table  
01061     );
01062 
01065     const RouteTable & GetRouteTable() const { return m_routeTable; }
01066 
01074     virtual PString ApplyRouteTable(
01075       const PString & source,      
01076       const PString & destination, 
01077       PINDEX & entry               
01078     );
01080 
01081 #if OPAL_HAS_MIXER
01082 
01092     virtual PBoolean StartRecording(
01093       const PString & callToken,  
01094       const PFilePath & filename, 
01095       const OpalRecordManager::Options & options = false 
01096     );
01097 
01100     virtual bool IsRecording(
01101       const PString & callToken   
01102     );
01103 
01108     virtual bool StopRecording(
01109       const PString & callToken   
01110     );
01111 
01113 #endif
01114 
01119     const OpalProductInfo & GetProductInfo() const { return productInfo; }
01120 
01123     void SetProductInfo(
01124       const OpalProductInfo & info, 
01125       bool updateAll = true         
01126     );
01127 
01130     const PString & GetDefaultUserName() const { return defaultUserName; }
01131 
01134     void SetDefaultUserName(
01135       const PString & name,   
01136       bool updateAll = true   
01137     );
01138 
01141     const PString & GetDefaultDisplayName() const { return defaultDisplayName; }
01142 
01145     void SetDefaultDisplayName(
01146       const PString & name,   
01147       bool updateAll = true   
01148     );
01149 
01150 #if OPAL_VIDEO
01151 
01152     //
01153     // these functions are deprecated and used only for backwards compatibility
01154     // applications should use OpalConnection::GetAutoStart() to check whether
01155     // a specific media type can be auto-started
01156     //
01157 
01160     bool CanAutoStartReceiveVideo() const { return (OpalMediaType::Video().GetAutoStart()&OpalMediaType::Receive) != 0; }
01161 
01164     void SetAutoStartReceiveVideo(bool can) { OpalMediaType::Video().GetDefinition()->SetAutoStart(OpalMediaType::Receive, can); }
01165 
01168     bool CanAutoStartTransmitVideo() const { return (OpalMediaType::Video().GetAutoStart()&OpalMediaType::Transmit) != 0; }
01169 
01172     void SetAutoStartTransmitVideo(bool can) { OpalMediaType::Video().GetDefinition()->SetAutoStart(OpalMediaType::Transmit, can); }
01173 
01174 #endif
01175 
01182     virtual PBoolean IsLocalAddress(
01183       const PIPSocket::Address & remoteAddress
01184     ) const;
01185 
01203     virtual PBoolean IsRTPNATEnabled(
01204       OpalConnection & connection,            
01205       const PIPSocket::Address & localAddr,   
01206       const PIPSocket::Address & peerAddr,    
01207       const PIPSocket::Address & signalAddr,  
01208       PBoolean incoming                       
01209     );
01210 
01217     virtual PBoolean TranslateIPAddress(
01218       PIPSocket::Address & localAddress,
01219       const PIPSocket::Address & remoteAddress
01220     );
01221 
01224     const PString & GetTranslationHost() const { return translationHost; }
01225 
01228     bool SetTranslationHost(
01229       const PString & host
01230     );
01231 
01234     const PIPSocket::Address & GetTranslationAddress() const { return translationAddress; }
01235 
01238     void SetTranslationAddress(
01239       const PIPSocket::Address & address
01240     );
01241 
01247     virtual PNatMethod * GetNatMethod(
01248       const PIPSocket::Address & remoteAddress = PIPSocket::GetDefaultIpAny()
01249     ) const;
01250 
01255     PSTUNClient::NatTypes SetSTUNServer(
01256       const PString & server
01257     );
01258 
01261     const PString & GetSTUNServer() const { return stunServer; }
01262 
01265     PSTUNClient * GetSTUNClient() const { return stun; }
01266 
01269     WORD GetTCPPortBase() const { return tcpPorts.base; }
01270 
01273     WORD GetTCPPortMax() const { return tcpPorts.max; }
01274 
01277     void SetTCPPorts(unsigned tcpBase, unsigned tcpMax);
01278 
01281     WORD GetNextTCPPort();
01282 
01285     WORD GetUDPPortBase() const { return udpPorts.base; }
01286 
01289     WORD GetUDPPortMax() const { return udpPorts.max; }
01290 
01293     void SetUDPPorts(unsigned udpBase, unsigned udpMax);
01294 
01297     WORD GetNextUDPPort();
01298 
01301     WORD GetRtpIpPortBase() const { return rtpIpPorts.base; }
01302 
01305     WORD GetRtpIpPortMax() const { return rtpIpPorts.max; }
01306 
01309     void SetRtpIpPorts(unsigned udpBase, unsigned udpMax);
01310 
01313     WORD GetRtpIpPortPair();
01314 
01317     BYTE GetMediaTypeOfService() const { return m_defaultMediaTypeOfService; }
01318 
01321     void SetMediaTypeOfService(unsigned tos) { m_defaultMediaTypeOfService = (BYTE)tos; }
01322 
01323     // For backward compatibility
01324     BYTE P_DEPRECATED GetRtpIpTypeofService() const { return m_defaultMediaTypeOfService; }
01325     void P_DEPRECATED SetRtpIpTypeofService(unsigned tos) { m_defaultMediaTypeOfService = (BYTE)tos; }
01326 
01329     BYTE GetMediaTypeOfService(const OpalMediaType & type) const;
01330 
01333     void SetMediaTypeOfService(const OpalMediaType & type, unsigned tos);
01334 
01339     PINDEX GetMaxRtpPayloadSize() const { return rtpPayloadSizeMax; }
01340 
01345     void SetMaxRtpPayloadSize(
01346       PINDEX size,
01347       bool mtu = false
01348     ) { rtpPayloadSizeMax = size - (mtu ? (20+16+12) : 0); }
01349 
01353     PINDEX GetMaxRtpPacketSize() const { return rtpPacketSizeMax; }
01354 
01358     void SetMaxRtpPacketSize(
01359       PINDEX size
01360     ) { rtpPacketSizeMax = size; }
01361 
01365     unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
01366 
01370     unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
01371 
01381     void SetAudioJitterDelay(
01382       unsigned minDelay,   
01383       unsigned maxDelay    
01384     );
01385 
01388     const PStringArray & GetMediaFormatOrder() const { return mediaFormatOrder; }
01389 
01392     void SetMediaFormatOrder(
01393       const PStringArray & order   
01394     );
01395 
01401     const PStringArray & GetMediaFormatMask() const { return mediaFormatMask; }
01402 
01408     void SetMediaFormatMask(
01409       const PStringArray & mask   //< New mask
01410     );
01411 
01414     virtual void SetSilenceDetectParams(
01415       const OpalSilenceDetector::Params & params
01416     ) { silenceDetectParams = params; }
01417 
01420     const OpalSilenceDetector::Params & GetSilenceDetectParams() const { return silenceDetectParams; }
01421     
01422 #if OPAL_AEC
01423 
01425     virtual void SetEchoCancelParams(
01426       const OpalEchoCanceler::Params & params
01427     ) { echoCancelParams = params; }
01428 
01431     const OpalEchoCanceler::Params & GetEchoCancelParams() const { return echoCancelParams; }
01432 #endif
01433 
01434 #if OPAL_VIDEO
01435 
01443     virtual PBoolean SetVideoInputDevice(
01444       const PVideoDevice::OpenArgs & deviceArgs 
01445     );
01446 
01450     const PVideoDevice::OpenArgs & GetVideoInputDevice() const { return videoInputDevice; }
01451 
01459     virtual PBoolean SetVideoPreviewDevice(
01460       const PVideoDevice::OpenArgs & deviceArgs 
01461     );
01462 
01466     const PVideoDevice::OpenArgs & GetVideoPreviewDevice() const { return videoPreviewDevice; }
01467 
01475     virtual PBoolean SetVideoOutputDevice(
01476       const PVideoDevice::OpenArgs & deviceArgs 
01477     );
01478 
01482     const PVideoDevice::OpenArgs & GetVideoOutputDevice() const { return videoOutputDevice; }
01483 
01484 #endif
01485 
01486     PBoolean DetectInBandDTMFDisabled() const
01487       { return disableDetectInBandDTMF; }
01488 
01491     void DisableDetectInBandDTMF(
01492       PBoolean mode 
01493     ) { disableDetectInBandDTMF = mode; } 
01494 
01497     const PTimeInterval & GetNoMediaTimeout() const { return noMediaTimeout; }
01498 
01501     PBoolean SetNoMediaTimeout(
01502       const PTimeInterval & newInterval  
01503     );
01504 
01507     const PString & GetDefaultILSServer() const { return ilsServer; }
01508 
01511     void SetDefaultILSServer(
01512       const PString & server
01513     ) { ilsServer = server; }
01515 
01516     // needs to be public for gcc 3.4
01517     void GarbageCollection();
01518 
01519 #ifdef OPAL_ZRTP
01520     virtual bool GetZRTPEnabled() const;
01521 #endif
01522 
01523     virtual void OnApplyStringOptions(
01524       OpalConnection & conn,
01525       OpalConnection::StringOptions & stringOptions
01526     );
01527 
01528   protected:
01529     // Configuration variables
01530     OpalProductInfo productInfo;
01531 
01532     PString       defaultUserName;
01533     PString       defaultDisplayName;
01534 
01535     BYTE                     m_defaultMediaTypeOfService;
01536     map<OpalMediaType, BYTE> m_mediaTypeOfService;
01537 
01538     PINDEX        rtpPayloadSizeMax;
01539     PINDEX        rtpPacketSizeMax;
01540     unsigned      minAudioJitterDelay;
01541     unsigned      maxAudioJitterDelay;
01542     PStringArray  mediaFormatOrder;
01543     PStringArray  mediaFormatMask;
01544     PBoolean          disableDetectInBandDTMF;
01545     PTimeInterval noMediaTimeout;
01546     PString       ilsServer;
01547 
01548     OpalSilenceDetector::Params silenceDetectParams;
01549 #if OPAL_AEC
01550     OpalEchoCanceler::Params echoCancelParams;
01551 #endif
01552 
01553 #if OPAL_VIDEO
01554     PVideoDevice::OpenArgs videoInputDevice;
01555     PVideoDevice::OpenArgs videoPreviewDevice;
01556     PVideoDevice::OpenArgs videoOutputDevice;
01557 #endif
01558 
01559     struct PortInfo {
01560       void Set(
01561         unsigned base,
01562         unsigned max,
01563         unsigned range,
01564         unsigned dflt
01565       );
01566       WORD GetNext(
01567         unsigned increment
01568       );
01569 
01570       PMutex mutex;
01571       WORD   base;
01572       WORD   max;
01573       WORD   current;
01574     } tcpPorts, udpPorts, rtpIpPorts;
01575     
01576     class InterfaceMonitor : public PInterfaceMonitorClient
01577     {
01578       PCLASSINFO(InterfaceMonitor, PInterfaceMonitorClient);
01579       
01580       enum {
01581         OpalManagerInterfaceMonitorClientPriority = 100,
01582       };
01583       public:
01584         InterfaceMonitor(OpalManager & manager);
01585         
01586       protected:
01587         virtual void OnAddInterface(const PIPSocket::InterfaceEntry & entry);
01588         virtual void OnRemoveInterface(const PIPSocket::InterfaceEntry & entry);
01589         
01590         OpalManager & m_manager;
01591     };
01592 
01593     PString            translationHost;
01594     PIPSocket::Address translationAddress;
01595     PString            stunServer;
01596     PSTUNClient      * stun;
01597     InterfaceMonitor * interfaceMonitor;
01598 
01599     RouteTable m_routeTable;
01600     PMutex     m_routeMutex;
01601 
01602     // Dynamic variables
01603     PReadWriteMutex     endpointsMutex;
01604     PList<OpalEndPoint> endpointList;
01605     std::map<PString, OpalEndPoint *> endpointMap;
01606 
01607     PAtomicInteger lastCallTokenID;
01608 
01609     class CallDict : public PSafeDictionary<PString, OpalCall>
01610     {
01611       public:
01612         CallDict(OpalManager & mgr) : manager(mgr) { }
01613         virtual void DeleteObject(PObject * object) const;
01614         OpalManager & manager;
01615     } activeCalls;
01616 
01617     PSafeDictionary<PString, OpalPresentity> m_presentities;
01618 
01619     PAtomicInteger m_clearingAllCallsCount;
01620     PMutex         m_clearingAllCallsMutex;
01621     PSyncPoint     m_allCallsCleared;
01622     void InternalClearAllCalls(OpalConnection::CallEndReason reason, bool wait, bool first);
01623 
01624     PThread    * garbageCollector;
01625     PSyncPoint   garbageCollectExit;
01626     bool         garbageCollectSkip;
01627     PDECLARE_NOTIFIER(PThread, OpalManager, GarbageMain);
01628 
01629 #ifdef OPAL_ZRTP
01630     bool zrtpEnabled;
01631 #endif
01632 
01633     friend OpalCall::OpalCall(OpalManager & mgr);
01634     friend void OpalCall::InternalOnClear();
01635 
01636   private:
01637     P_REMOVE_VIRTUAL(OpalCall *,CreateCall(), 0);
01638     P_REMOVE_VIRTUAL(PBoolean, OnIncomingConnection(OpalConnection &, unsigned), false);
01639     P_REMOVE_VIRTUAL(PBoolean, OnIncomingConnection(OpalConnection &), false);
01640     P_REMOVE_VIRTUAL(PBoolean, OnStartMediaPatch(const OpalMediaPatch &), false);
01641     P_REMOVE_VIRTUAL_VOID(AdjustMediaFormats(const OpalConnection &, OpalMediaFormatList &) const);
01642     P_REMOVE_VIRTUAL_VOID(OnMessageReceived(const PURL&,const PString&,const PURL&,const PString&,const PString&,const PString&));
01643 
01644 
01645 #ifdef OPAL_HAS_IM
01646   public:
01647     OpalIMManager & GetIMManager() { return *m_imManager; }
01648 
01649   protected:
01650     OpalIMManager * m_imManager;
01651 #endif
01652 };
01653 
01654 
01655 PString  OpalGetVersion();
01656 unsigned OpalGetMajorVersion();
01657 unsigned OpalGetMinorVersion();
01658 unsigned OpalGetBuildNumber();
01659 
01660 
01661 #endif // OPAL_OPAL_MANAGER_H
01662 
01663 
01664 // End of File ///////////////////////////////////////////////////////////////