|
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/. */ |
|
4 |
|
5 #ifndef _CCAPI_CALL_H_ |
|
6 #define _CCAPI_CALL_H_ |
|
7 |
|
8 #if defined(__cplusplus) && __cplusplus >= 201103L |
|
9 typedef struct Timecard Timecard; |
|
10 #else |
|
11 #include "timecard.h" |
|
12 #endif |
|
13 |
|
14 #include "ccapi_types.h" |
|
15 |
|
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); |
|
23 |
|
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); |
|
30 |
|
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); |
|
39 |
|
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); |
|
46 |
|
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); |
|
55 |
|
56 |
|
57 cc_return_t CCAPI_CreateOffer(cc_call_handle_t handle, |
|
58 cc_media_constraints_t *constraints, |
|
59 Timecard *tc); |
|
60 |
|
61 cc_return_t CCAPI_CreateAnswer(cc_call_handle_t handle, |
|
62 cc_media_constraints_t *constraints, |
|
63 Timecard *tc); |
|
64 |
|
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); |
|
69 |
|
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); |
|
74 |
|
75 cc_return_t CCAPI_SetPeerConnection(cc_call_handle_t handle, cc_peerconnection_t pc); |
|
76 |
|
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); |
|
82 |
|
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); |
|
84 |
|
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); |
|
90 |
|
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); |
|
98 |
|
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); |
|
105 |
|
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); |
|
113 |
|
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); |
|
121 |
|
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); |
|
135 |
|
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) ; |
|
143 |
|
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); |
|
150 |
|
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); |
|
157 |
|
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); |
|
165 |
|
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); |
|
175 |
|
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); |
|
183 |
|
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); |
|
193 |
|
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); |
|
200 |
|
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); |
|
208 |
|
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); |
|
216 |
|
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); |
|
225 |
|
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); |
|
232 |
|
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); |
|
240 |
|
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); |
|
250 |
|
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); |
|
259 |
|
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); |
|
268 |
|
269 |
|
270 #endif // _CCAPI_CALL_H_ |