2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _VOICE_CALL_ENGINE_H_
19 #define _VOICE_CALL_ENGINE_H_
22 #include "vc-core-engine-types.h"
24 #define VCALL_SENSOR_NEAR 1
25 #define VCALL_SENSOR_FAR 2
28 * Voicecall Engine API result values
30 typedef enum _vcall_engine_api_result_t {
31 VCALL_ENGINE_API_FAILED = -1,
32 VCALL_ENGINE_API_SUCCESS,
34 VCALL_ENGINE_API_ACTIVE_CALL_EXIST,
35 VCALL_ENGINE_API_ACTIVE_AND_HELD_CALL_EXIST,
37 VCALL_ENGINE_API_CALLNOTALLOWED,
38 VCALL_ENGINE_API_VOICE_CALL_IS_NOT_ALLOWED_DURING_VIDEO_CALL,
39 VCALL_ENGINE_API_UNAVAILABLE,
40 VCALL_ENGINE_API_CHANGEOFFLINEMODETOCALL,
41 VCALL_ENGINE_API_CALLING_EMERG_ONLY,
42 VCALL_ENGINE_API_FDNCALLONLY,
43 VCALL_ENGINE_API_CALLFAILED,
44 VCALL_ENGINE_API_CALLENDED,
45 VCALL_ENGINE_API_SOS_CALL_ONLY_IN_NO_SIM_MODE,
46 VCALL_ENGINE_API_PHONE_NOT_INITIALISED,
47 VCALL_ENGINE_API_CAUSE_WRONG_NUMBER,
49 VCALL_ENGINE_API_DTMFSENDING_FAIL,
50 VCALL_ENGINE_API_HOLD_FAILED,
51 VCALL_ENGINE_API_UNABLE_TO_RETRIEVE,
52 VCALL_ENGINE_API_SWAP_FAILED,
53 VCALL_ENGINE_API_SPLIT_FAILED,
54 VCALL_ENGINE_API_JOIN_FAILED,
55 VCALL_ENGINE_API_TRANSFER_FAILED,
56 VCALL_ENGINE_API_SWAP_NOT_SUPPORTED,
57 VCALL_ENGINE_API_HOLD_NOT_SUPPORTED,
58 VCALL_ENGINE_API_UNHOLD_NOT_SUPPORTED,
59 VCALL_ENGINE_API_JOIN_NOT_SUPPORTED,
60 VCALL_ENGINE_API_SPLIT_NOT_SUPPORTED,
61 VCALL_ENGINE_API_TRANSFER_NOT_SUPPORTED,
62 VCALL_ENGINE_API_INCOMPLETE,
64 VCALL_ENGINE_API_NOT_ENOUGH_MEMORY_FOR_RECORDING,
65 VCALL_ENGINE_API_NO_CONNECTED_CALL_FOR_RECORDING,
68 } vcall_engine_api_result_t;
71 * This enum defines call answer types
73 typedef enum _vcall_engine_answer_type_t {
74 VCALL_ENGINE_ANSWER_HOLD_ACTIVE_AND_ACCEPT = 1, /**< Puts the active call on hold and accepts the call (Only CONNECTED will be sent to client) */
75 VCALL_ENGINE_ANSWER_RELEASE_ACTIVE_AND_ACCEPT, /**< Releases the active call and accept the call (END and CONNECTED will be sent to Client) */
76 VCALL_ENGINE_ANSWER_RELEASE_HOLD_AND_ACCEPT, /**< Releases the active call and accept the call (END and CONNECTED will be sent to client) */
77 VCALL_ENGINE_ANSWER_RELEASE_ALL_AND_ACCEPT /**< Releases the all calls and accept the call (END and CONNECTED will be sent to client) */
78 } vcall_engine_answer_type_t;
81 * This enum defines call release types
83 typedef enum _vcall_engine_release_type_t {
84 VCALL_ENGINE_RELEASE_ALL_ACTIVE_CALLS, /**< To end all available active calls*/
85 VCALL_ENGINE_RELEASE_ALL_HELD_CALLS, /**< To end all available held calls*/
86 VCALL_ENGINE_RELEASE_ALL_CALLS, /**< To end all available calls(active,held,incoming/outgoing*/
87 } vcall_engine_release_type_t;
90 * This enum defines call answer types
92 typedef enum _vcall_engine_vol_type_t {
93 VCALL_ENGINE_VOL_TYPE_RINGTONE, /**< ringtone volume*/
94 VCALL_ENGINE_VOL_TYPE_VOICE, /**< voice volume*/
95 VCALL_ENGINE_VOL_TYPE_HEADSET /**< headset volume*/
96 } vcall_engine_vol_type_t;
99 * This enumeration defines names of the on call audio status
101 typedef enum _vcall_engine_audio_type_t {
102 VCALL_ENGINE_AUDIO_NONE, /**< none*/
103 VCALL_ENGINE_AUDIO_SPEAKER, /**< System LoudSpeaker Audio */
104 VCALL_ENGINE_AUDIO_RECEIVER, /**< System receiver Audio */
105 VCALL_ENGINE_AUDIO_HEADSET, /**< System Headset Audio */
106 VCALL_ENGINE_AUDIO_EARJACK, /**< System Earjack Audio */
107 VCALL_ENGINE_AUDIO_MAX,
108 } vcall_engine_audio_type_t;
111 * This enumeration defines names of lcd control
113 typedef enum _vcall_engine_lcd_control_t {
114 VCALL_ENGINE_LCD_OFF, /**< LCD Off*/
115 VCALL_ENGINE_LCD_ON, /**< LCD On */
116 VCALL_ENGINE_LCD_ON_LOCK, /**< LCD ON lock */
117 VCALL_ENGINE_LCD_ON_UNLOCK, /**< LCD ON unlock */
118 VCALL_ENGINE_LCD_MAX,
119 } vcall_engine_lcd_control_t;
126 } voicecall_lcd_control_t;
129 * This struct provides a structure for call setup info data.
131 typedef struct _vcall_engine_setup_info_t {
136 char call_num[VC_PHONE_NUMBER_LENGTH_MAX];
137 char call_name[VC_DISPLAY_NAME_LENGTH_MAX];
138 char call_file_path[VC_IMAGE_PATH_LENGTH_MAX];
139 char call_full_file_path[VC_IMAGE_PATH_LENGTH_MAX];
140 } vcall_engine_setup_info_t;
143 * This struct provides a structure for sat setup call info data.
145 typedef struct _vcall_engine_sat_setup_call_info_t {
146 int command_id; /**<Proactive Command Number sent by USIM*/
147 int command_qualifier; /**<call type*/
148 char disp_text[500 + 1]; /**<character data*/
149 char call_num[VC_PHONE_NUMBER_LENGTH_MAX];; /**<call number*/
150 unsigned int duration; /**<maximum repeat duration*/
151 } vcall_engine_sat_setup_call_info_t;
154 * This struct provides a structure for call incoming info data.
156 typedef struct _vcall_engine_incoming_info_t {
159 int cli_presentation_indicator;
160 char call_num[VC_PHONE_NUMBER_LENGTH_MAX];
161 int calling_name_mode;
162 char calling_name[VC_PHONE_NAME_LENGTH_MAX];
163 char redirected_number[VC_PHONE_NUMBER_LENGTH_MAX];
164 char redirected_sub_address[VC_PHONE_SUBADDRESS_LENGTH_MAX];
168 } vcall_engine_incoming_info_t;
170 /**< This is the prototype of the client callback function */
171 typedef gboolean(*vcall_engine_app_cb) (int event, void *pdata, void *puser_data);
173 gboolean vcall_engine_send_event_to_client(int event, void *pdata);
176 * This function initialize voice call engine.
178 * @return int API Result Code.
181 int vcall_engine_init(vcall_engine_app_cb pcb_func, void *pusr_data);
184 * This function processes mo nomal call.
186 * @return int API Result Code.
189 int vcall_engine_process_normal_call(char *number, int ct_index, gboolean b_download_call);
192 * This function processes mo emergency call.
194 * @return int API Result Code.
197 int vcall_engine_process_emergency_call(char *number);
199 int vcall_engine_process_sat_setup_call(vcall_engine_sat_setup_call_info_t *sat_setup_call_info);
202 * This function processes incoming call.
204 * @return int API Result Code.
207 int vcall_engine_process_incoming_call(vcall_engine_incoming_info_t *incoming_call_info);
210 * This function answers an incoming call
212 * @return int API Result Code.
215 int vcall_engine_answer_call(void);
218 * This function answers an incoming call according to the given type
220 * @return int API Result Code.
221 * @param[in] answer_type answer type
223 int vcall_engine_answer_call_by_type(vcall_engine_answer_type_t answer_type);
226 * This function cancel outgoing call
228 * @return int API Result Code.
231 int vcall_engine_cancel_call(void);
234 * This function reject incoming call
236 * @return int API Result Code.
239 int vcall_engine_reject_call(void);
242 * This function release a active or held call
244 * @return int API Result Code.
247 int vcall_engine_release_call(void);
250 * This function release a call by handle
252 * @return int API Result Code.
253 * @param[in] int call_handle
255 int vcall_engine_release_call_by_handle(int call_handle);
258 * This function release calls by type
260 * @return int API Result Code.
261 * @param[in] release_type release_type
263 int vcall_engine_release_call_by_type(vcall_engine_release_type_t release_type);
266 * This function processes hold/retrive/swap calls.
268 * @return int API Result Code.
271 int vcall_engine_process_hold_call(void);
274 * This function processes in call SS code..
279 void vcall_engine_process_incall_ss(char *number);
282 * This function sets up a conference calls
284 * @return int API Result Code.
287 int vcall_engine_join_call(void);
290 * This function make a private call in conference calls.
292 * @return int API Result Code.
293 * @param[in] int call_handle
295 int vcall_engine_split_call(int call_handle);
298 * This function transfers the call from active call to the held call
300 * @return int API Result Code.
301 * @param[in] int call_handle
303 int vcall_engine_transfer_call(void);
306 * This function processed loud speaker.
308 * @return int API Result Code.
309 * @param[in] int bstatus
311 int vcall_engine_process_loudspeaker(int bstatus);
314 * This function processed voice mute status.
316 * @return int API Result Code.
317 * @param[in] int bstatus
319 int vcall_engine_process_voice_mute(int bstatus);
322 * This function gets the volume level
324 * @return int API Result Code.
325 * @param[in] vcall_engine_vol_type_t vol_type
327 int vcall_engine_get_volume_level(vcall_engine_vol_type_t vol_type);
330 * This function sets the volume level
332 * @return int API Result Code.
333 * @param[in] vcall_engine_vol_type_t vol_type
334 * @param[in] int vol_level
336 int vcall_engine_set_volume_level(vcall_engine_vol_type_t vol_type, int vol_level);
339 * This function stop alert
341 * @return int API Result Code.
344 int vcall_engine_stop_alert(void);
347 * This function mute alert.
349 * @return int API Result Code.
352 int vcall_engine_mute_alert(void);
355 * This function process auto redial.
357 * @return int API Result Code.
358 * @param[in] int bstatus
360 int vcall_engine_process_auto_redial(int bstatus);
363 * This function process voice record.
365 * @return int API Result Code.
366 * @param[in] int bstatus
368 int vcall_engine_process_voice_record(int bstatus);
371 * This function send the DTMF number
373 * @return int API Result Code.
374 * @param[in] char* dtmf_number
376 int vcall_engine_send_dtmf_number(char *dtmf_number);
379 * This function processed sound path
381 * @return int API Result Code.
382 * @param[in] int sound_path
384 int vcall_engine_change_sound_path(vcall_engine_audio_type_t sound_path);
387 * This function get sound path
389 * @return int API Result Code.
390 * @param[out] int sound_path
392 int vcall_engine_get_sound_path(int *sound_path);
394 int vcall_engine_set_to_default();
397 * This function retrieves the core state instance
399 * @return instance of the core state
402 gpointer vcall_engine_get_core_state(void);
405 * This function is interface to call-utility to perform string copy
407 * @return instance of the core state
408 * @param[out] pbuffer Target Buffer
409 * @param[in] buf_count Size of Target Buffer
410 * @param[in] pstring Source String
412 gboolean vcall_engine_util_strcpy(char *pbuffer, int buf_count, const char *pstring);
415 * This function returns the number of groups
417 * @param[in] pcount count of the groups
419 gboolean vcall_engine_get_group_count(int *pcount);
422 * This function is interface to call-utility to perform string copy
424 * @return instance of the core state
425 * @param[out] pbuffer Target Buffer
426 * @param[in] time time
428 char *vcall_engine_util_get_date_time(time_t time);
431 * This function is force reset all engine status.
436 void vcall_engine_force_reset(void);
437 #endif /* _VOICE_CALL_ENGINE_H_ */