1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,101 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef _CC_SIPCC_CALLINFO_H 1.9 +#define _CC_SIPCC_CALLINFO_H 1.10 + 1.11 +#include "CC_CallInfo.h" 1.12 +#include "CC_SIPCCCall.h" 1.13 + 1.14 + 1.15 +#include "common/Wrapper.h" 1.16 + 1.17 +extern "C" { 1.18 + void CCAPI_CallListener_onCallEvent(ccapi_call_event_e eventType, cc_call_handle_t handle, cc_callinfo_ref_t info); 1.19 +} 1.20 + 1.21 +namespace CSF 1.22 +{ 1.23 + 1.24 + DECLARE_NS_PTR(CC_SIPCCCallInfo); 1.25 + class CC_SIPCCCallInfo : public CC_CallInfo 1.26 + { 1.27 + 1.28 + private: 1.29 + cc_callinfo_ref_t callinfo_ref; 1.30 + 1.31 + CC_SIPCCCallInfo (cc_callinfo_ref_t callinfo); 1.32 + 1.33 + CSF_DECLARE_WRAP(CC_SIPCCCallInfo, cc_callinfo_ref_t); 1.34 + 1.35 + CC_SIPCCCallMediaDataPtr pMediaData; 1.36 + 1.37 + public: 1.38 + ~CC_SIPCCCallInfo (); 1.39 + 1.40 + cc_call_state_t getCallState (); 1.41 + fsmdef_states_t getFsmState () const; 1.42 + bool getRingerState(); 1.43 + 1.44 + virtual cc_call_attr_t getCallAttr(); 1.45 + 1.46 + 1.47 + virtual CC_LinePtr getline (); 1.48 + virtual std::string callStateToString (cc_call_state_t state); 1.49 + virtual std::string fsmStateToString (fsmdef_states_t state) const; 1.50 + virtual std::string callEventToString (ccapi_call_event_e callEvent); 1.51 + virtual cc_call_type_t getCallType(); 1.52 + virtual std::string getCalledPartyName(); 1.53 + virtual std::string getCalledPartyNumber(); 1.54 + virtual std::string getCallingPartyName(); 1.55 + virtual std::string getCallingPartyNumber(); 1.56 + virtual std::string getAlternateNumber(); 1.57 + virtual bool hasCapability (CC_CallCapabilityEnum::CC_CallCapability capability); 1.58 + virtual std::set<CC_CallCapabilityEnum::CC_CallCapability> getCapabilitySet(); 1.59 + virtual std::string getOriginalCalledPartyName(); 1.60 + virtual std::string getOriginalCalledPartyNumber(); 1.61 + virtual std::string getLastRedirectingPartyName(); 1.62 + virtual std::string getLastRedirectingPartyNumber(); 1.63 + virtual std::string getPlacedCallPartyName(); 1.64 + virtual std::string getPlacedCallPartyNumber(); 1.65 + virtual cc_int32_t getCallInstance(); 1.66 + virtual std::string getStatus(); 1.67 + virtual cc_call_security_t getSecurity(); 1.68 + virtual cc_int32_t getSelectionStatus(); 1.69 + virtual std::string getGCID(); 1.70 + virtual bool getIsRingOnce(); 1.71 + virtual int getRingerMode(); 1.72 + virtual cc_int32_t getOnhookReason(); 1.73 + virtual bool getIsConference(); 1.74 + virtual std::set<cc_int32_t> getStreamStatistics(); 1.75 + virtual bool isCallSelected(); 1.76 + virtual std::string getINFOPack(); 1.77 + virtual std::string getINFOType(); 1.78 + virtual std::string getINFOBody(); 1.79 + virtual cc_calllog_ref_t getCallLogRef(); 1.80 + virtual cc_sdp_direction_t getVideoDirection(); 1.81 + virtual int getVolume(); 1.82 + virtual bool isMediaStateAvailable(); 1.83 + virtual bool isAudioMuted(); 1.84 + virtual bool isVideoMuted(); 1.85 + virtual std::string getSDP(); 1.86 + virtual std::string getCandidate(); 1.87 + virtual cc_int32_t getStatusCode(); 1.88 + virtual MediaStreamTable* getMediaStreams() const; 1.89 + virtual Timecard *takeTimecard(); 1.90 + 1.91 + virtual void setMediaData(CC_SIPCCCallMediaDataPtr pMediaData); 1.92 + 1.93 + private: 1.94 + // Helper to generate the caps once - then we serve then from this cache. 1.95 + // This is fine because the info object is a snapshot, and there's no use generating this 1.96 + // multiple times if the client makes successive calls to hasCapability(). 1.97 + void generateCapabilities(); 1.98 + std::set<CC_CallCapabilityEnum::CC_CallCapability> caps; 1.99 + bool hasFeature(ccapi_call_capability_e cap); 1.100 + }; 1.101 +}; 1.102 + 1.103 + 1.104 +#endif