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 michael@0: michael@0: extern "C" michael@0: { michael@0: #include "ccapi_types.h" michael@0: #include "fsmdef_states.h" michael@0: } michael@0: michael@0: michael@0: #include "CC_Common.h" michael@0: #include "CC_CallTypes.h" michael@0: #include "peer_connection_types.h" michael@0: michael@0: #if defined(__cplusplus) && __cplusplus >= 201103L michael@0: typedef struct Timecard Timecard; michael@0: #else michael@0: #include "timecard.h" michael@0: #endif michael@0: michael@0: namespace CSF michael@0: { michael@0: michael@0: class ECC_API CC_CallInfo michael@0: { michael@0: public: michael@0: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_CallInfo) michael@0: protected: michael@0: CC_CallInfo() { } michael@0: michael@0: public: michael@0: //Base class needs dtor to be declared as virtual michael@0: virtual ~CC_CallInfo() {}; michael@0: michael@0: /** michael@0: Get the line object associated with this call. michael@0: michael@0: @return CC_LinePtr - line ID michael@0: */ michael@0: virtual CC_LinePtr getline () = 0; michael@0: michael@0: /** michael@0: get Call state michael@0: @param [in] handle - call info handle michael@0: @return call state michael@0: */ michael@0: virtual cc_call_state_t getCallState () = 0; michael@0: michael@0: /** michael@0: get FSM state michael@0: @param [in] handle - call info handle michael@0: @return FSM state michael@0: */ michael@0: virtual fsmdef_states_t getFsmState () const = 0; michael@0: michael@0: /** michael@0: print Call state michael@0: @param [in] handle - call info handle michael@0: @return call state as string michael@0: */ michael@0: virtual std::string callStateToString (cc_call_state_t state) = 0; michael@0: michael@0: /** michael@0: print FSM state michael@0: @param [in] handle - call info handle michael@0: @return call state as string michael@0: */ michael@0: virtual std::string fsmStateToString (fsmdef_states_t state) const = 0; michael@0: michael@0: /** michael@0: print Call event michael@0: @param [in] call event michael@0: @return call event as string michael@0: */ michael@0: virtual std::string callEventToString (ccapi_call_event_e callEvent) = 0; michael@0: michael@0: /** michael@0: Get ringer state. michael@0: michael@0: @return bool ringer state. michael@0: */ michael@0: virtual bool getRingerState() = 0; michael@0: michael@0: /** michael@0: Get call attributes michael@0: michael@0: @return cc_call_attr_t. michael@0: */ michael@0: virtual cc_call_attr_t getCallAttr() = 0; michael@0: michael@0: /** michael@0: Get the call type michael@0: michael@0: @return cc_call_type_t for this call. Supported values inlude: michael@0: CC_CALL_TYPE_INCOMING, CC_CALL_TYPE_OUTGOING and CC_CALL_TYPE_FORWARDED. michael@0: */ michael@0: virtual cc_call_type_t getCallType() = 0; michael@0: michael@0: /** michael@0: Get called party name michael@0: michael@0: @return called party name michael@0: */ michael@0: virtual std::string getCalledPartyName() = 0; michael@0: michael@0: /** michael@0: Get called party number michael@0: michael@0: @return called party number as a string. michael@0: */ michael@0: virtual std::string getCalledPartyNumber() = 0; michael@0: michael@0: /** michael@0: Get calling party name michael@0: michael@0: @return calling party name michael@0: */ michael@0: virtual std::string getCallingPartyName() = 0; michael@0: michael@0: /** michael@0: Get calling party number michael@0: @return calling party number as a string michael@0: Note: this is a const reference to a string that's owned by the michael@0: */ michael@0: virtual std::string getCallingPartyNumber() = 0; michael@0: michael@0: /** michael@0: Get alternate number michael@0: michael@0: @return calling party number as a string. michael@0: */ michael@0: virtual std::string getAlternateNumber() = 0; michael@0: michael@0: /** michael@0: This function is used to check if a given capability is supported michael@0: based on the information in this CC_CallInfo object. michael@0: michael@0: @param [in] capability - the capability that is to be checked for availability. michael@0: @return boolean - returns true if the given capability is available, false otherwise. michael@0: */ michael@0: virtual bool hasCapability (CC_CallCapabilityEnum::CC_CallCapability capability) = 0; michael@0: michael@0: /** michael@0: If you need the complete set of capabilities michael@0: michael@0: @return cc_return_t - set of Call Capabilities. michael@0: */ michael@0: virtual std::set getCapabilitySet() = 0; michael@0: michael@0: /** michael@0: get Original Called party name michael@0: @param [in] handle - call info handle michael@0: @return original called party name michael@0: */ michael@0: virtual std::string getOriginalCalledPartyName() = 0; michael@0: michael@0: /** michael@0: get Original Called party number michael@0: @param [in] handle - call info handle michael@0: @return original called party number michael@0: */ michael@0: virtual std::string getOriginalCalledPartyNumber() = 0; michael@0: michael@0: /** michael@0: get last redirecting party name michael@0: @param [in] handle - call info handle michael@0: @return last redirecting party name michael@0: */ michael@0: virtual std::string getLastRedirectingPartyName() = 0; michael@0: michael@0: /** michael@0: get past redirecting party number michael@0: @param [in] handle - call info handle michael@0: @return last redirecting party number michael@0: */ michael@0: virtual std::string getLastRedirectingPartyNumber() = 0; michael@0: michael@0: /** michael@0: get placed call party name michael@0: @param [in] handle - call info handle michael@0: @return placed party name michael@0: */ michael@0: virtual std::string getPlacedCallPartyName() = 0; michael@0: michael@0: /** michael@0: get placed call party number michael@0: @param [in] handle - call info handle michael@0: @return placed party number michael@0: */ michael@0: virtual std::string getPlacedCallPartyNumber() = 0; michael@0: michael@0: /** michael@0: get call instance number michael@0: @param [in] handle - call info handle michael@0: @return michael@0: */ michael@0: virtual cc_int32_t getCallInstance() = 0; michael@0: michael@0: /** michael@0: get call status prompt michael@0: @param [in] handle - call info handle michael@0: @return call status michael@0: */ michael@0: virtual std::string getStatus() = 0; michael@0: michael@0: /** michael@0: get call security // TODO XLS has callagent security and endtoend security on call? michael@0: @param [in] handle - call info handle michael@0: @return call security status michael@0: */ michael@0: virtual cc_call_security_t getSecurity() = 0; michael@0: michael@0: /** michael@0: get Call Selection Status michael@0: @param [in] handle - call info handle michael@0: @return bool - TRUE => selected michael@0: */ michael@0: virtual cc_int32_t getSelectionStatus() = 0; michael@0: michael@0: /** michael@0: get GCID michael@0: @param [in] handle - call info handle michael@0: @return GCID michael@0: */ michael@0: virtual std::string getGCID() = 0; michael@0: michael@0: /** michael@0: get ringer loop count michael@0: @param handle - call handle michael@0: @return once Vs continuous michael@0: */ michael@0: virtual bool getIsRingOnce() = 0; michael@0: michael@0: /** michael@0: get ringer mode michael@0: @param handle - call handle michael@0: @return ringer mode michael@0: */ michael@0: virtual int getRingerMode() = 0; michael@0: michael@0: /** michael@0: get onhook reason michael@0: @param [in] handle - call info handle michael@0: @return onhook reason michael@0: */ michael@0: virtual cc_int32_t getOnhookReason() = 0; michael@0: michael@0: /** michael@0: is Conference Call? michael@0: @param [in] handle - call info handle michael@0: @return boolean - is Conference michael@0: */ michael@0: virtual bool getIsConference() = 0; michael@0: michael@0: /** michael@0: getStream Statistics michael@0: @param [in] handle - call info handle michael@0: @param [in,out] stats - Array to get the stats michael@0: @param [in,out] count - in len of stats arraysize of stats / out stats copied michael@0: @return cc_return_t - CC_SUCCESS or CC_FAILURE michael@0: */ michael@0: virtual std::set getStreamStatistics() = 0; michael@0: michael@0: /** michael@0: Call selection status michael@0: @param [in] handle - call info handle michael@0: @return bool - selection status michael@0: */ michael@0: virtual bool isCallSelected() = 0; michael@0: michael@0: /** michael@0: INFO Package for RECEIVED_INFO event michael@0: @param [in] handle - call info handle michael@0: @return string - Info package header michael@0: */ michael@0: virtual std::string getINFOPack() = 0; michael@0: michael@0: /** michael@0: INFO type for RECEIVED_INFO event michael@0: michael@0: @return string - content-type header michael@0: */ michael@0: virtual std::string getINFOType() = 0; michael@0: michael@0: /** michael@0: INFO body for RECEIVED_INFO event michael@0: michael@0: @return string - INFO body michael@0: */ michael@0: virtual std::string getINFOBody() = 0; michael@0: michael@0: /** michael@0: Get the call log reference michael@0: michael@0: //TODO NEED TO DO SOMETHING WRAP CALL LOG REF. michael@0: @return string - INFO body michael@0: NOTE: Memory associated with the call log is tied to the michael@0: this would be freed when the callinfo ref is freed. michael@0: */ michael@0: virtual cc_calllog_ref_t getCallLogRef() = 0; michael@0: michael@0: /** michael@0: returns the negotiated video direction for this call michael@0: michael@0: @return cc_sdp_direction_t - video direction michael@0: */ michael@0: virtual cc_sdp_direction_t getVideoDirection() = 0; michael@0: michael@0: /** michael@0: Find out if this call is capable of querying the media state, which includes mute state and video direction michael@0: @return bool michael@0: */ michael@0: virtual bool isMediaStateAvailable() = 0; michael@0: michael@0: /** michael@0: Get the audio mute state if available (check availability with isMediaStateAvailable()) michael@0: @return bool - the current audio state of the call michael@0: */ michael@0: virtual bool isAudioMuted(void) = 0; michael@0: michael@0: /** michael@0: Get the video mute state if available (check availability with isMediaStateAvailable()) michael@0: @return bool - the current video state of the call michael@0: */ michael@0: virtual bool isVideoMuted(void) = 0; michael@0: michael@0: /** michael@0: Get the current call volume level michael@0: @return int - the current call volume level, or -1 if it cannot be determined michael@0: */ michael@0: virtual int getVolume() = 0; michael@0: michael@0: /** michael@0: get SDP from info object returned from JSEP functions michael@0: @param [in] handle - call info handle michael@0: @return SDP string michael@0: */ michael@0: virtual std::string getSDP() = 0; michael@0: michael@0: /** michael@0: get status code michael@0: @param [in] handle - call info handle michael@0: @return code michael@0: */ michael@0: virtual cc_int32_t getStatusCode() = 0; michael@0: michael@0: /** michael@0: get media streams michael@0: @return media stream table michael@0: Note:Ownership of the MediaStreamTable is responsibiliy of michael@0: the caller. michael@0: */ michael@0: virtual MediaStreamTable* getMediaStreams() const = 0; michael@0: michael@0: /** michael@0: Get the current operation's timecard (if any), and assume ownership michael@0: of its memory. michael@0: */ michael@0: virtual Timecard *takeTimecard() = 0; michael@0: michael@0: /** michael@0: Get the latest candidate. michael@0: */ michael@0: virtual std::string getCandidate() = 0; michael@0: }; michael@0: };