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: #include "ECC_Types.h" michael@0: #include "mozilla/RefPtr.h" michael@0: michael@0: extern "C" michael@0: { michael@0: #include "ccapi_types.h" michael@0: } 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: class ECC_API CC_Call michael@0: { michael@0: public: michael@0: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Call) michael@0: michael@0: protected: michael@0: CC_Call () { } michael@0: michael@0: public: michael@0: virtual ~CC_Call () {} michael@0: michael@0: virtual void setRemoteWindow (VideoWindowHandle window) = 0; michael@0: michael@0: virtual int setExternalRenderer(VideoFormat videoFormat, ExternalRendererHandle renderer) = 0; michael@0: michael@0: virtual void sendIFrame () = 0; michael@0: michael@0: virtual CC_CallInfoPtr getCallInfo () = 0; michael@0: michael@0: virtual std::string toString() = 0; michael@0: michael@0: /** michael@0: Originate call - API to go offhook and dial specified digits on a given call michael@0: michael@0: @param [in] video_pref - video direction desired on call michael@0: @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook michael@0: michael@0: @return true or false. michael@0: */ michael@0: virtual bool originateCall (cc_sdp_direction_t video_pref, const std::string & digits) = 0; michael@0: michael@0: /** michael@0: Use this function to answer an incoming call. michael@0: michael@0: @param[in] video_pref - video direction desired on call michael@0: michael@0: @return true or false. michael@0: */ michael@0: virtual bool answerCall (cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: Use this function to put an active call on hold. michael@0: michael@0: @param[in] reason - If the user chooses to put the call on hold then michael@0: CC_HOLD_REASON_NONE should be the value passed in here. michael@0: michael@0: @return true or false. If it's not appropriate to put this call on michael@0: hold at the moment then this function will return false. michael@0: */ michael@0: virtual bool hold (cc_hold_reason_t reason) = 0; michael@0: michael@0: /** michael@0: Use this function to resume a call that is currently on hold. michael@0: michael@0: @param [in] video_pref - video direction desired on call michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool resume (cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: Use this function to end an active call. michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool endCall() = 0; michael@0: michael@0: /** michael@0: Send digits on the call - can be invoked either to dial additional digits or send DTMF michael@0: michael@0: @param [in] digit - digit to be dialed michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool sendDigit (cc_digit_t digit) = 0; michael@0: michael@0: /** michael@0: Send Backspace - Delete last digit dialed. michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool backspace() = 0; michael@0: michael@0: /** michael@0: Redial michael@0: michael@0: @param [in] video_pref - video direction desired on call michael@0: @return true or false michael@0: */ michael@0: virtual bool redial (cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: Initiate Call Forward All michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool initiateCallForwardAll() = 0; michael@0: michael@0: /** michael@0: end Consult leg - used to end consult leg when the user picks active calls list for xfer/conf michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool endConsultativeCall() = 0; michael@0: michael@0: /** michael@0: Initiate a conference michael@0: michael@0: @param [in] video_pref - video direction desired on consult call michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool conferenceStart (cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: complete conference michael@0: michael@0: @param [in] otherCall - CC_CallPtr of the other leg michael@0: @param [in] video_pref - video direction desired on consult call michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool conferenceComplete (CC_CallPtr otherLog, cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: start transfer michael@0: michael@0: @param [in] video_pref - video direction desired on consult call michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool transferStart (cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: complete transfer michael@0: michael@0: @param [in] otherLeg - CC_CallPtr of the other leg michael@0: @param [in] video_pref - video direction desired on consult call michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool transferComplete (CC_CallPtr otherLeg, michael@0: cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: cancel conference or transfer michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool cancelTransferOrConferenceFeature() = 0; michael@0: michael@0: /** michael@0: direct Transfer michael@0: michael@0: @param [in] target - call handle for transfer target call michael@0: @return true or false michael@0: */ michael@0: virtual bool directTransfer (CC_CallPtr target) = 0; michael@0: michael@0: /** michael@0: Join Across line michael@0: michael@0: @param [in] target - join target michael@0: @return true or false michael@0: */ michael@0: virtual bool joinAcrossLine (CC_CallPtr target) = 0; michael@0: michael@0: /** michael@0: BLF Call Pickup michael@0: michael@0: @param [in] video_pref - video direction preference michael@0: @param [in] speed - speedDial Number michael@0: @return true or false michael@0: */ michael@0: virtual bool blfCallPickup (cc_sdp_direction_t video_pref, const std::string & speed) = 0; michael@0: michael@0: /** michael@0: Select a call michael@0: michael@0: @return true or false michael@0: */ michael@0: virtual bool select() = 0; michael@0: michael@0: /** michael@0: Update Video Media Cap for the call michael@0: michael@0: @param [in] video_pref - video direction desired on call michael@0: @return true or false michael@0: */ michael@0: virtual bool updateVideoMediaCap (cc_sdp_direction_t video_pref) = 0; michael@0: michael@0: /** michael@0: send INFO method for the call michael@0: @param [in] handle - call handle michael@0: @param [in] infopackage - Info-Package header value michael@0: @param [in] infotype - Content-Type header val michael@0: @param [in] infobody - Body of the INFO message michael@0: @return true or false michael@0: */ michael@0: virtual bool sendInfo (const std::string & infopackage, const std::string & infotype, const std::string & infobody) = 0; michael@0: michael@0: /** michael@0: API to mute audio michael@0: michael@0: @return true if the operation succeeded michael@0: michael@0: NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. michael@0: */ michael@0: virtual bool muteAudio(void) = 0; michael@0: michael@0: michael@0: /** michael@0: API to unmute audio michael@0: michael@0: @return true if the operation succeeded michael@0: michael@0: NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. michael@0: */ michael@0: virtual bool unmuteAudio(void) = 0; michael@0: /** michael@0: API to mute video michael@0: michael@0: @return true if the operation succeeded michael@0: michael@0: NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. michael@0: */ michael@0: virtual bool muteVideo(void) = 0; michael@0: michael@0: michael@0: /** michael@0: API to unmute video michael@0: michael@0: @return true if the operation succeeded michael@0: michael@0: NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. michael@0: */ michael@0: virtual bool unmuteVideo(void) = 0; michael@0: michael@0: michael@0: /** michael@0: API to set the call volume, acceptable values are 0 - 100 michael@0: @return true if volume set successfully, false if value out of range or change failed michael@0: */ michael@0: virtual bool setVolume(int volume) = 0; michael@0: michael@0: michael@0: /** michael@0: Originate P2P call - API to go offhook and dial specified digits\user on a given call michael@0: michael@0: @param [in] video_pref - video direction desired on call michael@0: @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook michael@0: @param [in] ip address - the ip address of the peer to call michael@0: michael@0: @return void michael@0: */ michael@0: virtual void originateP2PCall (cc_sdp_direction_t video_pref, const std::string & digits, const std::string & ip) = 0; michael@0: michael@0: virtual void createOffer (cc_media_constraints_t* constraints, Timecard *) = 0; michael@0: michael@0: virtual void createAnswer(cc_media_constraints_t* constraints, Timecard *) = 0; michael@0: michael@0: virtual void setLocalDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *) = 0; michael@0: michael@0: virtual void setRemoteDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *) = 0; michael@0: michael@0: virtual void setPeerConnection(const std::string& handle) = 0; michael@0: michael@0: virtual void addStream(cc_media_stream_id_t stream_id, michael@0: cc_media_track_id_t track_id, michael@0: cc_media_type_t media_type, michael@0: cc_media_constraints_t *constraints) = 0; michael@0: michael@0: virtual void removeStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type) = 0; michael@0: michael@0: virtual const std::string& getPeerConnection() const = 0; michael@0: michael@0: virtual void addICECandidate(const std::string & candidate, const std::string & mid, unsigned short level, Timecard *) = 0; michael@0: michael@0: }; michael@0: } michael@0: