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.

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

mercurial