OPAL Version 3.10.2
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: 26149 $
00028  * $Author: rjongbloed $
00029  * $Date: 2011-07-10 08:08:41 -0500 (Sun, 10 Jul 2011) $
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 
00611     virtual bool OnTransferNotify(
00612       OpalConnection & connection,  
00613       const PStringToString & info  
00614     );
00616 
00617 
00627     virtual OpalMediaFormatList GetCommonMediaFormats(
00628       bool transportable,  
00629       bool pcmAudio        
00630     ) const;
00631 
00641     virtual void AdjustMediaFormats(
00642       bool local,                         
00643       const OpalConnection & connection,  
00644       OpalMediaFormatList & mediaFormats  
00645     ) const;
00646 
00649     virtual PBoolean IsMediaBypassPossible(
00650       const OpalConnection & source,      
00651       const OpalConnection & destination, 
00652       unsigned sessionID                  
00653     ) const;
00654 
00670     virtual PBoolean OnOpenMediaStream(
00671       OpalConnection & connection,  
00672       OpalMediaStream & stream    
00673     );
00674 
00683         virtual RTP_UDP * CreateRTPSession (const RTP_Session::Params & params);
00684 
00692     virtual void OnRTPStatistics(
00693       const OpalConnection & connection,  
00694       const RTP_Session & session         
00695     );
00696 
00713     virtual bool OnLocalRTP(
00714       OpalConnection & connection1, 
00715       OpalConnection & connection2, 
00716       unsigned sessionID,           
00717       bool opened                   
00718     ) const;
00719 
00745     bool SetMediaPassThrough(
00746       const PString & token1, 
00747       const PString & token2, 
00748       bool bypass,            
00749       unsigned sessionID = 0, 
00750       bool network  = true    
00751     );
00752     static bool SetMediaPassThrough(
00753       OpalConnection & connection1, 
00754       OpalConnection & connection2, 
00755       bool bypass,                  
00756       unsigned sessionID = 0        
00757     );
00758 
00763     virtual void OnClosedMediaStream(
00764       const OpalMediaStream & stream     
00765     );
00766 
00767 #if OPAL_VIDEO
00768 
00770     virtual PBoolean CreateVideoInputDevice(
00771       const OpalConnection & connection,    
00772       const OpalMediaFormat & mediaFormat,  
00773       PVideoInputDevice * & device,         
00774       PBoolean & autoDelete                     
00775     );
00776 
00780     virtual PBoolean CreateVideoOutputDevice(
00781       const OpalConnection & connection,    
00782       const OpalMediaFormat & mediaFormat,  
00783       PBoolean preview,                         
00784       PVideoOutputDevice * & device,        
00785       PBoolean & autoDelete                     
00786     );
00787 #endif
00788 
00796     virtual OpalMediaPatch * CreateMediaPatch(
00797       OpalMediaStream & source,         
00798       PBoolean requiresPatchThread = true  
00799     );
00800 
00805     virtual void DestroyMediaPatch(
00806       OpalMediaPatch * patch
00807     );
00808 
00815     virtual void OnStartMediaPatch(
00816       OpalConnection & connection,  
00817       OpalMediaPatch & patch        
00818     );
00819 
00822     virtual void OnStopMediaPatch(
00823       OpalConnection & connection,  
00824       OpalMediaPatch & patch        
00825     );
00827 
00835     virtual void OnUserInputString(
00836       OpalConnection & connection,  
00837       const PString & value         
00838     );
00839 
00846     virtual void OnUserInputTone(
00847       OpalConnection & connection,  
00848       char tone,                    
00849       int duration                  
00850     );
00851 
00854     virtual PString ReadUserInput(
00855       OpalConnection & connection,        
00856       const char * terminators = "#\r\n", 
00857       unsigned lastDigitTimeout = 4,      
00858       unsigned firstDigitTimeout = 30     
00859     );
00861 
00864     enum MessageWaitingType { 
00865       NoMessageWaiting,
00866       VoiceMessageWaiting, 
00867       FaxMessageWaiting,
00868       PagerMessageWaiting,
00869       MultimediaMessageWaiting,
00870       TextMessageWaiting,
00871       NumMessageWaitingTypes
00872     };
00873 
00876     virtual void OnMWIReceived(
00877       const PString & party,    
00878       MessageWaitingType type,  
00879       const PString & extraInfo 
00880     );
00881     
00882     
00883     class RouteEntry : public PObject
00884     {
00885         PCLASSINFO(RouteEntry, PObject);
00886       public:
00887         RouteEntry(const PString & pat, const PString & dest);
00888         void PrintOn(ostream & strm) const;
00889         PString            pattern;
00890         PString            destination;
00891         PRegularExpression regex;
00892     };
00893     PARRAY(RouteTable, RouteEntry);
00894 
01005     virtual PBoolean AddRouteEntry(
01006       const PString & spec  
01007     );
01008 
01015     PBoolean SetRouteTable(
01016       const PStringArray & specs  
01017     );
01018 
01023     void SetRouteTable(
01024       const RouteTable & table  
01025     );
01026 
01029     const RouteTable & GetRouteTable() const { return m_routeTable; }
01030 
01038     virtual PString ApplyRouteTable(
01039       const PString & source,      
01040       const PString & destination, 
01041       PINDEX & entry               
01042     );
01044 
01045 #if OPAL_HAS_MIXER
01046 
01056     virtual PBoolean StartRecording(
01057       const PString & callToken,  
01058       const PFilePath & filename, 
01059       const OpalRecordManager::Options & options = false 
01060     );
01061 
01064     virtual bool IsRecording(
01065       const PString & callToken   
01066     );
01067 
01072     virtual bool StopRecording(
01073       const PString & callToken   
01074     );
01075 
01077 #endif
01078 
01083     const OpalProductInfo & GetProductInfo() const { return productInfo; }
01084 
01087     void SetProductInfo(
01088       const OpalProductInfo & info, 
01089       bool updateAll = true         
01090     );
01091 
01094     const PString & GetDefaultUserName() const { return defaultUserName; }
01095 
01098     void SetDefaultUserName(
01099       const PString & name,   
01100       bool updateAll = true   
01101     );
01102 
01105     const PString & GetDefaultDisplayName() const { return defaultDisplayName; }
01106 
01109     void SetDefaultDisplayName(
01110       const PString & name,   
01111       bool updateAll = true   
01112     );
01113 
01114 #if OPAL_VIDEO
01115 
01116     //
01117     // these functions are deprecated and used only for backwards compatibility
01118     // applications should use OpalConnection::GetAutoStart() to check whether
01119     // a specific media type can be auto-started
01120     //
01121 
01124     bool CanAutoStartReceiveVideo() const { return (OpalMediaType::Video().GetAutoStart()&OpalMediaType::Receive) != 0; }
01125 
01128     void SetAutoStartReceiveVideo(bool can) { OpalMediaType::Video().GetDefinition()->SetAutoStart(OpalMediaType::Receive, can); }
01129 
01132     bool CanAutoStartTransmitVideo() const { return (OpalMediaType::Video().GetAutoStart()&OpalMediaType::Transmit) != 0; }
01133 
01136     void SetAutoStartTransmitVideo(bool can) { OpalMediaType::Video().GetDefinition()->SetAutoStart(OpalMediaType::Transmit, can); }
01137 
01138 #endif
01139 
01146     virtual PBoolean IsLocalAddress(
01147       const PIPSocket::Address & remoteAddress
01148     ) const;
01149 
01167     virtual PBoolean IsRTPNATEnabled(
01168       OpalConnection & connection,            
01169       const PIPSocket::Address & localAddr,   
01170       const PIPSocket::Address & peerAddr,    
01171       const PIPSocket::Address & signalAddr,  
01172       PBoolean incoming                       
01173     );
01174 
01181     virtual PBoolean TranslateIPAddress(
01182       PIPSocket::Address & localAddress,
01183       const PIPSocket::Address & remoteAddress
01184     );
01185 
01188     const PString & GetTranslationHost() const { return translationHost; }
01189 
01192     bool SetTranslationHost(
01193       const PString & host
01194     );
01195 
01198     const PIPSocket::Address & GetTranslationAddress() const { return translationAddress; }
01199 
01202     void SetTranslationAddress(
01203       const PIPSocket::Address & address
01204     );
01205 
01211     virtual PNatMethod * GetNatMethod(
01212       const PIPSocket::Address & remoteAddress = PIPSocket::GetDefaultIpAny()
01213     ) const;
01214 
01219     PSTUNClient::NatTypes SetSTUNServer(
01220       const PString & server
01221     );
01222 
01225     const PString & GetSTUNServer() const { return stunServer; }
01226 
01229     PSTUNClient * GetSTUNClient() const { return stun; }
01230 
01233     WORD GetTCPPortBase() const { return tcpPorts.base; }
01234 
01237     WORD GetTCPPortMax() const { return tcpPorts.max; }
01238 
01241     void SetTCPPorts(unsigned tcpBase, unsigned tcpMax);
01242 
01245     WORD GetNextTCPPort();
01246 
01249     WORD GetUDPPortBase() const { return udpPorts.base; }
01250 
01253     WORD GetUDPPortMax() const { return udpPorts.max; }
01254 
01257     void SetUDPPorts(unsigned udpBase, unsigned udpMax);
01258 
01261     WORD GetNextUDPPort();
01262 
01265     WORD GetRtpIpPortBase() const { return rtpIpPorts.base; }
01266 
01269     WORD GetRtpIpPortMax() const { return rtpIpPorts.max; }
01270 
01273     void SetRtpIpPorts(unsigned udpBase, unsigned udpMax);
01274 
01277     WORD GetRtpIpPortPair();
01278 
01281     BYTE GetMediaTypeOfService() const { return m_defaultMediaTypeOfService; }
01282 
01285     void SetMediaTypeOfService(unsigned tos) { m_defaultMediaTypeOfService = (BYTE)tos; }
01286 
01287     // For backward compatibility
01288     BYTE P_DEPRECATED GetRtpIpTypeofService() const { return m_defaultMediaTypeOfService; }
01289     void P_DEPRECATED SetRtpIpTypeofService(unsigned tos) { m_defaultMediaTypeOfService = (BYTE)tos; }
01290 
01293     BYTE GetMediaTypeOfService(const OpalMediaType & type) const;
01294 
01297     void SetMediaTypeOfService(const OpalMediaType & type, unsigned tos);
01298 
01303     PINDEX GetMaxRtpPayloadSize() const { return rtpPayloadSizeMax; }
01304 
01309     void SetMaxRtpPayloadSize(
01310       PINDEX size,
01311       bool mtu = false
01312     ) { rtpPayloadSizeMax = size - (mtu ? (20+16+12) : 0); }
01313 
01317     PINDEX GetMaxRtpPacketSize() const { return rtpPacketSizeMax; }
01318 
01322     void SetMaxRtpPacketSize(
01323       PINDEX size
01324     ) { rtpPacketSizeMax = size; }
01325 
01329     unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
01330 
01334     unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
01335 
01345     void SetAudioJitterDelay(
01346       unsigned minDelay,   
01347       unsigned maxDelay    
01348     );
01349 
01352     const PStringArray & GetMediaFormatOrder() const { return mediaFormatOrder; }
01353 
01356     void SetMediaFormatOrder(
01357       const PStringArray & order   
01358     );
01359 
01365     const PStringArray & GetMediaFormatMask() const { return mediaFormatMask; }
01366 
01372     void SetMediaFormatMask(
01373       const PStringArray & mask   //< New mask
01374     );
01375 
01378     virtual void SetSilenceDetectParams(
01379       const OpalSilenceDetector::Params & params
01380     ) { silenceDetectParams = params; }
01381 
01384     const OpalSilenceDetector::Params & GetSilenceDetectParams() const { return silenceDetectParams; }
01385     
01386 #if OPAL_AEC
01387 
01389     virtual void SetEchoCancelParams(
01390       const OpalEchoCanceler::Params & params
01391     ) { echoCancelParams = params; }
01392 
01395     const OpalEchoCanceler::Params & GetEchoCancelParams() const { return echoCancelParams; }
01396 #endif
01397 
01398 #if OPAL_VIDEO
01399 
01407     virtual PBoolean SetVideoInputDevice(
01408       const PVideoDevice::OpenArgs & deviceArgs 
01409     );
01410 
01414     const PVideoDevice::OpenArgs & GetVideoInputDevice() const { return videoInputDevice; }
01415 
01423     virtual PBoolean SetVideoPreviewDevice(
01424       const PVideoDevice::OpenArgs & deviceArgs 
01425     );
01426 
01430     const PVideoDevice::OpenArgs & GetVideoPreviewDevice() const { return videoPreviewDevice; }
01431 
01439     virtual PBoolean SetVideoOutputDevice(
01440       const PVideoDevice::OpenArgs & deviceArgs 
01441     );
01442 
01446     const PVideoDevice::OpenArgs & GetVideoOutputDevice() const { return videoOutputDevice; }
01447 
01448 #endif
01449 
01450     PBoolean DetectInBandDTMFDisabled() const
01451       { return disableDetectInBandDTMF; }
01452 
01455     void DisableDetectInBandDTMF(
01456       PBoolean mode 
01457     ) { disableDetectInBandDTMF = mode; } 
01458 
01461     const PTimeInterval & GetNoMediaTimeout() const { return noMediaTimeout; }
01462 
01465     PBoolean SetNoMediaTimeout(
01466       const PTimeInterval & newInterval  
01467     );
01468 
01471     const PString & GetDefaultILSServer() const { return ilsServer; }
01472 
01475     void SetDefaultILSServer(
01476       const PString & server
01477     ) { ilsServer = server; }
01479 
01480     // needs to be public for gcc 3.4
01481     void GarbageCollection();
01482 
01483 #ifdef OPAL_ZRTP
01484     virtual bool GetZRTPEnabled() const;
01485 #endif
01486 
01487     virtual void OnApplyStringOptions(
01488       OpalConnection & conn,
01489       OpalConnection::StringOptions & stringOptions
01490     );
01491 
01492   protected:
01493     // Configuration variables
01494     OpalProductInfo productInfo;
01495 
01496     PString       defaultUserName;
01497     PString       defaultDisplayName;
01498 
01499     BYTE                     m_defaultMediaTypeOfService;
01500     map<OpalMediaType, BYTE> m_mediaTypeOfService;
01501 
01502     PINDEX        rtpPayloadSizeMax;
01503     PINDEX        rtpPacketSizeMax;
01504     unsigned      minAudioJitterDelay;
01505     unsigned      maxAudioJitterDelay;
01506     PStringArray  mediaFormatOrder;
01507     PStringArray  mediaFormatMask;
01508     PBoolean          disableDetectInBandDTMF;
01509     PTimeInterval noMediaTimeout;
01510     PString       ilsServer;
01511 
01512     OpalSilenceDetector::Params silenceDetectParams;
01513 #if OPAL_AEC
01514     OpalEchoCanceler::Params echoCancelParams;
01515 #endif
01516 
01517 #if OPAL_VIDEO
01518     PVideoDevice::OpenArgs videoInputDevice;
01519     PVideoDevice::OpenArgs videoPreviewDevice;
01520     PVideoDevice::OpenArgs videoOutputDevice;
01521 #endif
01522 
01523     struct PortInfo {
01524       void Set(
01525         unsigned base,
01526         unsigned max,
01527         unsigned range,
01528         unsigned dflt
01529       );
01530       WORD GetNext(
01531         unsigned increment
01532       );
01533 
01534       PMutex mutex;
01535       WORD   base;
01536       WORD   max;
01537       WORD   current;
01538     } tcpPorts, udpPorts, rtpIpPorts;
01539     
01540     class InterfaceMonitor : public PInterfaceMonitorClient
01541     {
01542       PCLASSINFO(InterfaceMonitor, PInterfaceMonitorClient);
01543       
01544       enum {
01545         OpalManagerInterfaceMonitorClientPriority = 100,
01546       };
01547       public:
01548         InterfaceMonitor(OpalManager & manager);
01549         
01550       protected:
01551         virtual void OnAddInterface(const PIPSocket::InterfaceEntry & entry);
01552         virtual void OnRemoveInterface(const PIPSocket::InterfaceEntry & entry);
01553         
01554         OpalManager & m_manager;
01555     };
01556 
01557     PString            translationHost;
01558     PIPSocket::Address translationAddress;
01559     PString            stunServer;
01560     PSTUNClient      * stun;
01561     InterfaceMonitor * interfaceMonitor;
01562 
01563     RouteTable m_routeTable;
01564     PMutex     m_routeMutex;
01565 
01566     // Dynamic variables
01567     PReadWriteMutex     endpointsMutex;
01568     PList<OpalEndPoint> endpointList;
01569     std::map<PString, OpalEndPoint *> endpointMap;
01570 
01571     PAtomicInteger lastCallTokenID;
01572 
01573     class CallDict : public PSafeDictionary<PString, OpalCall>
01574     {
01575       public:
01576         CallDict(OpalManager & mgr) : manager(mgr) { }
01577         virtual void DeleteObject(PObject * object) const;
01578         OpalManager & manager;
01579     } activeCalls;
01580 
01581     PSafeDictionary<PString, OpalPresentity> m_presentities;
01582 
01583     PAtomicInteger m_clearingAllCallsCount;
01584     PMutex         m_clearingAllCallsMutex;
01585     PSyncPoint     m_allCallsCleared;
01586     void InternalClearAllCalls(OpalConnection::CallEndReason reason, bool wait, bool first);
01587 
01588     PThread    * garbageCollector;
01589     PSyncPoint   garbageCollectExit;
01590     PDECLARE_NOTIFIER(PThread, OpalManager, GarbageMain);
01591 
01592 #ifdef OPAL_ZRTP
01593     bool zrtpEnabled;
01594 #endif
01595 
01596     friend OpalCall::OpalCall(OpalManager & mgr);
01597     friend void OpalCall::InternalOnClear();
01598 
01599   private:
01600     P_REMOVE_VIRTUAL(OpalCall *,CreateCall(), 0);
01601     P_REMOVE_VIRTUAL(PBoolean, OnIncomingConnection(OpalConnection &, unsigned), false);
01602     P_REMOVE_VIRTUAL(PBoolean, OnIncomingConnection(OpalConnection &), false);
01603     P_REMOVE_VIRTUAL(PBoolean, OnStartMediaPatch(const OpalMediaPatch &), false);
01604     P_REMOVE_VIRTUAL_VOID(AdjustMediaFormats(const OpalConnection &, OpalMediaFormatList &) const);
01605     P_REMOVE_VIRTUAL_VOID(OnMessageReceived(const PURL&,const PString&,const PURL&,const PString&,const PString&,const PString&));
01606 
01607 
01608 #ifdef OPAL_HAS_IM
01609   public:
01610     OpalIMManager & GetIMManager() { return *m_imManager; }
01611 
01612   protected:
01613     OpalIMManager * m_imManager;
01614 #endif
01615 };
01616 
01617 
01618 PString  OpalGetVersion();
01619 unsigned OpalGetMajorVersion();
01620 unsigned OpalGetMinorVersion();
01621 unsigned OpalGetBuildNumber();
01622 
01623 
01624 #endif // OPAL_OPAL_MANAGER_H
01625 
01626 
01627 // End of File ///////////////////////////////////////////////////////////////