1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_call.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,270 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef _CCAPI_CALL_H_ 1.9 +#define _CCAPI_CALL_H_ 1.10 + 1.11 +#if defined(__cplusplus) && __cplusplus >= 201103L 1.12 +typedef struct Timecard Timecard; 1.13 +#else 1.14 +#include "timecard.h" 1.15 +#endif 1.16 + 1.17 +#include "ccapi_types.h" 1.18 + 1.19 +/** 1.20 + * Get reference to call info 1.21 + * @param [in] handle - call handle 1.22 + * @return cc_call_info_snap_t 1.23 + * NOTE: The info returned by this method must be released using CCAPI_Call_releaseCallInfo() 1.24 + */ 1.25 +cc_callinfo_ref_t CCAPI_Call_getCallInfo(cc_call_handle_t handle); 1.26 + 1.27 +/** 1.28 + * Release the resources held by this call info snapshot 1.29 + * @param [in] ref - refrence to the call info to be freed 1.30 + * @return void 1.31 + */ 1.32 +void CCAPI_Call_releaseCallInfo(cc_callinfo_ref_t ref); 1.33 + 1.34 +/** 1.35 + * Retain the call info reference 1.36 + * @param [in] ref - reference to the call info to be retained 1.37 + * @return void 1.38 + * NOTE: Application that has retained callInfo must call CCAPI_Call_releaseCallInfo() 1.39 + * to free memory associated with this Info. 1.40 + */ 1.41 +void CCAPI_Call_retainCallInfo(cc_callinfo_ref_t ref); 1.42 + 1.43 +/** 1.44 + * get the line associated with this call 1.45 + * @param [in] handle - call handle 1.46 + * @return cc_lineid_t 1.47 + */ 1.48 +cc_lineid_t CCAPI_Call_getLine(cc_call_handle_t call_handle); 1.49 + 1.50 +/** 1.51 + * Originate call - API to go offhook and dial specified digits on a given call 1.52 + * @param [in] handle - call handle 1.53 + * @param [in] video_pref - video direction desired on call 1.54 + * @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook 1.55 + * @return SUCCESS or FAILURE 1.56 + */ 1.57 +cc_return_t CCAPI_Call_originateCall(cc_call_handle_t handle, cc_sdp_direction_t video_pref, cc_string_t digits); 1.58 + 1.59 + 1.60 +cc_return_t CCAPI_CreateOffer(cc_call_handle_t handle, 1.61 + cc_media_constraints_t *constraints, 1.62 + Timecard *tc); 1.63 + 1.64 +cc_return_t CCAPI_CreateAnswer(cc_call_handle_t handle, 1.65 + cc_media_constraints_t *constraints, 1.66 + Timecard *tc); 1.67 + 1.68 +cc_return_t CCAPI_SetLocalDescription(cc_call_handle_t handle, 1.69 + cc_jsep_action_t action, 1.70 + cc_string_t sdp, 1.71 + Timecard *tc); 1.72 + 1.73 +cc_return_t CCAPI_SetRemoteDescription(cc_call_handle_t handle, 1.74 + cc_jsep_action_t action, 1.75 + cc_string_t sdp, 1.76 + Timecard *tc); 1.77 + 1.78 +cc_return_t CCAPI_SetPeerConnection(cc_call_handle_t handle, cc_peerconnection_t pc); 1.79 + 1.80 +cc_return_t CCAPI_AddStream(cc_call_handle_t handle, 1.81 + cc_media_stream_id_t stream_id, 1.82 + cc_media_track_id_t track_id, 1.83 + cc_media_type_t media_type, 1.84 + cc_media_constraints_t *constraints); 1.85 + 1.86 +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); 1.87 + 1.88 +cc_return_t CCAPI_AddICECandidate(cc_call_handle_t handle, 1.89 + cc_string_t candidate, 1.90 + cc_string_t mid, 1.91 + cc_level_t level, 1.92 + Timecard *tc); 1.93 + 1.94 +/** 1.95 + * Send digits on the call - can be invoked either to dial additional digits or send DTMF 1.96 + * @param [in] handle - call handle 1.97 + * @param [in] digit - digit to be dialed 1.98 + * @return SUCCESS or FAILURE 1.99 + */ 1.100 +cc_return_t CCAPI_Call_sendDigit(cc_call_handle_t handle, cc_digit_t digit); 1.101 + 1.102 +/** 1.103 + * Send Backspace - Delete last digit dialed. 1.104 + * @param [in] handle - call handle 1.105 + * @return SUCCESS or FAILURE 1.106 + */ 1.107 +cc_return_t CCAPI_Call_backspace(cc_call_handle_t handle); 1.108 + 1.109 +/** 1.110 + * Answer Call 1.111 + * @param [in] handle - call handle 1.112 + * @param [in] video_pref - video direction desired on call 1.113 + * @return SUCCESS or FAILURE 1.114 + */ 1.115 +cc_return_t CCAPI_Call_answerCall(cc_call_handle_t handle, cc_sdp_direction_t video_pref); 1.116 + 1.117 +/** 1.118 + * Redial 1.119 + * @param [in] handle - call handle 1.120 + * @param [in] video_pref - video direction desired on call 1.121 + * @return SUCCESS or FAILURE 1.122 + */ 1.123 +cc_return_t CCAPI_Call_redial(cc_call_handle_t handle, cc_sdp_direction_t video_pref); 1.124 + 1.125 +/** 1.126 + * Initiate Call Forward All 1.127 + * @param [in] handle - call handle 1.128 + * @return SUCCESS or FAILURE 1.129 + */ 1.130 +cc_return_t CCAPI_Call_initiateCallForwardAll(cc_call_handle_t handle); 1.131 +/** 1.132 + * Hold 1.133 + * @param [in] handle - call handle 1.134 + * @param [in] reason - hold reason 1.135 + * @return SUCCESS or FAILURE 1.136 + */ 1.137 +cc_return_t CCAPI_Call_hold(cc_call_handle_t handle, cc_hold_reason_t reason); 1.138 + 1.139 +/** 1.140 + * Resume 1.141 + * @param [in] handle - call handle 1.142 + * @param [in] video_pref - video direction desired on call 1.143 + * @return SUCCESS or FAILURE 1.144 + */ 1.145 +cc_return_t CCAPI_Call_resume(cc_call_handle_t handle, cc_sdp_direction_t video_pref) ; 1.146 + 1.147 +/** 1.148 + * end Consult leg - used to end consult leg when the user picks active calls list for xfer/conf 1.149 + * @param [in] handle - call handle 1.150 + * @return SUCCESS or FAILURE 1.151 + */ 1.152 +cc_return_t CCAPI_Call_endConsultativeCall(cc_call_handle_t handle); 1.153 + 1.154 +/** 1.155 + * end Call 1.156 + * @param [in] handle - call handle 1.157 + * @return SUCCESS or FAILURE 1.158 + */ 1.159 +cc_return_t CCAPI_Call_endCall(cc_call_handle_t handle); 1.160 + 1.161 +/** 1.162 + * Initiate a conference 1.163 + * @param [in] handle - call handle 1.164 + * @param [in] video_pref - video direction desired on consult call 1.165 + * @return SUCCESS or FAILURE 1.166 + */ 1.167 +cc_return_t CCAPI_Call_conferenceStart(cc_call_handle_t handle, cc_sdp_direction_t video_pref); 1.168 + 1.169 +/** 1.170 + * complete conference 1.171 + * @param [in] handle - call handle 1.172 + * @param [in] phandle - call handle of the other leg 1.173 + * @param [in] video_pref - video direction desired on consult call 1.174 + * @return SUCCESS or FAILURE 1.175 + */ 1.176 +cc_return_t CCAPI_Call_conferenceComplete(cc_call_handle_t handle, cc_call_handle_t phandle, 1.177 + cc_sdp_direction_t video_pref); 1.178 + 1.179 +/** 1.180 + * start transfer 1.181 + * @param [in] handle - call handle 1.182 + * @param [in] video_pref - video direction desired on consult call 1.183 + * @return SUCCESS or FAILURE 1.184 + */ 1.185 +cc_return_t CCAPI_Call_transferStart(cc_call_handle_t handle, cc_sdp_direction_t video_pref); 1.186 + 1.187 +/** 1.188 + * complete transfer 1.189 + * @param [in] handle - call handle 1.190 + * @param [in] phandle - call handle of the other leg 1.191 + * @param [in] video_pref - video direction desired on consult call 1.192 + * @return SUCCESS or FAILURE 1.193 + */ 1.194 +cc_return_t CCAPI_Call_transferComplete(cc_call_handle_t handle, cc_call_handle_t phandle, 1.195 + cc_sdp_direction_t video_pref); 1.196 + 1.197 +/** 1.198 + * cancel conference or transfer 1.199 + * @param [in] handle - call handle 1.200 + * @return SUCCESS or FAILURE 1.201 + */ 1.202 +cc_return_t CCAPI_Call_cancelTransferOrConferenceFeature(cc_call_handle_t handle); 1.203 + 1.204 +/** 1.205 + * direct Transfer 1.206 + * @param [in] handle - call handle 1.207 + * @param [in] target - call handle for transfer target call 1.208 + * @return SUCCESS or FAILURE 1.209 + */ 1.210 +cc_return_t CCAPI_Call_directTransfer(cc_call_handle_t handle, cc_call_handle_t target); 1.211 + 1.212 +/** 1.213 + * Join Across line 1.214 + * @param [in] handle - call handle 1.215 + * @param [in] target - join target 1.216 + * @return SUCCESS or FAILURE 1.217 + */ 1.218 +cc_return_t CCAPI_Call_joinAcrossLine(cc_call_handle_t handle, cc_call_handle_t target); 1.219 + 1.220 +/** 1.221 + * BLF Call Pickup 1.222 + * @param [in] handle - call handle 1.223 + * @param [in] video_pref - video direction preference 1.224 + * @param [in] speed - speedDial Number 1.225 + * @return SUCCESS or FAILURE 1.226 + */ 1.227 +cc_return_t CCAPI_Call_blfCallPickup(cc_call_handle_t handle, cc_sdp_direction_t video_pref, cc_string_t speed); 1.228 + 1.229 +/** 1.230 + * Select a call 1.231 + * @param [in] handle - call handle 1.232 + * @return SUCCESS or FAILURE 1.233 + */ 1.234 +cc_return_t CCAPI_Call_select(cc_call_handle_t handle); 1.235 + 1.236 +/** 1.237 + * Update Video Media Cap for the call 1.238 + * @param [in] handle - call handle 1.239 + * @param [in] video_pref - video direction desired on call 1.240 + * @return SUCCESS or FAILURE 1.241 + */ 1.242 +cc_return_t CCAPI_Call_updateVideoMediaCap(cc_call_handle_t handle, cc_sdp_direction_t video_pref); 1.243 + 1.244 +/** 1.245 + * send INFO method for the call 1.246 + * @param [in] handle - call handle 1.247 + * @param [in] infopackage - Info-Package header value 1.248 + * @param [in] infotype - Content-Type header val 1.249 + * @param [in] infobody - Body of the INFO message 1.250 + * @return SUCCESS or FAILURE 1.251 + */ 1.252 +cc_return_t CCAPI_Call_sendInfo(cc_call_handle_t handle, cc_string_t infopackage, cc_string_t infotype, cc_string_t infobody); 1.253 + 1.254 +/** 1.255 + * API to mute/unmute audio 1.256 + * @param [in] val - TRUE=> mute FALSE => unmute 1.257 + * @return SUCCESS or FAILURE 1.258 + * NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. 1.259 + * This API doesn't perform the mute operation but simply caches the mute state of the session. 1.260 + */ 1.261 +cc_return_t CCAPI_Call_setAudioMute(cc_call_handle_t handle, cc_boolean val); 1.262 + 1.263 +/** 1.264 + * API to mute/unmute Video 1.265 + * @param [in] val - TRUE=> mute FALSE => unmute 1.266 + * @return SUCCESS or FAILURE 1.267 + * NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume 1.268 + * This API doesn't perform the mute operation but simply caches the mute state of the session. 1.269 + */ 1.270 +cc_return_t CCAPI_Call_setVideoMute(cc_call_handle_t handle, cc_boolean val); 1.271 + 1.272 + 1.273 +#endif // _CCAPI_CALL_H_