michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #pragma once michael@0: michael@0: #include "CC_Common.h" michael@0: michael@0: #include "CC_Observer.h" michael@0: #include "ECC_Observer.h" michael@0: #include "ECC_Types.h" michael@0: michael@0: #include michael@0: #include michael@0: michael@0: /** michael@0: * @mainpage Enhanced Call Control michael@0: * michael@0: * @section intro_sec Introduction michael@0: * This wraps and aggregates the SIPCC and CTI call control stacks, media stacks, and various additional michael@0: * components and glue necessary to start, configure and run them, and presents a high-level C++ API michael@0: * for connection, device selection and status, and call control. michael@0: * michael@0: * @section main_outline Outline michael@0: * @li The main entry point is CSF::CallControlManager, which is used to configure and start a michael@0: * call control stack. michael@0: * @li Configuration and events are raised to the CSF::ECC_Observer interface. michael@0: * @li Call Control is performed via CSF::CC_Device, CSF::CC_Line and CSF::CC_Call. michael@0: * @li Call Control events are raised to the CSF::CC_Observer interface. michael@0: * @li Audio/Video device selection and global media configuration is performed via CSF::AudioControl michael@0: * and CSF::VideoControl. Per-call media operations (mute, volume, etc) are integrated onto michael@0: * the CSF::CC_Call and CSF::CC_CallInfo interfaces. michael@0: */ michael@0: michael@0: namespace CSF michael@0: { michael@0: DECLARE_NS_PTR(CallControlManager) michael@0: /** michael@0: * CallControlManager michael@0: * michael@0: * The class is partitioned into several blocks of functionality: michael@0: * - Create/Destroy - Initialisation and clean shutdown. michael@0: * Destroy is optional if the destructor is used properly. michael@0: * - Observer - Register for events when any state changes. Optional but strongly advised. michael@0: * michael@0: * Methods are generally synchronous (at present). michael@0: */ michael@0: class ECC_API CallControlManager michael@0: { michael@0: public: michael@0: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CallControlManager) michael@0: /** michael@0: * Use create() to create a CallControlManager instance. michael@0: * michael@0: * CallControlManager cleans up its resources in its destructor, implicitly disconnect()in if required. michael@0: * Use the destroy() method if you need to force a cleanup earlier. It is a bad idea to continue using michael@0: * CallControlManager or any of its related objects after destroy(). michael@0: */ michael@0: static CallControlManagerPtr create(); michael@0: virtual bool destroy() = 0; michael@0: michael@0: virtual ~CallControlManager(); michael@0: michael@0: /** michael@0: CC_Observer is for core call control events (on CC_Device, CC_Line and CC_Call). michael@0: ECC_Observer is for "value add" features of CallControlManager. michael@0: michael@0: Client can add multiple observers if they have different Observer objects that handle michael@0: different event scenarios, but generally it's probably sufficient to only register one observer. michael@0: michael@0: @param[in] observer - This is a pointer to a CC_Observer-derived class that the client michael@0: must instantiate to receive notifications on this client object. michael@0: */ michael@0: virtual void addCCObserver ( CC_Observer * observer ) = 0; michael@0: virtual void removeCCObserver ( CC_Observer * observer ) = 0; michael@0: michael@0: virtual void addECCObserver ( ECC_Observer * observer ) = 0; michael@0: virtual void removeECCObserver ( ECC_Observer * observer ) = 0; michael@0: michael@0: virtual void setMultiClusterMode(bool allowMultipleClusters) = 0; michael@0: virtual void setSIPCCLoggingMask(const cc_int32_t mask) = 0; michael@0: virtual void setAuthenticationString(const std::string &authString) = 0; michael@0: virtual void setSecureCachePath(const std::string &secureCachePath) = 0; michael@0: michael@0: // Add local codecs michael@0: virtual void setAudioCodecs(int codecMask) = 0; michael@0: virtual void setVideoCodecs(int codecMask) = 0; michael@0: michael@0: virtual bool registerUser(const std::string& deviceName, const std::string& user, const std::string& password, const std::string& domain) = 0; michael@0: virtual bool disconnect() = 0; michael@0: virtual std::string getPreferredDeviceName() = 0; michael@0: virtual std::string getPreferredLineDN() = 0; michael@0: virtual ConnectionStatusEnum::ConnectionStatus getConnectionStatus() = 0; michael@0: virtual std::string getCurrentServer() = 0; michael@0: michael@0: /* P2P MODE */ michael@0: virtual bool startP2PMode(const std::string& user) = 0; michael@0: michael@0: /* SDP MODE */ michael@0: virtual bool startSDPMode() = 0; michael@0: michael@0: /** michael@0: * Obtain the device object, from which call control can be done. michael@0: * getAvailablePhoneDetails lists all known devices which the user is likely to be able to control. michael@0: */ michael@0: virtual CC_DevicePtr getActiveDevice() = 0; michael@0: virtual PhoneDetailsVtrPtr getAvailablePhoneDetails() = 0; michael@0: virtual PhoneDetailsPtr getAvailablePhoneDetails(const std::string& deviceName) = 0; michael@0: michael@0: /** michael@0: * Obtain the audio/video object, from which video setup can be done. michael@0: * This relates to global tuning, device selection, preview window positioning, etc, not to michael@0: * per-call settings or control. michael@0: * michael@0: * These objects are unavailable except while in softphone mode. michael@0: */ michael@0: virtual VideoControlPtr getVideoControl() = 0; michael@0: virtual AudioControlPtr getAudioControl() = 0; michael@0: michael@0: virtual bool setProperty(ConfigPropertyKeysEnum::ConfigPropertyKeys key, std::string& value) = 0; michael@0: virtual std::string getProperty(ConfigPropertyKeysEnum::ConfigPropertyKeys key) = 0; michael@0: michael@0: protected: michael@0: CallControlManager() {} michael@0: private: michael@0: CallControlManager(const CallControlManager&); michael@0: CallControlManager& operator=(const CallControlManager&); michael@0: }; michael@0: } //end namespace CSF