media/webrtc/signaling/src/sipcc/include/ccapi_call.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 #ifndef _CCAPI_CALL_H_
     6 #define _CCAPI_CALL_H_
     8 #if defined(__cplusplus) && __cplusplus >= 201103L
     9 typedef struct Timecard Timecard;
    10 #else
    11 #include "timecard.h"
    12 #endif
    14 #include "ccapi_types.h"
    16 /**
    17  * Get reference to call info
    18  * @param [in] handle - call handle
    19  * @return cc_call_info_snap_t
    20  * NOTE: The info returned by this method must be released using CCAPI_Call_releaseCallInfo()
    21  */
    22 cc_callinfo_ref_t CCAPI_Call_getCallInfo(cc_call_handle_t handle);
    24 /**
    25  * Release the resources held by this call info snapshot
    26  * @param [in] ref - refrence to the call info to be freed
    27  * @return void
    28  */
    29 void CCAPI_Call_releaseCallInfo(cc_callinfo_ref_t ref);
    31 /**
    32  *  Retain the call info reference
    33  *  @param [in] ref - reference to the call info to be retained
    34  *  @return void
    35  *  NOTE: Application that has retained callInfo must call CCAPI_Call_releaseCallInfo()
    36  *  to free memory associated with this Info.
    37  */
    38 void CCAPI_Call_retainCallInfo(cc_callinfo_ref_t ref);
    40 /**
    41  * get the line associated with this call
    42  * @param [in] handle - call handle
    43  * @return cc_lineid_t
    44  */
    45 cc_lineid_t CCAPI_Call_getLine(cc_call_handle_t call_handle);
    47 /**
    48  * Originate call - API to go offhook and dial specified digits on a given call
    49  * @param [in] handle - call handle
    50  * @param [in] video_pref - video direction desired on call
    51  * @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook
    52  * @return SUCCESS or FAILURE
    53  */
    54 cc_return_t CCAPI_Call_originateCall(cc_call_handle_t handle, cc_sdp_direction_t video_pref, cc_string_t digits);
    57 cc_return_t CCAPI_CreateOffer(cc_call_handle_t handle,
    58                               cc_media_constraints_t *constraints,
    59                               Timecard *tc);
    61 cc_return_t CCAPI_CreateAnswer(cc_call_handle_t handle,
    62                                cc_media_constraints_t *constraints,
    63                                Timecard *tc);
    65 cc_return_t CCAPI_SetLocalDescription(cc_call_handle_t handle,
    66                                       cc_jsep_action_t action,
    67                                       cc_string_t sdp,
    68                                       Timecard *tc);
    70 cc_return_t CCAPI_SetRemoteDescription(cc_call_handle_t handle,
    71                                        cc_jsep_action_t action,
    72                                        cc_string_t sdp,
    73                                        Timecard *tc);
    75 cc_return_t CCAPI_SetPeerConnection(cc_call_handle_t handle, cc_peerconnection_t pc);
    77 cc_return_t CCAPI_AddStream(cc_call_handle_t handle,
    78                             cc_media_stream_id_t stream_id,
    79                             cc_media_track_id_t track_id,
    80                             cc_media_type_t media_type,
    81                             cc_media_constraints_t *constraints);
    83 cc_return_t CCAPI_RemoveStream(cc_call_handle_t handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type);
    85 cc_return_t CCAPI_AddICECandidate(cc_call_handle_t handle,
    86                                   cc_string_t candidate,
    87                                   cc_string_t mid,
    88                                   cc_level_t level,
    89                                   Timecard *tc);
    91 /**
    92  * Send digits on the call - can be invoked either to dial additional digits or send DTMF
    93  * @param [in] handle - call handle
    94  * @param [in] digit - digit to be dialed
    95  * @return SUCCESS or FAILURE
    96  */
    97 cc_return_t CCAPI_Call_sendDigit(cc_call_handle_t handle, cc_digit_t digit);
    99 /**
   100  * Send Backspace - Delete last digit dialed.
   101  * @param [in] handle - call handle
   102  * @return SUCCESS or FAILURE
   103  */
   104 cc_return_t CCAPI_Call_backspace(cc_call_handle_t handle);
   106 /**
   107  * Answer Call
   108  * @param [in] handle - call handle
   109  * @param [in] video_pref - video direction desired on call
   110  * @return SUCCESS or FAILURE
   111  */
   112 cc_return_t CCAPI_Call_answerCall(cc_call_handle_t handle, cc_sdp_direction_t video_pref);
   114 /**
   115  * Redial
   116  * @param [in] handle - call handle
   117  * @param [in] video_pref - video direction desired on call
   118  * @return SUCCESS or FAILURE
   119  */
   120 cc_return_t CCAPI_Call_redial(cc_call_handle_t handle, cc_sdp_direction_t video_pref);
   122 /**
   123  * Initiate Call Forward All
   124  * @param [in] handle - call handle
   125  * @return SUCCESS or FAILURE
   126  */
   127 cc_return_t CCAPI_Call_initiateCallForwardAll(cc_call_handle_t handle);
   128 /**
   129  * Hold
   130  * @param [in] handle - call handle
   131  * @param [in] reason - hold reason
   132  * @return SUCCESS or FAILURE
   133  */
   134 cc_return_t CCAPI_Call_hold(cc_call_handle_t handle, cc_hold_reason_t reason);
   136 /**
   137  * Resume
   138  * @param [in] handle - call handle
   139  * @param [in] video_pref - video direction desired on call
   140  * @return SUCCESS or FAILURE
   141  */
   142 cc_return_t CCAPI_Call_resume(cc_call_handle_t handle, cc_sdp_direction_t video_pref) ;
   144 /**
   145  * end Consult leg - used to end consult leg when the user picks active calls list for xfer/conf
   146  * @param [in] handle - call handle
   147  * @return SUCCESS or FAILURE
   148  */
   149 cc_return_t CCAPI_Call_endConsultativeCall(cc_call_handle_t handle);
   151 /**
   152  * end Call
   153  * @param [in] handle - call handle
   154  * @return SUCCESS or FAILURE
   155  */
   156 cc_return_t CCAPI_Call_endCall(cc_call_handle_t handle);
   158 /**
   159  * Initiate a conference
   160  * @param [in] handle - call handle
   161  * @param [in] video_pref - video direction desired on consult call
   162  * @return SUCCESS or FAILURE
   163  */
   164 cc_return_t CCAPI_Call_conferenceStart(cc_call_handle_t handle, cc_sdp_direction_t video_pref);
   166 /**
   167  * complete conference
   168  * @param [in] handle - call handle
   169  * @param [in] phandle - call handle of the other leg
   170  * @param [in] video_pref - video direction desired on consult call
   171  * @return SUCCESS or FAILURE
   172  */
   173 cc_return_t CCAPI_Call_conferenceComplete(cc_call_handle_t handle, cc_call_handle_t phandle,
   174                           cc_sdp_direction_t video_pref);
   176 /**
   177  * start transfer
   178  * @param [in] handle - call handle
   179  * @param [in] video_pref - video direction desired on consult call
   180  * @return SUCCESS or FAILURE
   181  */
   182 cc_return_t CCAPI_Call_transferStart(cc_call_handle_t handle, cc_sdp_direction_t video_pref);
   184 /**
   185  * complete transfer
   186  * @param [in] handle - call handle
   187  * @param [in] phandle - call handle of the other leg
   188  * @param [in] video_pref - video direction desired on consult call
   189  * @return SUCCESS or FAILURE
   190  */
   191 cc_return_t CCAPI_Call_transferComplete(cc_call_handle_t handle, cc_call_handle_t phandle,
   192                           cc_sdp_direction_t video_pref);
   194 /**
   195  * cancel conference or transfer
   196  * @param [in] handle - call handle
   197  * @return SUCCESS or FAILURE
   198  */
   199 cc_return_t CCAPI_Call_cancelTransferOrConferenceFeature(cc_call_handle_t handle);
   201 /**
   202  * direct Transfer
   203  * @param [in] handle - call handle
   204  * @param [in] target - call handle for transfer target call
   205  * @return SUCCESS or FAILURE
   206  */
   207 cc_return_t CCAPI_Call_directTransfer(cc_call_handle_t handle, cc_call_handle_t target);
   209 /**
   210  * Join Across line
   211  * @param [in] handle - call handle
   212  * @param [in] target - join target
   213  * @return SUCCESS or FAILURE
   214  */
   215 cc_return_t CCAPI_Call_joinAcrossLine(cc_call_handle_t handle, cc_call_handle_t target);
   217 /**
   218  * BLF Call Pickup
   219  * @param [in] handle - call handle
   220  * @param [in] video_pref - video direction preference
   221  * @param [in] speed - speedDial Number
   222  * @return SUCCESS or FAILURE
   223  */
   224 cc_return_t CCAPI_Call_blfCallPickup(cc_call_handle_t handle, cc_sdp_direction_t video_pref, cc_string_t speed);
   226 /**
   227  * Select a call
   228  * @param [in] handle - call handle
   229  * @return SUCCESS or FAILURE
   230  */
   231 cc_return_t CCAPI_Call_select(cc_call_handle_t handle);
   233 /**
   234  * Update Video Media Cap for the call
   235  * @param [in] handle - call handle
   236  * @param [in] video_pref - video direction desired on call
   237  * @return SUCCESS or FAILURE
   238  */
   239 cc_return_t CCAPI_Call_updateVideoMediaCap(cc_call_handle_t handle, cc_sdp_direction_t video_pref);
   241 /**
   242  * send INFO method for the call
   243  * @param [in] handle - call handle
   244  * @param [in] infopackage - Info-Package header value
   245  * @param [in] infotype - Content-Type header val
   246  * @param [in] infobody - Body of the INFO message
   247  * @return SUCCESS or FAILURE
   248  */
   249 cc_return_t CCAPI_Call_sendInfo(cc_call_handle_t handle, cc_string_t infopackage, cc_string_t infotype, cc_string_t infobody);
   251 /**
   252  * API to mute/unmute audio
   253  * @param [in] val - TRUE=> mute FALSE => unmute
   254  * @return SUCCESS or FAILURE
   255  * NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   256  * This API doesn't perform the mute operation but simply caches the mute state of the session.
   257  */
   258 cc_return_t CCAPI_Call_setAudioMute(cc_call_handle_t handle, cc_boolean val);
   260 /**
   261  * API to mute/unmute Video
   262  * @param [in] val - TRUE=> mute FALSE => unmute
   263  * @return SUCCESS or FAILURE
   264  * NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume
   265  * This API doesn't perform the mute operation but simply caches the mute state of the session.
   266  */
   267 cc_return_t CCAPI_Call_setVideoMute(cc_call_handle_t handle, cc_boolean val);
   270 #endif // _CCAPI_CALL_H_

mercurial