|
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 #pragma once |
|
6 |
|
7 #include <set> |
|
8 |
|
9 extern "C" |
|
10 { |
|
11 #include "ccapi_types.h" |
|
12 #include "fsmdef_states.h" |
|
13 } |
|
14 |
|
15 |
|
16 #include "CC_Common.h" |
|
17 #include "CC_CallTypes.h" |
|
18 #include "peer_connection_types.h" |
|
19 |
|
20 #if defined(__cplusplus) && __cplusplus >= 201103L |
|
21 typedef struct Timecard Timecard; |
|
22 #else |
|
23 #include "timecard.h" |
|
24 #endif |
|
25 |
|
26 namespace CSF |
|
27 { |
|
28 |
|
29 class ECC_API CC_CallInfo |
|
30 { |
|
31 public: |
|
32 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_CallInfo) |
|
33 protected: |
|
34 CC_CallInfo() { } |
|
35 |
|
36 public: |
|
37 //Base class needs dtor to be declared as virtual |
|
38 virtual ~CC_CallInfo() {}; |
|
39 |
|
40 /** |
|
41 Get the line object associated with this call. |
|
42 |
|
43 @return CC_LinePtr - line ID |
|
44 */ |
|
45 virtual CC_LinePtr getline () = 0; |
|
46 |
|
47 /** |
|
48 get Call state |
|
49 @param [in] handle - call info handle |
|
50 @return call state |
|
51 */ |
|
52 virtual cc_call_state_t getCallState () = 0; |
|
53 |
|
54 /** |
|
55 get FSM state |
|
56 @param [in] handle - call info handle |
|
57 @return FSM state |
|
58 */ |
|
59 virtual fsmdef_states_t getFsmState () const = 0; |
|
60 |
|
61 /** |
|
62 print Call state |
|
63 @param [in] handle - call info handle |
|
64 @return call state as string |
|
65 */ |
|
66 virtual std::string callStateToString (cc_call_state_t state) = 0; |
|
67 |
|
68 /** |
|
69 print FSM state |
|
70 @param [in] handle - call info handle |
|
71 @return call state as string |
|
72 */ |
|
73 virtual std::string fsmStateToString (fsmdef_states_t state) const = 0; |
|
74 |
|
75 /** |
|
76 print Call event |
|
77 @param [in] call event |
|
78 @return call event as string |
|
79 */ |
|
80 virtual std::string callEventToString (ccapi_call_event_e callEvent) = 0; |
|
81 |
|
82 /** |
|
83 Get ringer state. |
|
84 |
|
85 @return bool ringer state. |
|
86 */ |
|
87 virtual bool getRingerState() = 0; |
|
88 |
|
89 /** |
|
90 Get call attributes |
|
91 |
|
92 @return cc_call_attr_t. |
|
93 */ |
|
94 virtual cc_call_attr_t getCallAttr() = 0; |
|
95 |
|
96 /** |
|
97 Get the call type |
|
98 |
|
99 @return cc_call_type_t for this call. Supported values inlude: |
|
100 CC_CALL_TYPE_INCOMING, CC_CALL_TYPE_OUTGOING and CC_CALL_TYPE_FORWARDED. |
|
101 */ |
|
102 virtual cc_call_type_t getCallType() = 0; |
|
103 |
|
104 /** |
|
105 Get called party name |
|
106 |
|
107 @return called party name |
|
108 */ |
|
109 virtual std::string getCalledPartyName() = 0; |
|
110 |
|
111 /** |
|
112 Get called party number |
|
113 |
|
114 @return called party number as a string. |
|
115 */ |
|
116 virtual std::string getCalledPartyNumber() = 0; |
|
117 |
|
118 /** |
|
119 Get calling party name |
|
120 |
|
121 @return calling party name |
|
122 */ |
|
123 virtual std::string getCallingPartyName() = 0; |
|
124 |
|
125 /** |
|
126 Get calling party number |
|
127 @return calling party number as a string |
|
128 Note: this is a const reference to a string that's owned by the |
|
129 */ |
|
130 virtual std::string getCallingPartyNumber() = 0; |
|
131 |
|
132 /** |
|
133 Get alternate number |
|
134 |
|
135 @return calling party number as a string. |
|
136 */ |
|
137 virtual std::string getAlternateNumber() = 0; |
|
138 |
|
139 /** |
|
140 This function is used to check if a given capability is supported |
|
141 based on the information in this CC_CallInfo object. |
|
142 |
|
143 @param [in] capability - the capability that is to be checked for availability. |
|
144 @return boolean - returns true if the given capability is available, false otherwise. |
|
145 */ |
|
146 virtual bool hasCapability (CC_CallCapabilityEnum::CC_CallCapability capability) = 0; |
|
147 |
|
148 /** |
|
149 If you need the complete set of capabilities |
|
150 |
|
151 @return cc_return_t - set of Call Capabilities. |
|
152 */ |
|
153 virtual std::set<CC_CallCapabilityEnum::CC_CallCapability> getCapabilitySet() = 0; |
|
154 |
|
155 /** |
|
156 get Original Called party name |
|
157 @param [in] handle - call info handle |
|
158 @return original called party name |
|
159 */ |
|
160 virtual std::string getOriginalCalledPartyName() = 0; |
|
161 |
|
162 /** |
|
163 get Original Called party number |
|
164 @param [in] handle - call info handle |
|
165 @return original called party number |
|
166 */ |
|
167 virtual std::string getOriginalCalledPartyNumber() = 0; |
|
168 |
|
169 /** |
|
170 get last redirecting party name |
|
171 @param [in] handle - call info handle |
|
172 @return last redirecting party name |
|
173 */ |
|
174 virtual std::string getLastRedirectingPartyName() = 0; |
|
175 |
|
176 /** |
|
177 get past redirecting party number |
|
178 @param [in] handle - call info handle |
|
179 @return last redirecting party number |
|
180 */ |
|
181 virtual std::string getLastRedirectingPartyNumber() = 0; |
|
182 |
|
183 /** |
|
184 get placed call party name |
|
185 @param [in] handle - call info handle |
|
186 @return placed party name |
|
187 */ |
|
188 virtual std::string getPlacedCallPartyName() = 0; |
|
189 |
|
190 /** |
|
191 get placed call party number |
|
192 @param [in] handle - call info handle |
|
193 @return placed party number |
|
194 */ |
|
195 virtual std::string getPlacedCallPartyNumber() = 0; |
|
196 |
|
197 /** |
|
198 get call instance number |
|
199 @param [in] handle - call info handle |
|
200 @return |
|
201 */ |
|
202 virtual cc_int32_t getCallInstance() = 0; |
|
203 |
|
204 /** |
|
205 get call status prompt |
|
206 @param [in] handle - call info handle |
|
207 @return call status |
|
208 */ |
|
209 virtual std::string getStatus() = 0; |
|
210 |
|
211 /** |
|
212 get call security // TODO XLS has callagent security and endtoend security on call? |
|
213 @param [in] handle - call info handle |
|
214 @return call security status |
|
215 */ |
|
216 virtual cc_call_security_t getSecurity() = 0; |
|
217 |
|
218 /** |
|
219 get Call Selection Status |
|
220 @param [in] handle - call info handle |
|
221 @return bool - TRUE => selected |
|
222 */ |
|
223 virtual cc_int32_t getSelectionStatus() = 0; |
|
224 |
|
225 /** |
|
226 get GCID |
|
227 @param [in] handle - call info handle |
|
228 @return GCID |
|
229 */ |
|
230 virtual std::string getGCID() = 0; |
|
231 |
|
232 /** |
|
233 get ringer loop count |
|
234 @param handle - call handle |
|
235 @return once Vs continuous |
|
236 */ |
|
237 virtual bool getIsRingOnce() = 0; |
|
238 |
|
239 /** |
|
240 get ringer mode |
|
241 @param handle - call handle |
|
242 @return ringer mode |
|
243 */ |
|
244 virtual int getRingerMode() = 0; |
|
245 |
|
246 /** |
|
247 get onhook reason |
|
248 @param [in] handle - call info handle |
|
249 @return onhook reason |
|
250 */ |
|
251 virtual cc_int32_t getOnhookReason() = 0; |
|
252 |
|
253 /** |
|
254 is Conference Call? |
|
255 @param [in] handle - call info handle |
|
256 @return boolean - is Conference |
|
257 */ |
|
258 virtual bool getIsConference() = 0; |
|
259 |
|
260 /** |
|
261 getStream Statistics |
|
262 @param [in] handle - call info handle |
|
263 @param [in,out] stats - Array to get the stats |
|
264 @param [in,out] count - in len of stats arraysize of stats / out stats copied |
|
265 @return cc_return_t - CC_SUCCESS or CC_FAILURE |
|
266 */ |
|
267 virtual std::set<cc_int32_t> getStreamStatistics() = 0; |
|
268 |
|
269 /** |
|
270 Call selection status |
|
271 @param [in] handle - call info handle |
|
272 @return bool - selection status |
|
273 */ |
|
274 virtual bool isCallSelected() = 0; |
|
275 |
|
276 /** |
|
277 INFO Package for RECEIVED_INFO event |
|
278 @param [in] handle - call info handle |
|
279 @return string - Info package header |
|
280 */ |
|
281 virtual std::string getINFOPack() = 0; |
|
282 |
|
283 /** |
|
284 INFO type for RECEIVED_INFO event |
|
285 |
|
286 @return string - content-type header |
|
287 */ |
|
288 virtual std::string getINFOType() = 0; |
|
289 |
|
290 /** |
|
291 INFO body for RECEIVED_INFO event |
|
292 |
|
293 @return string - INFO body |
|
294 */ |
|
295 virtual std::string getINFOBody() = 0; |
|
296 |
|
297 /** |
|
298 Get the call log reference |
|
299 |
|
300 //TODO NEED TO DO SOMETHING WRAP CALL LOG REF. |
|
301 @return string - INFO body |
|
302 NOTE: Memory associated with the call log is tied to the |
|
303 this would be freed when the callinfo ref is freed. |
|
304 */ |
|
305 virtual cc_calllog_ref_t getCallLogRef() = 0; |
|
306 |
|
307 /** |
|
308 returns the negotiated video direction for this call |
|
309 |
|
310 @return cc_sdp_direction_t - video direction |
|
311 */ |
|
312 virtual cc_sdp_direction_t getVideoDirection() = 0; |
|
313 |
|
314 /** |
|
315 Find out if this call is capable of querying the media state, which includes mute state and video direction |
|
316 @return bool |
|
317 */ |
|
318 virtual bool isMediaStateAvailable() = 0; |
|
319 |
|
320 /** |
|
321 Get the audio mute state if available (check availability with isMediaStateAvailable()) |
|
322 @return bool - the current audio state of the call |
|
323 */ |
|
324 virtual bool isAudioMuted(void) = 0; |
|
325 |
|
326 /** |
|
327 Get the video mute state if available (check availability with isMediaStateAvailable()) |
|
328 @return bool - the current video state of the call |
|
329 */ |
|
330 virtual bool isVideoMuted(void) = 0; |
|
331 |
|
332 /** |
|
333 Get the current call volume level |
|
334 @return int - the current call volume level, or -1 if it cannot be determined |
|
335 */ |
|
336 virtual int getVolume() = 0; |
|
337 |
|
338 /** |
|
339 get SDP from info object returned from JSEP functions |
|
340 @param [in] handle - call info handle |
|
341 @return SDP string |
|
342 */ |
|
343 virtual std::string getSDP() = 0; |
|
344 |
|
345 /** |
|
346 get status code |
|
347 @param [in] handle - call info handle |
|
348 @return code |
|
349 */ |
|
350 virtual cc_int32_t getStatusCode() = 0; |
|
351 |
|
352 /** |
|
353 get media streams |
|
354 @return media stream table |
|
355 Note:Ownership of the MediaStreamTable is responsibiliy of |
|
356 the caller. |
|
357 */ |
|
358 virtual MediaStreamTable* getMediaStreams() const = 0; |
|
359 |
|
360 /** |
|
361 Get the current operation's timecard (if any), and assume ownership |
|
362 of its memory. |
|
363 */ |
|
364 virtual Timecard *takeTimecard() = 0; |
|
365 |
|
366 /** |
|
367 Get the latest candidate. |
|
368 */ |
|
369 virtual std::string getCandidate() = 0; |
|
370 }; |
|
371 }; |