media/webrtc/signaling/include/CC_Call.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/signaling/include/CC_Call.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,304 @@
     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 +#pragma once
     1.9 +
    1.10 +#include "CC_Common.h"
    1.11 +#include "ECC_Types.h"
    1.12 +#include "mozilla/RefPtr.h"
    1.13 +
    1.14 +extern "C"
    1.15 +{
    1.16 +#include "ccapi_types.h"
    1.17 +}
    1.18 +
    1.19 +#if defined(__cplusplus) && __cplusplus >= 201103L
    1.20 +typedef struct Timecard Timecard;
    1.21 +#else
    1.22 +#include "timecard.h"
    1.23 +#endif
    1.24 +
    1.25 +namespace CSF
    1.26 +{
    1.27 +    class ECC_API CC_Call
    1.28 +    {
    1.29 +    public:
    1.30 +        NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Call)
    1.31 +
    1.32 +    protected:
    1.33 +        CC_Call () { }
    1.34 +
    1.35 +    public:
    1.36 +        virtual ~CC_Call () {}
    1.37 +
    1.38 +		virtual void setRemoteWindow (VideoWindowHandle window) = 0;
    1.39 +
    1.40 +		virtual int setExternalRenderer(VideoFormat videoFormat, ExternalRendererHandle renderer) = 0;
    1.41 +
    1.42 +		virtual void sendIFrame	() = 0;
    1.43 +
    1.44 +        virtual CC_CallInfoPtr getCallInfo () = 0;
    1.45 +
    1.46 +        virtual std::string toString() = 0;
    1.47 +
    1.48 +        /**
    1.49 +           Originate call - API to go offhook and dial specified digits on a given call
    1.50 +
    1.51 +           @param [in] video_pref - video direction desired on call
    1.52 +           @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook
    1.53 +
    1.54 +           @return true or false.
    1.55 +         */
    1.56 +        virtual bool originateCall (cc_sdp_direction_t video_pref, const std::string & digits) = 0;
    1.57 +
    1.58 +        /**
    1.59 +           Use this function to answer an incoming call.
    1.60 +
    1.61 +           @param[in] video_pref - video direction desired on call
    1.62 +
    1.63 +           @return true or false.
    1.64 +         */
    1.65 +        virtual bool answerCall (cc_sdp_direction_t video_pref) = 0;
    1.66 +
    1.67 +        /**
    1.68 +           Use this function to put an active call on hold.
    1.69 +
    1.70 +           @param[in] reason - If the user chooses to put the call on hold then
    1.71 +                               CC_HOLD_REASON_NONE should be the value passed in here.
    1.72 +
    1.73 +           @return true or false. If it's not appropriate to put this call on
    1.74 +                   hold at the moment then this function will return false.
    1.75 +         */
    1.76 +        virtual bool hold (cc_hold_reason_t reason) = 0;
    1.77 +
    1.78 +        /**
    1.79 +           Use this function to resume a call that is currently on hold.
    1.80 +
    1.81 +           @param [in] video_pref - video direction desired on call
    1.82 +
    1.83 +           @return true or false
    1.84 +         */
    1.85 +        virtual bool resume (cc_sdp_direction_t video_pref) = 0;
    1.86 +
    1.87 +        /**
    1.88 +           Use this function to end an active call.
    1.89 +
    1.90 +           @return true or false
    1.91 +         */
    1.92 +        virtual bool endCall() = 0;
    1.93 +
    1.94 +        /**
    1.95 +           Send digits on the call - can be invoked either to dial additional digits or send DTMF
    1.96 +
    1.97 +           @param [in] digit - digit to be dialed
    1.98 +
    1.99 +           @return true or false
   1.100 +         */
   1.101 +        virtual bool sendDigit (cc_digit_t digit) = 0;
   1.102 +
   1.103 +        /**
   1.104 +           Send Backspace - Delete last digit dialed.
   1.105 +
   1.106 +           @return true or false
   1.107 +         */
   1.108 +        virtual bool backspace() = 0;
   1.109 +
   1.110 +        /**
   1.111 +           Redial
   1.112 +
   1.113 +           @param [in] video_pref - video direction desired on call
   1.114 +           @return true or false
   1.115 +         */
   1.116 +        virtual bool redial (cc_sdp_direction_t video_pref) = 0;
   1.117 +
   1.118 +        /**
   1.119 +           Initiate Call Forward All
   1.120 +
   1.121 +           @return true or false
   1.122 +         */
   1.123 +        virtual bool initiateCallForwardAll() = 0;
   1.124 +
   1.125 +        /**
   1.126 +           end Consult leg - used to end consult leg when the user picks active calls list for xfer/conf
   1.127 +
   1.128 +           @return true or false
   1.129 +         */
   1.130 +        virtual bool endConsultativeCall() = 0;
   1.131 +
   1.132 +        /**
   1.133 +           Initiate a conference
   1.134 +
   1.135 +           @param [in] video_pref - video direction desired on consult call
   1.136 +
   1.137 +           @return true or false
   1.138 +         */
   1.139 +        virtual bool conferenceStart (cc_sdp_direction_t video_pref) = 0;
   1.140 +
   1.141 +        /**
   1.142 +           complete conference
   1.143 +
   1.144 +           @param [in] otherCall - CC_CallPtr of the other leg
   1.145 +           @param [in] video_pref - video direction desired on consult call
   1.146 +
   1.147 +           @return true or false
   1.148 +         */
   1.149 +        virtual bool conferenceComplete (CC_CallPtr otherLog, cc_sdp_direction_t video_pref) = 0;
   1.150 +
   1.151 +        /**
   1.152 +           start transfer
   1.153 +
   1.154 +           @param [in] video_pref - video direction desired on consult call
   1.155 +
   1.156 +           @return true or false
   1.157 +         */
   1.158 +        virtual bool transferStart (cc_sdp_direction_t video_pref) = 0;
   1.159 +
   1.160 +        /**
   1.161 +           complete transfer
   1.162 +
   1.163 +           @param [in] otherLeg - CC_CallPtr of the other leg
   1.164 +           @param [in] video_pref - video direction desired on consult call
   1.165 +
   1.166 +           @return true or false
   1.167 +         */
   1.168 +        virtual bool transferComplete (CC_CallPtr otherLeg,
   1.169 +                                       cc_sdp_direction_t video_pref) = 0;
   1.170 +
   1.171 +        /**
   1.172 +           cancel conference or transfer
   1.173 +
   1.174 +           @return true or false
   1.175 +         */
   1.176 +        virtual bool cancelTransferOrConferenceFeature() = 0;
   1.177 +
   1.178 +        /**
   1.179 +           direct Transfer
   1.180 +
   1.181 +           @param [in] target - call handle for transfer target call
   1.182 +           @return true or false
   1.183 +         */
   1.184 +        virtual bool directTransfer (CC_CallPtr target) = 0;
   1.185 +
   1.186 +        /**
   1.187 +           Join Across line
   1.188 +
   1.189 +           @param [in] target - join target
   1.190 +           @return true or false
   1.191 +         */
   1.192 +        virtual bool joinAcrossLine (CC_CallPtr target) = 0;
   1.193 +
   1.194 +        /**
   1.195 +           BLF Call Pickup
   1.196 +
   1.197 +           @param [in] video_pref - video direction preference
   1.198 +           @param [in] speed - speedDial Number
   1.199 +           @return true or false
   1.200 +         */
   1.201 +        virtual bool blfCallPickup (cc_sdp_direction_t video_pref, const std::string & speed) = 0;
   1.202 +
   1.203 +        /**
   1.204 +           Select a call
   1.205 +
   1.206 +           @return true or false
   1.207 +         */
   1.208 +        virtual bool select() = 0;
   1.209 +
   1.210 +        /**
   1.211 +           Update Video Media Cap for the call
   1.212 +
   1.213 +           @param [in] video_pref - video direction desired on call
   1.214 +           @return true or false
   1.215 +         */
   1.216 +        virtual bool updateVideoMediaCap (cc_sdp_direction_t video_pref) = 0;
   1.217 +
   1.218 +        /**
   1.219 +           send INFO method for the call
   1.220 +           @param [in] handle - call handle
   1.221 +           @param [in] infopackage - Info-Package header value
   1.222 +           @param [in] infotype - Content-Type header val
   1.223 +           @param [in] infobody - Body of the INFO message
   1.224 +           @return true or false
   1.225 +         */
   1.226 +        virtual bool sendInfo (const std::string & infopackage, const std::string & infotype, const std::string & infobody) = 0;
   1.227 +
   1.228 +        /**
   1.229 +           API to mute audio
   1.230 +
   1.231 +           @return true if the operation succeeded
   1.232 +
   1.233 +           NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   1.234 +         */
   1.235 +        virtual bool muteAudio(void) = 0;
   1.236 +
   1.237 +
   1.238 +        /**
   1.239 +           API to unmute audio
   1.240 +
   1.241 +           @return true if the operation succeeded
   1.242 +
   1.243 +           NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   1.244 +         */
   1.245 +        virtual bool unmuteAudio(void) = 0;
   1.246 +        /**
   1.247 +           API to mute video
   1.248 +
   1.249 +           @return true if the operation succeeded
   1.250 +
   1.251 +           NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   1.252 +         */
   1.253 +        virtual bool muteVideo(void) = 0;
   1.254 +
   1.255 +
   1.256 +        /**
   1.257 +           API to unmute video
   1.258 +
   1.259 +           @return true if the operation succeeded
   1.260 +
   1.261 +           NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   1.262 +         */
   1.263 +        virtual bool unmuteVideo(void) = 0;
   1.264 +
   1.265 +
   1.266 +        /**
   1.267 +        API to set the call volume, acceptable values are 0 - 100
   1.268 +        @return true if volume set successfully, false if value out of range or change failed
   1.269 +        */
   1.270 +        virtual bool setVolume(int volume) = 0;
   1.271 +
   1.272 +
   1.273 +        /**
   1.274 +           Originate P2P call - API to go offhook and dial specified digits\user on a given call
   1.275 +
   1.276 +           @param [in] video_pref - video direction desired on call
   1.277 +           @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook
   1.278 +           @param [in] ip address - the ip address of the peer to call
   1.279 +
   1.280 +           @return void
   1.281 +          */
   1.282 +        virtual void originateP2PCall (cc_sdp_direction_t video_pref, const std::string & digits, const std::string & ip) = 0;
   1.283 +
   1.284 +        virtual void createOffer (cc_media_constraints_t* constraints, Timecard *) = 0;
   1.285 +
   1.286 +        virtual void createAnswer(cc_media_constraints_t* constraints, Timecard *) = 0;
   1.287 +
   1.288 +        virtual void setLocalDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *) = 0;
   1.289 +
   1.290 +        virtual void setRemoteDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *) = 0;
   1.291 +
   1.292 +        virtual void setPeerConnection(const std::string& handle) = 0;
   1.293 +
   1.294 +        virtual void addStream(cc_media_stream_id_t stream_id,
   1.295 +                               cc_media_track_id_t track_id,
   1.296 +                               cc_media_type_t media_type,
   1.297 +                               cc_media_constraints_t *constraints) = 0;
   1.298 +
   1.299 +        virtual void removeStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type) = 0;
   1.300 +
   1.301 +        virtual const std::string& getPeerConnection() const = 0;
   1.302 +
   1.303 +        virtual void addICECandidate(const std::string & candidate, const std::string & mid, unsigned short level, Timecard *) = 0;
   1.304 +
   1.305 +    };
   1.306 +}
   1.307 +

mercurial