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

mercurial