media/webrtc/signaling/include/CC_CallInfo.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #pragma once
michael@0 6
michael@0 7 #include <set>
michael@0 8
michael@0 9 extern "C"
michael@0 10 {
michael@0 11 #include "ccapi_types.h"
michael@0 12 #include "fsmdef_states.h"
michael@0 13 }
michael@0 14
michael@0 15
michael@0 16 #include "CC_Common.h"
michael@0 17 #include "CC_CallTypes.h"
michael@0 18 #include "peer_connection_types.h"
michael@0 19
michael@0 20 #if defined(__cplusplus) && __cplusplus >= 201103L
michael@0 21 typedef struct Timecard Timecard;
michael@0 22 #else
michael@0 23 #include "timecard.h"
michael@0 24 #endif
michael@0 25
michael@0 26 namespace CSF
michael@0 27 {
michael@0 28
michael@0 29 class ECC_API CC_CallInfo
michael@0 30 {
michael@0 31 public:
michael@0 32 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_CallInfo)
michael@0 33 protected:
michael@0 34 CC_CallInfo() { }
michael@0 35
michael@0 36 public:
michael@0 37 //Base class needs dtor to be declared as virtual
michael@0 38 virtual ~CC_CallInfo() {};
michael@0 39
michael@0 40 /**
michael@0 41 Get the line object associated with this call.
michael@0 42
michael@0 43 @return CC_LinePtr - line ID
michael@0 44 */
michael@0 45 virtual CC_LinePtr getline () = 0;
michael@0 46
michael@0 47 /**
michael@0 48 get Call state
michael@0 49 @param [in] handle - call info handle
michael@0 50 @return call state
michael@0 51 */
michael@0 52 virtual cc_call_state_t getCallState () = 0;
michael@0 53
michael@0 54 /**
michael@0 55 get FSM state
michael@0 56 @param [in] handle - call info handle
michael@0 57 @return FSM state
michael@0 58 */
michael@0 59 virtual fsmdef_states_t getFsmState () const = 0;
michael@0 60
michael@0 61 /**
michael@0 62 print Call state
michael@0 63 @param [in] handle - call info handle
michael@0 64 @return call state as string
michael@0 65 */
michael@0 66 virtual std::string callStateToString (cc_call_state_t state) = 0;
michael@0 67
michael@0 68 /**
michael@0 69 print FSM state
michael@0 70 @param [in] handle - call info handle
michael@0 71 @return call state as string
michael@0 72 */
michael@0 73 virtual std::string fsmStateToString (fsmdef_states_t state) const = 0;
michael@0 74
michael@0 75 /**
michael@0 76 print Call event
michael@0 77 @param [in] call event
michael@0 78 @return call event as string
michael@0 79 */
michael@0 80 virtual std::string callEventToString (ccapi_call_event_e callEvent) = 0;
michael@0 81
michael@0 82 /**
michael@0 83 Get ringer state.
michael@0 84
michael@0 85 @return bool ringer state.
michael@0 86 */
michael@0 87 virtual bool getRingerState() = 0;
michael@0 88
michael@0 89 /**
michael@0 90 Get call attributes
michael@0 91
michael@0 92 @return cc_call_attr_t.
michael@0 93 */
michael@0 94 virtual cc_call_attr_t getCallAttr() = 0;
michael@0 95
michael@0 96 /**
michael@0 97 Get the call type
michael@0 98
michael@0 99 @return cc_call_type_t for this call. Supported values inlude:
michael@0 100 CC_CALL_TYPE_INCOMING, CC_CALL_TYPE_OUTGOING and CC_CALL_TYPE_FORWARDED.
michael@0 101 */
michael@0 102 virtual cc_call_type_t getCallType() = 0;
michael@0 103
michael@0 104 /**
michael@0 105 Get called party name
michael@0 106
michael@0 107 @return called party name
michael@0 108 */
michael@0 109 virtual std::string getCalledPartyName() = 0;
michael@0 110
michael@0 111 /**
michael@0 112 Get called party number
michael@0 113
michael@0 114 @return called party number as a string.
michael@0 115 */
michael@0 116 virtual std::string getCalledPartyNumber() = 0;
michael@0 117
michael@0 118 /**
michael@0 119 Get calling party name
michael@0 120
michael@0 121 @return calling party name
michael@0 122 */
michael@0 123 virtual std::string getCallingPartyName() = 0;
michael@0 124
michael@0 125 /**
michael@0 126 Get calling party number
michael@0 127 @return calling party number as a string
michael@0 128 Note: this is a const reference to a string that's owned by the
michael@0 129 */
michael@0 130 virtual std::string getCallingPartyNumber() = 0;
michael@0 131
michael@0 132 /**
michael@0 133 Get alternate number
michael@0 134
michael@0 135 @return calling party number as a string.
michael@0 136 */
michael@0 137 virtual std::string getAlternateNumber() = 0;
michael@0 138
michael@0 139 /**
michael@0 140 This function is used to check if a given capability is supported
michael@0 141 based on the information in this CC_CallInfo object.
michael@0 142
michael@0 143 @param [in] capability - the capability that is to be checked for availability.
michael@0 144 @return boolean - returns true if the given capability is available, false otherwise.
michael@0 145 */
michael@0 146 virtual bool hasCapability (CC_CallCapabilityEnum::CC_CallCapability capability) = 0;
michael@0 147
michael@0 148 /**
michael@0 149 If you need the complete set of capabilities
michael@0 150
michael@0 151 @return cc_return_t - set of Call Capabilities.
michael@0 152 */
michael@0 153 virtual std::set<CC_CallCapabilityEnum::CC_CallCapability> getCapabilitySet() = 0;
michael@0 154
michael@0 155 /**
michael@0 156 get Original Called party name
michael@0 157 @param [in] handle - call info handle
michael@0 158 @return original called party name
michael@0 159 */
michael@0 160 virtual std::string getOriginalCalledPartyName() = 0;
michael@0 161
michael@0 162 /**
michael@0 163 get Original Called party number
michael@0 164 @param [in] handle - call info handle
michael@0 165 @return original called party number
michael@0 166 */
michael@0 167 virtual std::string getOriginalCalledPartyNumber() = 0;
michael@0 168
michael@0 169 /**
michael@0 170 get last redirecting party name
michael@0 171 @param [in] handle - call info handle
michael@0 172 @return last redirecting party name
michael@0 173 */
michael@0 174 virtual std::string getLastRedirectingPartyName() = 0;
michael@0 175
michael@0 176 /**
michael@0 177 get past redirecting party number
michael@0 178 @param [in] handle - call info handle
michael@0 179 @return last redirecting party number
michael@0 180 */
michael@0 181 virtual std::string getLastRedirectingPartyNumber() = 0;
michael@0 182
michael@0 183 /**
michael@0 184 get placed call party name
michael@0 185 @param [in] handle - call info handle
michael@0 186 @return placed party name
michael@0 187 */
michael@0 188 virtual std::string getPlacedCallPartyName() = 0;
michael@0 189
michael@0 190 /**
michael@0 191 get placed call party number
michael@0 192 @param [in] handle - call info handle
michael@0 193 @return placed party number
michael@0 194 */
michael@0 195 virtual std::string getPlacedCallPartyNumber() = 0;
michael@0 196
michael@0 197 /**
michael@0 198 get call instance number
michael@0 199 @param [in] handle - call info handle
michael@0 200 @return
michael@0 201 */
michael@0 202 virtual cc_int32_t getCallInstance() = 0;
michael@0 203
michael@0 204 /**
michael@0 205 get call status prompt
michael@0 206 @param [in] handle - call info handle
michael@0 207 @return call status
michael@0 208 */
michael@0 209 virtual std::string getStatus() = 0;
michael@0 210
michael@0 211 /**
michael@0 212 get call security // TODO XLS has callagent security and endtoend security on call?
michael@0 213 @param [in] handle - call info handle
michael@0 214 @return call security status
michael@0 215 */
michael@0 216 virtual cc_call_security_t getSecurity() = 0;
michael@0 217
michael@0 218 /**
michael@0 219 get Call Selection Status
michael@0 220 @param [in] handle - call info handle
michael@0 221 @return bool - TRUE => selected
michael@0 222 */
michael@0 223 virtual cc_int32_t getSelectionStatus() = 0;
michael@0 224
michael@0 225 /**
michael@0 226 get GCID
michael@0 227 @param [in] handle - call info handle
michael@0 228 @return GCID
michael@0 229 */
michael@0 230 virtual std::string getGCID() = 0;
michael@0 231
michael@0 232 /**
michael@0 233 get ringer loop count
michael@0 234 @param handle - call handle
michael@0 235 @return once Vs continuous
michael@0 236 */
michael@0 237 virtual bool getIsRingOnce() = 0;
michael@0 238
michael@0 239 /**
michael@0 240 get ringer mode
michael@0 241 @param handle - call handle
michael@0 242 @return ringer mode
michael@0 243 */
michael@0 244 virtual int getRingerMode() = 0;
michael@0 245
michael@0 246 /**
michael@0 247 get onhook reason
michael@0 248 @param [in] handle - call info handle
michael@0 249 @return onhook reason
michael@0 250 */
michael@0 251 virtual cc_int32_t getOnhookReason() = 0;
michael@0 252
michael@0 253 /**
michael@0 254 is Conference Call?
michael@0 255 @param [in] handle - call info handle
michael@0 256 @return boolean - is Conference
michael@0 257 */
michael@0 258 virtual bool getIsConference() = 0;
michael@0 259
michael@0 260 /**
michael@0 261 getStream Statistics
michael@0 262 @param [in] handle - call info handle
michael@0 263 @param [in,out] stats - Array to get the stats
michael@0 264 @param [in,out] count - in len of stats arraysize of stats / out stats copied
michael@0 265 @return cc_return_t - CC_SUCCESS or CC_FAILURE
michael@0 266 */
michael@0 267 virtual std::set<cc_int32_t> getStreamStatistics() = 0;
michael@0 268
michael@0 269 /**
michael@0 270 Call selection status
michael@0 271 @param [in] handle - call info handle
michael@0 272 @return bool - selection status
michael@0 273 */
michael@0 274 virtual bool isCallSelected() = 0;
michael@0 275
michael@0 276 /**
michael@0 277 INFO Package for RECEIVED_INFO event
michael@0 278 @param [in] handle - call info handle
michael@0 279 @return string - Info package header
michael@0 280 */
michael@0 281 virtual std::string getINFOPack() = 0;
michael@0 282
michael@0 283 /**
michael@0 284 INFO type for RECEIVED_INFO event
michael@0 285
michael@0 286 @return string - content-type header
michael@0 287 */
michael@0 288 virtual std::string getINFOType() = 0;
michael@0 289
michael@0 290 /**
michael@0 291 INFO body for RECEIVED_INFO event
michael@0 292
michael@0 293 @return string - INFO body
michael@0 294 */
michael@0 295 virtual std::string getINFOBody() = 0;
michael@0 296
michael@0 297 /**
michael@0 298 Get the call log reference
michael@0 299
michael@0 300 //TODO NEED TO DO SOMETHING WRAP CALL LOG REF.
michael@0 301 @return string - INFO body
michael@0 302 NOTE: Memory associated with the call log is tied to the
michael@0 303 this would be freed when the callinfo ref is freed.
michael@0 304 */
michael@0 305 virtual cc_calllog_ref_t getCallLogRef() = 0;
michael@0 306
michael@0 307 /**
michael@0 308 returns the negotiated video direction for this call
michael@0 309
michael@0 310 @return cc_sdp_direction_t - video direction
michael@0 311 */
michael@0 312 virtual cc_sdp_direction_t getVideoDirection() = 0;
michael@0 313
michael@0 314 /**
michael@0 315 Find out if this call is capable of querying the media state, which includes mute state and video direction
michael@0 316 @return bool
michael@0 317 */
michael@0 318 virtual bool isMediaStateAvailable() = 0;
michael@0 319
michael@0 320 /**
michael@0 321 Get the audio mute state if available (check availability with isMediaStateAvailable())
michael@0 322 @return bool - the current audio state of the call
michael@0 323 */
michael@0 324 virtual bool isAudioMuted(void) = 0;
michael@0 325
michael@0 326 /**
michael@0 327 Get the video mute state if available (check availability with isMediaStateAvailable())
michael@0 328 @return bool - the current video state of the call
michael@0 329 */
michael@0 330 virtual bool isVideoMuted(void) = 0;
michael@0 331
michael@0 332 /**
michael@0 333 Get the current call volume level
michael@0 334 @return int - the current call volume level, or -1 if it cannot be determined
michael@0 335 */
michael@0 336 virtual int getVolume() = 0;
michael@0 337
michael@0 338 /**
michael@0 339 get SDP from info object returned from JSEP functions
michael@0 340 @param [in] handle - call info handle
michael@0 341 @return SDP string
michael@0 342 */
michael@0 343 virtual std::string getSDP() = 0;
michael@0 344
michael@0 345 /**
michael@0 346 get status code
michael@0 347 @param [in] handle - call info handle
michael@0 348 @return code
michael@0 349 */
michael@0 350 virtual cc_int32_t getStatusCode() = 0;
michael@0 351
michael@0 352 /**
michael@0 353 get media streams
michael@0 354 @return media stream table
michael@0 355 Note:Ownership of the MediaStreamTable is responsibiliy of
michael@0 356 the caller.
michael@0 357 */
michael@0 358 virtual MediaStreamTable* getMediaStreams() const = 0;
michael@0 359
michael@0 360 /**
michael@0 361 Get the current operation's timecard (if any), and assume ownership
michael@0 362 of its memory.
michael@0 363 */
michael@0 364 virtual Timecard *takeTimecard() = 0;
michael@0 365
michael@0 366 /**
michael@0 367 Get the latest candidate.
michael@0 368 */
michael@0 369 virtual std::string getCandidate() = 0;
michael@0 370 };
michael@0 371 };

mercurial