Thu, 15 Jan 2015 15:59:08 +0100
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 | /** |
michael@0 | 6 | * @mainpage Portable SIP Stack API |
michael@0 | 7 | * |
michael@0 | 8 | * @section intro_sec Introduction |
michael@0 | 9 | * The portable SIP stack is used in multiple SIP endpoints. This document |
michael@0 | 10 | * describes the API's provided by the portable SIP stack that third party |
michael@0 | 11 | * vendors must implement to use the stack. |
michael@0 | 12 | * |
michael@0 | 13 | * |
michael@0 | 14 | * @section sub_sec Functionality |
michael@0 | 15 | * The SIP stack can be viewed as composed of different components each |
michael@0 | 16 | * dealing with a specific functionality. |
michael@0 | 17 | * functional modules in SIP stack |
michael@0 | 18 | * |
michael@0 | 19 | * @subsection Management Management |
michael@0 | 20 | * This section covers the API that deals with managing the sip stack |
michael@0 | 21 | * initialization, shutdown and state management. |
michael@0 | 22 | * @li cc_types.h @par |
michael@0 | 23 | * Type definitions used by SIP stack |
michael@0 | 24 | * @li cc_constants.h @par |
michael@0 | 25 | * Constant definitions used by call control |
michael@0 | 26 | * @li cc_config.h @par |
michael@0 | 27 | * This section covers API to set config data for the SIP stack |
michael@0 | 28 | * @li cc_service.h @par |
michael@0 | 29 | * Commands to initialize, restart, shutdown sipstack |
michael@0 | 30 | * @li cc_service_listener.h @par |
michael@0 | 31 | * Callbacks from SIP stack for SIP stack and registration status updates |
michael@0 | 32 | * |
michael@0 | 33 | * @subsection cf Call Features |
michael@0 | 34 | * Call Control features and calls related APIs |
michael@0 | 35 | * @li cc_call_feature.h @par |
michael@0 | 36 | * APIs to create/terminate calls and invoke call features on them |
michael@0 | 37 | * @li cc_call_listener.h @par |
michael@0 | 38 | * Callbacks for call states and call related data updates |
michael@0 | 39 | * @li cc_info.h @par |
michael@0 | 40 | * API to send a SIP INFO info Message in the context of a call |
michael@0 | 41 | * @li cc_info_listener.h @par |
michael@0 | 42 | * Callback on receipt of SIP INFO Message in the context of a call |
michael@0 | 43 | * |
michael@0 | 44 | * @subsection df Device Features |
michael@0 | 45 | * Device based features related APIs |
michael@0 | 46 | * @li cc_device_feature.h @par |
michael@0 | 47 | * APIs to invoke device specific features |
michael@0 | 48 | * @li cc_device_listener.h @par |
michael@0 | 49 | * Callbacks for device specific feature/data updates |
michael@0 | 50 | * |
michael@0 | 51 | * @subsection blf BLF APIs |
michael@0 | 52 | * This covers Busy Lamp Field subscription and state notifications |
michael@0 | 53 | * @li cc_blf.h @par |
michael@0 | 54 | * BLF subscription and unsubscription APIs |
michael@0 | 55 | * @li cc_blf_listener.h @par |
michael@0 | 56 | * BLF state change notification call backs |
michael@0 | 57 | * |
michael@0 | 58 | * @subsection vcm Media APIs |
michael@0 | 59 | * Media related APIs |
michael@0 | 60 | * @li vcm.h @par |
michael@0 | 61 | * This file contains API that interface to the media layer on the platform. |
michael@0 | 62 | * The following APIs need to be implemented to have the sip stack interact |
michael@0 | 63 | * and issue commands to the media layer. |
michael@0 | 64 | * @li ccsdp.h @par |
michael@0 | 65 | * Contains helper methods to peek and set video SDP attributes as the SDP negotiation for m lines needs |
michael@0 | 66 | * to be confirmed by the application after examining the SDP attributes. See vcmCheckAttribs and |
michael@0 | 67 | * vcmPopulateAttribs methods in vcm.h |
michael@0 | 68 | * |
michael@0 | 69 | * @subsection xml XML |
michael@0 | 70 | * This section covers the XML Parser API that are invoked by the SIP stack to parse and encode XML bodies |
michael@0 | 71 | * @li xml_parser.h @par |
michael@0 | 72 | * Methods to be implemented by platform for XML enoced and decode operations |
michael@0 | 73 | * @li xml_parser_defines.h @par |
michael@0 | 74 | * Type definitons and data structures used by the XML APIs |
michael@0 | 75 | * |
michael@0 | 76 | * @subsection util Utilities |
michael@0 | 77 | * Misc utilities |
michael@0 | 78 | * @li sll_lite.h @par |
michael@0 | 79 | * Simple linked list implementation bundled with SIP stack to be used in xml_parser apis |
michael@0 | 80 | * @li dns_util.h @par |
michael@0 | 81 | * DNS query methods to be implemented by the platform code |
michael@0 | 82 | * @li plat_api.h @par |
michael@0 | 83 | * APIs that must be implemented by the platform for platform specific functionality |
michael@0 | 84 | * |
michael@0 | 85 | */ |
michael@0 | 86 | |
michael@0 | 87 | #ifndef _CC_CALL_FEATURE_H_ |
michael@0 | 88 | #define _CC_CALL_FEATURE_H_ |
michael@0 | 89 | |
michael@0 | 90 | #if defined(__cplusplus) && __cplusplus >= 201103L |
michael@0 | 91 | typedef struct Timecard Timecard; |
michael@0 | 92 | #else |
michael@0 | 93 | #include "timecard.h" |
michael@0 | 94 | #endif |
michael@0 | 95 | |
michael@0 | 96 | #include "cc_constants.h" |
michael@0 | 97 | |
michael@0 | 98 | /***********************************Basic Call Feature Control Methods************************************ |
michael@0 | 99 | * This section defines all the call related methods that an upper layer can use to control |
michael@0 | 100 | * a call in progress. |
michael@0 | 101 | */ |
michael@0 | 102 | |
michael@0 | 103 | /** |
michael@0 | 104 | * Used to create any outgoing call regular call. The incoming/reverting/consultation call will be |
michael@0 | 105 | * created by the stack. It creates a call place holder and initialize the memory for a call. An user needs |
michael@0 | 106 | * other methods to start the call, such as the method OriginateCall, etc |
michael@0 | 107 | * @param line line number that is invoked and is assigned |
michael@0 | 108 | * @return call handle wich includes the assigned line and call id |
michael@0 | 109 | */ |
michael@0 | 110 | cc_call_handle_t CC_createCall(cc_lineid_t line); |
michael@0 | 111 | |
michael@0 | 112 | /** |
michael@0 | 113 | * Start the call that was created. |
michael@0 | 114 | * @param call_handle the call handle |
michael@0 | 115 | * @param video_pref the sdp direction |
michael@0 | 116 | * @return SUCCESS or FAILURE |
michael@0 | 117 | */ |
michael@0 | 118 | /*move it up...*/ |
michael@0 | 119 | cc_return_t CC_CallFeature_originateCall(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref); |
michael@0 | 120 | |
michael@0 | 121 | /** |
michael@0 | 122 | * Terminate or end a normal call. |
michael@0 | 123 | * @param call_handle call handle |
michael@0 | 124 | * @return SUCCESS or FAILURE |
michael@0 | 125 | */ |
michael@0 | 126 | cc_return_t CC_CallFeature_terminateCall(cc_call_handle_t call_handle); |
michael@0 | 127 | |
michael@0 | 128 | /** |
michael@0 | 129 | * Answer an incoming or reverting call. |
michael@0 | 130 | * @param call_handle call handle |
michael@0 | 131 | * @param video_pref the sdp direction |
michael@0 | 132 | * @return SUCCESS or FAILURE |
michael@0 | 133 | */ |
michael@0 | 134 | cc_return_t CC_CallFeature_answerCall(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref); |
michael@0 | 135 | |
michael@0 | 136 | /** |
michael@0 | 137 | * Send a keypress to a call, it could be a single digit. |
michael@0 | 138 | * @param call_handle call handle |
michael@0 | 139 | * @param cc_digit digit pressed |
michael@0 | 140 | * @return SUCCESS or FAILURE |
michael@0 | 141 | */ |
michael@0 | 142 | cc_return_t CC_CallFeature_sendDigit(cc_call_handle_t call_handle, cc_digit_t cc_digit); |
michael@0 | 143 | |
michael@0 | 144 | /** |
michael@0 | 145 | * Send a backspace action. |
michael@0 | 146 | * @param call_handle call handle |
michael@0 | 147 | * @return SUCCESS or FAILURE |
michael@0 | 148 | */ |
michael@0 | 149 | cc_return_t CC_CallFeature_backSpace(cc_call_handle_t call_handle); |
michael@0 | 150 | |
michael@0 | 151 | /** |
michael@0 | 152 | * Send a dial digit string on an active call, e.g."9191234567". |
michael@0 | 153 | * @param call_handle call handle |
michael@0 | 154 | * @param video_pref the sdp direction |
michael@0 | 155 | * @param numbers dialed string |
michael@0 | 156 | * @return SUCCESS or FAILURE |
michael@0 | 157 | */ |
michael@0 | 158 | cc_return_t CC_CallFeature_dial(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref, const cc_string_t numbers); |
michael@0 | 159 | |
michael@0 | 160 | cc_return_t CC_CallFeature_CreateOffer(cc_call_handle_t call_handle, |
michael@0 | 161 | cc_media_constraints_t *constraints, |
michael@0 | 162 | Timecard *tc); |
michael@0 | 163 | |
michael@0 | 164 | cc_return_t CC_CallFeature_CreateAnswer(cc_call_handle_t call_handle, |
michael@0 | 165 | cc_media_constraints_t *constraints, |
michael@0 | 166 | Timecard *tc); |
michael@0 | 167 | |
michael@0 | 168 | cc_return_t CC_CallFeature_SetLocalDescription(cc_call_handle_t call_handle, |
michael@0 | 169 | cc_jsep_action_t action, |
michael@0 | 170 | const char* sdp, |
michael@0 | 171 | Timecard *tc); |
michael@0 | 172 | |
michael@0 | 173 | cc_return_t CC_CallFeature_SetRemoteDescription(cc_call_handle_t call_handle, |
michael@0 | 174 | cc_jsep_action_t action, |
michael@0 | 175 | const char* sdp, |
michael@0 | 176 | Timecard *tc); |
michael@0 | 177 | |
michael@0 | 178 | cc_return_t CC_CallFeature_SetPeerConnection(cc_call_handle_t call_handle, cc_peerconnection_t pc); |
michael@0 | 179 | |
michael@0 | 180 | cc_return_t CC_CallFeature_AddStream(cc_call_handle_t call_handle, |
michael@0 | 181 | cc_media_stream_id_t stream_id, |
michael@0 | 182 | cc_media_track_id_t id, |
michael@0 | 183 | cc_media_type_t media_type, |
michael@0 | 184 | cc_media_constraints_t *constraints); |
michael@0 | 185 | |
michael@0 | 186 | cc_return_t CC_CallFeature_RemoveStream(cc_call_handle_t call_handle, cc_media_stream_id_t stream_id, cc_media_track_id_t id, cc_media_type_t media_type); |
michael@0 | 187 | |
michael@0 | 188 | cc_return_t CC_CallFeature_AddICECandidate(cc_call_handle_t call_handle, |
michael@0 | 189 | const char* candidate, |
michael@0 | 190 | const char *mid, |
michael@0 | 191 | cc_level_t level, |
michael@0 | 192 | Timecard *tc); |
michael@0 | 193 | cc_return_t CC_CallFeature_FoundICECandidate(cc_call_handle_t call_handle, |
michael@0 | 194 | const char* candidate, |
michael@0 | 195 | const char *mid, |
michael@0 | 196 | cc_level_t level, |
michael@0 | 197 | Timecard *tc); |
michael@0 | 198 | |
michael@0 | 199 | /** |
michael@0 | 200 | * Initiate a speed dial. |
michael@0 | 201 | * @param call_handle call handle |
michael@0 | 202 | * @param speed_dial_number speed dial number to be dialed. |
michael@0 | 203 | * @param video_pref the sdp direction |
michael@0 | 204 | * @return SUCCESS or FAILURE |
michael@0 | 205 | */ |
michael@0 | 206 | cc_return_t CC_CallFeature_speedDial(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref, const cc_string_t speed_dial_number); |
michael@0 | 207 | |
michael@0 | 208 | /** |
michael@0 | 209 | * Initiate a BLF call pickup. |
michael@0 | 210 | * @param call_handle call handle |
michael@0 | 211 | * @param speed_dial_number speed dial number configured. |
michael@0 | 212 | * @param video_pref the sdp direction |
michael@0 | 213 | * @return SUCCESS or FAILURE |
michael@0 | 214 | */ |
michael@0 | 215 | cc_return_t CC_CallFeature_blfCallPickup(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref, const cc_string_t speed_dial_number); |
michael@0 | 216 | |
michael@0 | 217 | /** |
michael@0 | 218 | * Redial the last dial numbers. |
michael@0 | 219 | * @param call_handle call handle |
michael@0 | 220 | * @param video_pref the sdp direction |
michael@0 | 221 | * @return SUCCESS or FAILURE |
michael@0 | 222 | * @note: if there is no active dial made, this method should not be called. |
michael@0 | 223 | */ |
michael@0 | 224 | cc_return_t CC_CallFeature_redial(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref); |
michael@0 | 225 | |
michael@0 | 226 | /** |
michael@0 | 227 | * Update a video media capability for a call. To be used to escalate deescalate video on a specified call |
michael@0 | 228 | * @return SUCCESS or FAILURE |
michael@0 | 229 | */ |
michael@0 | 230 | cc_return_t CC_CallFeature_updateCallMediaCapability(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref); |
michael@0 | 231 | |
michael@0 | 232 | /** |
michael@0 | 233 | * Make a call forward all on the line identified by the call_handle. |
michael@0 | 234 | * @param call_handle call handle |
michael@0 | 235 | * @return SUCCESS or FAILURE |
michael@0 | 236 | */ |
michael@0 | 237 | cc_return_t CC_CallFeature_callForwardAll(cc_call_handle_t call_handle); |
michael@0 | 238 | |
michael@0 | 239 | /** |
michael@0 | 240 | * Resume a held call. |
michael@0 | 241 | * @param call_handle call handle |
michael@0 | 242 | * @param video_pref the sdp direction |
michael@0 | 243 | * @return SUCCESS or FAILURE |
michael@0 | 244 | */ |
michael@0 | 245 | cc_return_t CC_CallFeature_resume(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref); |
michael@0 | 246 | |
michael@0 | 247 | /** |
michael@0 | 248 | * End a consultation call. |
michael@0 | 249 | * @param call_handle call handle |
michael@0 | 250 | * @return SUCCESS or FAILURE |
michael@0 | 251 | */ |
michael@0 | 252 | cc_return_t CC_CallFeature_endConsultativeCall(cc_call_handle_t call_handle); |
michael@0 | 253 | |
michael@0 | 254 | /** |
michael@0 | 255 | * Initiate a conference. Steps to make a conference or transfer: |
michael@0 | 256 | * @li Step1 Create a call handle, e.g. chandle1. |
michael@0 | 257 | * @li Step2 Start the call on this call handle. |
michael@0 | 258 | * @li Step3 When the call is answered, invoke: |
michael@0 | 259 | * CC_CallFeature_conference(chandle1, FALSE, CC_EMPTY_CALL_HANDLE) to start a conference operation. |
michael@0 | 260 | * @li Step4 Upon receiving the consultative call (cHandle2) created from pSipcc system, |
michael@0 | 261 | * invoke: |
michael@0 | 262 | * CC_CallFeature_dial(cHandle2) |
michael@0 | 263 | * to dial the consultative call. |
michael@0 | 264 | * @li Step5 When the consultative call is in ringout or connected state, invoke: |
michael@0 | 265 | * CC_CallFeature_conference(cHandle2, FALSE, CC_EMPTY_CALL_HANDLE) to |
michael@0 | 266 | * finish the conference. |
michael@0 | 267 | * Note: @li in the step 4, a user could kill the consultative call and pickup a hold call (not the parent call that |
michael@0 | 268 | * initiated the conference). In this scenario, a parent call handle should be supplied. |
michael@0 | 269 | * For instance, |
michael@0 | 270 | * CC_CallFeature_conference(cHandle2, FALSE, cHandle1) |
michael@0 | 271 | * @li If it's a B2bConf, substitute the "FALSE" with "TRUE" |
michael@0 | 272 | * |
michael@0 | 273 | * @param call_handle the call handle for |
michael@0 | 274 | * @li the original connected call. |
michael@0 | 275 | * @li the consultative call or a held call besides the parent call initiated the transfer. This is used |
michael@0 | 276 | * on the second time to finish the transfer. |
michael@0 | 277 | * @param is_local Local conference or not. If it's a local conference, it's a b2bconf. |
michael@0 | 278 | * @param parent_call_handle if supplied, it will be the targeted parent call handle, which initiated the conference. |
michael@0 | 279 | * @param video_pref the sdp direction |
michael@0 | 280 | * @return SUCCESS or FAILURE |
michael@0 | 281 | */ |
michael@0 | 282 | cc_return_t CC_CallFeature_conference(cc_call_handle_t call_handle, cc_boolean is_local, |
michael@0 | 283 | cc_call_handle_t parent_call_handle, cc_sdp_direction_t video_pref); |
michael@0 | 284 | |
michael@0 | 285 | /** |
michael@0 | 286 | * Initiate a call transfer. Please refer to Conference feature. |
michael@0 | 287 | * @param call_handle the call handle for |
michael@0 | 288 | * @li the original connected call. |
michael@0 | 289 | * @li the consultative call or a held call besides the parent call initiated the transfer. This is used |
michael@0 | 290 | * on the second time to finish the transfer. |
michael@0 | 291 | * @param parent_call_handle if supplied, it will be the parent call handle, which initiated the transfer. |
michael@0 | 292 | * @param video_pref video preference for the consult call as specified by direction |
michael@0 | 293 | * @return SUCCESS or FAILURE |
michael@0 | 294 | */ |
michael@0 | 295 | cc_return_t CC_CallFeature_transfer(cc_call_handle_t call_handle, cc_call_handle_t parent_call_handle, cc_sdp_direction_t video_pref); |
michael@0 | 296 | |
michael@0 | 297 | |
michael@0 | 298 | /** |
michael@0 | 299 | * Initiate a direct transfer |
michael@0 | 300 | * @param call_handle the call handle for the call to initialize a transfer |
michael@0 | 301 | * @param target_call_handle the call handle for the target transfer call. |
michael@0 | 302 | * @retrun SUCCESS or FAILURE. If the target call handle is empty, a FAILURE will be returned. |
michael@0 | 303 | */ |
michael@0 | 304 | cc_return_t CC_CallFeature_directTransfer(cc_call_handle_t call_handle, cc_call_handle_t target_call_handle); |
michael@0 | 305 | |
michael@0 | 306 | /** |
michael@0 | 307 | * Initiate a join across line |
michael@0 | 308 | * @param call_handle the call handle for the call that initializes a join across line (conference). |
michael@0 | 309 | * @param target_call_handle the call handle for the call will be joined. |
michael@0 | 310 | */ |
michael@0 | 311 | cc_return_t CC_CallFeature_joinAcrossLine(cc_call_handle_t call_handle, cc_call_handle_t target_call_handle); |
michael@0 | 312 | |
michael@0 | 313 | /** |
michael@0 | 314 | * Put a connected call on hold. |
michael@0 | 315 | * @param call_handle call handle |
michael@0 | 316 | * @param reason the reason to hold. The following values should be used. |
michael@0 | 317 | * CC_HOLD_REASON_NONE, |
michael@0 | 318 | * CC_HOLD_REASON_XFER, //Hold for transfer |
michael@0 | 319 | * CC_HOLD_REASON_CONF, //Hold for conference |
michael@0 | 320 | * @return SUCCESS or FAILURE |
michael@0 | 321 | */ |
michael@0 | 322 | cc_return_t CC_CallFeature_holdCall(cc_call_handle_t call_handle, cc_hold_reason_t reason); |
michael@0 | 323 | |
michael@0 | 324 | /********************************End of basic call feature methods******************************************/ |
michael@0 | 325 | |
michael@0 | 326 | /*************************************Additional call feature methods*************************************** |
michael@0 | 327 | * |
michael@0 | 328 | */ |
michael@0 | 329 | /** @todo if needed |
michael@0 | 330 | * Direct transfer a call. |
michael@0 | 331 | * @param call_handle call handle |
michael@0 | 332 | * @return SUCCESS or FAILURE |
michael@0 | 333 | */ |
michael@0 | 334 | //cc_return_t CC_CallFeature_directTransfer(cc_call_handle_t call_handle); |
michael@0 | 335 | |
michael@0 | 336 | /** |
michael@0 | 337 | * Select or locked a call. |
michael@0 | 338 | * @param call_handle call handle |
michael@0 | 339 | * @return SUCCESS or FAILURE |
michael@0 | 340 | */ |
michael@0 | 341 | cc_return_t CC_CallFeature_select(cc_call_handle_t call_handle); |
michael@0 | 342 | |
michael@0 | 343 | /** |
michael@0 | 344 | * Cancel a call feature, e.g. when the consultative call is connected and the |
michael@0 | 345 | * user wishes not to make the conference, thie method can be invoked. |
michael@0 | 346 | * @param call_handle call handle |
michael@0 | 347 | * @return SUCCESS or FAILURE |
michael@0 | 348 | */ |
michael@0 | 349 | cc_return_t CC_CallFeature_cancelXfrerCnf(cc_call_handle_t call_handle); |
michael@0 | 350 | |
michael@0 | 351 | /** |
michael@0 | 352 | * Indicate the mute state on the device |
michael@0 | 353 | * Used to send a mute state across over CAST to the PC |
michael@0 | 354 | */ |
michael@0 | 355 | void CC_CallFeature_mute(cc_boolean mute); |
michael@0 | 356 | |
michael@0 | 357 | /** |
michael@0 | 358 | * Indicate the speaker state on the device |
michael@0 | 359 | * Used to send a speaker state across over CAST to the PC |
michael@0 | 360 | */ |
michael@0 | 361 | void CC_CallFeature_speaker(cc_boolean mute); |
michael@0 | 362 | |
michael@0 | 363 | /** |
michael@0 | 364 | * Returns the call id of the connected call |
michael@0 | 365 | */ |
michael@0 | 366 | |
michael@0 | 367 | cc_call_handle_t CC_CallFeature_getConnectedCall(); |
michael@0 | 368 | |
michael@0 | 369 | #endif /* _CC_CALL_FEATURE_H_ */ |