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 the command type sent by recorder to the client view through update signal
92 typedef enum _vcall_engine_record_stop_type_t {
93 VCALL_ENGINE_RECORD_STOP_BY_NORMAL, /**< BY_NORMAL*/
94 VCALL_ENGINE_RECORD_STOP_BY_MAX_SIZE, /**< by MAX_SIZE*/
95 VCALL_ENGINE_RECORD_STOP_BY_NO_FREE_SPACE, /**< BY_NO_FREE_SPACE*/
96 VCALL_ENGINE_RECORD_STOP_BY_TIME_LIMIT, /**< BY_TIME_LIMIT*/
97 VCALL_ENGINE_RECORD_STOP_ERROR, /**< ERROR*/
98 } vcall_engine_record_stop_type_t;
101 * This enum defines call answer types
103 typedef enum _vcall_engine_vol_type_t {
104 VCALL_ENGINE_VOL_TYPE_RINGTONE, /**< ringtone volume*/
105 VCALL_ENGINE_VOL_TYPE_VOICE, /**< voice volume*/
106 VCALL_ENGINE_VOL_TYPE_HEADSET /**< headset volume*/
107 } vcall_engine_vol_type_t;
110 * This enumeration defines names of the on call audio status
112 typedef enum _vcall_engine_audio_type_t {
113 VCALL_ENGINE_AUDIO_NONE, /**< none*/
114 VCALL_ENGINE_AUDIO_SPEAKER, /**< System LoudSpeaker Audio */
115 VCALL_ENGINE_AUDIO_RECEIVER_EARJACK, /**< System receiver or earjack Audio */
116 VCALL_ENGINE_AUDIO_HEADSET, /**< System Headset Audio */
117 VCALL_ENGINE_AUDIO_MAX,
118 } vcall_engine_audio_type_t;
121 * This enumeration defines names of lcd control
123 typedef enum _vcall_engine_lcd_control_t {
124 VCALL_ENGINE_LCD_OFF, /**< LCD Off*/
125 VCALL_ENGINE_LCD_ON, /**< LCD On */
126 VCALL_ENGINE_LCD_ON_LOCK, /**< LCD ON lock */
127 VCALL_ENGINE_LCD_ON_UNLOCK, /**< LCD ON unlock */
128 VCALL_ENGINE_LCD_MAX,
129 } vcall_engine_lcd_control_t;
136 } voicecall_lcd_control_t;
139 * This struct provides a structure for call setup info data.
141 typedef struct _vcall_engine_setup_info_t {
146 char call_num[VC_PHONE_NUMBER_LENGTH_MAX];
147 char call_name[VC_DISPLAY_NAME_LENGTH_MAX];
148 char call_file_path[VC_IMAGE_PATH_LENGTH_MAX];
149 char call_full_file_path[VC_IMAGE_PATH_LENGTH_MAX];
150 } vcall_engine_setup_info_t;
153 * This struct provides a structure for sat setup call info data.
155 typedef struct _vcall_engine_sat_setup_call_info_t {
156 int command_id; /**<Proactive Command Number sent by USIM*/
157 int command_qualifier; /**<call type*/
158 char disp_text[500 + 1]; /**<character data*/
159 char call_num[VC_PHONE_NUMBER_LENGTH_MAX];; /**<call number*/
160 unsigned int duration; /**<maximum repeat duration*/
161 } vcall_engine_sat_setup_call_info_t;
164 * This struct provides a structure for call incoming info data.
166 typedef struct _vcall_engine_incoming_info_t {
169 int cli_presentation_indicator;
170 char call_num[VC_PHONE_NUMBER_LENGTH_MAX];
171 int calling_name_mode;
172 char calling_name[VC_PHONE_NAME_LENGTH_MAX];
173 char redirected_number[VC_PHONE_NUMBER_LENGTH_MAX];
174 char redirected_sub_address[VC_PHONE_SUBADDRESS_LENGTH_MAX];
178 } vcall_engine_incoming_info_t;
180 /**< This is the prototype of the client callback function */
181 typedef gboolean(*vcall_engine_app_cb) (int event, void *pdata, void *puser_data);
183 gboolean vcall_engine_send_event_to_client(int event, void *pdata);
186 * This function initialize voice call engine.
188 * @return int API Result Code.
191 int vcall_engine_init(vcall_engine_app_cb pcb_func, void *pusr_data);
194 * This function processes mo nomal call.
196 * @return int API Result Code.
199 int vcall_engine_process_normal_call(char *number, int ct_index, gboolean b_download_call);
202 * This function processes mo emergency call.
204 * @return int API Result Code.
207 int vcall_engine_process_emergency_call(char *number);
209 int vcall_engine_process_sat_setup_call(vcall_engine_sat_setup_call_info_t *sat_setup_call_info);
212 * This function processes incoming call.
214 * @return int API Result Code.
217 int vcall_engine_process_incoming_call(vcall_engine_incoming_info_t *incoming_call_info);
220 * This function answers an incoming call
222 * @return int API Result Code.
225 int vcall_engine_answer_call(void);
228 * This function answers an incoming call according to the given type
230 * @return int API Result Code.
231 * @param[in] answer_type answer type
233 int vcall_engine_answer_call_by_type(vcall_engine_answer_type_t answer_type);
236 * This function cancel outgoing call
238 * @return int API Result Code.
241 int vcall_engine_cancel_call(void);
244 * This function reject incoming call
246 * @return int API Result Code.
249 int vcall_engine_reject_call(void);
252 * This function release a active or held call
254 * @return int API Result Code.
257 int vcall_engine_release_call(void);
260 * This function release a call by handle
262 * @return int API Result Code.
263 * @param[in] int call_handle
265 int vcall_engine_release_call_by_handle(int call_handle);
268 * This function release calls by type
270 * @return int API Result Code.
271 * @param[in] release_type release_type
273 int vcall_engine_release_call_by_type(vcall_engine_release_type_t release_type);
276 * This function processes hold/retrive/swap calls.
278 * @return int API Result Code.
281 int vcall_engine_process_hold_call(void);
284 * This function processes in call SS code..
289 void vcall_engine_process_incall_ss(char *number);
292 * This function sets up a conference calls
294 * @return int API Result Code.
297 int vcall_engine_join_call(void);
300 * This function make a private call in conference calls.
302 * @return int API Result Code.
303 * @param[in] int call_handle
305 int vcall_engine_split_call(int call_handle);
308 * This function transfers the call from active call to the held call
310 * @return int API Result Code.
311 * @param[in] int call_handle
313 int vcall_engine_transfer_call(void);
316 * This function processed loud speaker.
318 * @return int API Result Code.
319 * @param[in] int bstatus
321 int vcall_engine_process_loudspeaker(int bstatus);
324 * This function processed voice mute status.
326 * @return int API Result Code.
327 * @param[in] int bstatus
329 int vcall_engine_process_voice_mute(int bstatus);
332 * This function gets the volume level
334 * @return int API Result Code.
335 * @param[in] vcall_engine_vol_type_t vol_type
337 int vcall_engine_get_volume_level(vcall_engine_vol_type_t vol_type);
340 * This function sets the volume level
342 * @return int API Result Code.
343 * @param[in] vcall_engine_vol_type_t vol_type
344 * @param[in] int vol_level
346 int vcall_engine_set_volume_level(vcall_engine_vol_type_t vol_type, int vol_level);
349 * This function stop alert
351 * @return int API Result Code.
354 int vcall_engine_stop_alert(void);
357 * This function mute alert.
359 * @return int API Result Code.
362 int vcall_engine_mute_alert(void);
365 * This function process auto redial.
367 * @return int API Result Code.
368 * @param[in] int bstatus
370 int vcall_engine_process_auto_redial(int bstatus);
373 * This function process voice record.
375 * @return int API Result Code.
376 * @param[in] int bstatus
378 int vcall_engine_process_voice_record(int bstatus);
381 * This function send the DTMF number
383 * @return int API Result Code.
384 * @param[in] char* dtmf_number
386 int vcall_engine_send_dtmf_number(char *dtmf_number);
389 * This function processed sound path
391 * @return int API Result Code.
392 * @param[in] int sound_path
394 int vcall_engine_change_sound_path(vcall_engine_audio_type_t sound_path);
397 * This function get sound path
399 * @return int API Result Code.
400 * @param[out] int sound_path
402 int vcall_engine_get_sound_path(int *sound_path);
404 int vcall_engine_set_to_default();
407 * This function retrieves the core state instance
409 * @return instance of the core state
412 gpointer vcall_engine_get_core_state(void);
415 * This function is interface to call-utility to perform string copy
417 * @return instance of the core state
418 * @param[out] pbuffer Target Buffer
419 * @param[in] buf_count Size of Target Buffer
420 * @param[in] pstring Source String
422 gboolean vcall_engine_util_strcpy(char *pbuffer, int buf_count, const char *pstring);
425 * This function returns the number of groups
427 * @param[in] pcount count of the groups
429 gboolean vcall_engine_get_group_count(int *pcount);
432 * This function is interface to call-utility to perform string copy
434 * @return instance of the core state
435 * @param[out] pbuffer Target Buffer
436 * @param[in] time time
438 char *vcall_engine_util_get_date_time(time_t time);
441 * This function is force reset all engine status.
446 void vcall_engine_force_reset(void);
449 * This function will process the dtmf send request from UI
450 * It is executed when wait(w/W/;) is finished while sending a dtmf string
455 void vcall_engine_send_dtmf(gboolean bsuccess);
458 * This function processes emergency call for testing purpose.
460 * @return int API Result Code.
463 int vcall_engine_process_emergency_call_test(char *number);
466 * This function is interface to call-utility to check for ss string
468 * @return TRUE or FALSE if success/failure
469 * @param[in] call_number pointer to the number
471 gboolean vcall_engine_check_incall_ss_string(char *call_number);
474 * This function checks whether a given number is a SS string or not
476 * @return TRUE or FALSE if success/failure
477 * @param[in] call_number pointer to the number
479 gboolean vcall_engine_check_ss_string(char *call_number);
482 * This function controls the lcd state
485 * @param[in] lcd_state state of the lcd control
487 void vcall_engine_device_control_lcd_state(voicecall_lcd_control_t lcd_state);
489 #endif /* _VOICE_CALL_ENGINE_H_ */