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.
17 #ifndef __VC_CORE_CALL_AGENT_H_
18 #define __VC_CORE_CALL_AGENT_H_
21 #include "vc-core-callmanager.h"
23 #include "status-interface.h"
26 /**< Maximum Telephony Event */
27 #define CALL_VC_TAPI_CALL_EVENT_MAX_NUM 33
28 #define CALL_VC_SIMATK_EVENT_MAX_NUM 3 /**< Maximum SIM ATK Event */
29 #define CALL_VC_TAPI_READY_EVENT_NUM 1 /**< Tapi Service Ready Event */
30 #define CALL_VC_TAPI_FACTORY_EVENT_NUM 1 /**< Tapi Service FACTORY Event */
31 #define CALL_VC_TAPI_SUBSCRIPTION_MAX (CALL_VC_TAPI_CALL_EVENT_MAX_NUM+CALL_VC_TAPI_READY_EVENT_NUM+CALL_VC_SIMATK_EVENT_MAX_NUM+CALL_VC_TAPI_FACTORY_EVENT_NUM)
34 * This enumeration provides CA STATEs
37 CALL_VC_CA_STATE_NORMAL, /**< Normal state */
38 CALL_VC_CA_STATE_SPLIT_CALLBOX, /**< Call split state */
39 CALL_VC_CA_STATE_WAIT_SPLIT, /**< Waiting for call split state */
40 CALL_VC_CA_STATE_DROP_CALLBOX, /**< Call drop state */
41 CALL_VC_CA_STATE_WAIT_DROP, /**< Waiting for drop state */
43 CALL_VC_CA_STATE_WAIT_SWAP_HOLD_OR_ACTIVATE, /**< Wait for swapping activce/hold call state */
44 CALL_VC_CA_STATE_WAIT_SWAP_HOLD, /**< Wait for swapping held call state */
45 CALL_VC_CA_STATE_WAIT_SWAP_ACTIVE, /**< Wait for swapping active call state */
47 CALL_VC_CA_STATE_WAIT_SWAP, /**< Wait for swap state */
48 CALL_VC_CA_STATE_WAIT_HOLD, /**< Wait for hold state */
49 CALL_VC_CA_STATE_WAIT_UNHOLD, /**< Wait for unhold state */
50 CALL_VC_CA_STATE_WAIT_JOIN, /**< Wait for join state */
51 CALL_VC_CA_STATE_WAIT_TRANSFER_CNF, /**< Wait for transfer confirmation state */
52 CALL_VC_CA_STATE_WAIT_TRANSFER_CALLEND, /**< Wait for transfer callend state */
53 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_ACTIVECALL, /**< Wait for release all active call state */
54 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_HOLDCALL, /**< Wait for release all held call state */
55 CALL_VC_CA_STATE_SENDMSG_CALLBOX, /**< Message send callbox active state */
56 CALL_VC_CA_STATE_VIEW_CONTACT_DETAIL_CALLBOX, /**< Contact detail view state */
57 CALL_VC_CA_STATE_SAVE_TO_CONTACT_CALLBOX, /**< Save to contact state */
58 CALL_VC_CA_STATE_SS_WAIT_RELEASE_ALL_ACTIVECALL, /**< Wait for release all active calls */
59 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_CALLS, /**< Wait for release all calls */
60 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_CALLS_TO_SETUP, /**< Wait for release all calls to setup */
61 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_CALLS_TO_SWITCH_TO_VIDEO_CALL,/**< Wait for release all calls to setup videocall */
62 CALL_VC_CA_STATE_MAX_NUM /**< Max value for the state */
66 * This structure defines voicecall agent data
68 typedef struct _voicecall_engine_t {
69 TapiHandle *tapi_handle;
70 call_vc_ca_state_t callagent_state; /**< Call Agent State */
71 voicecall_inout_state_t io_state; /**< Voicecall Engine IO State */
72 call_vc_manager_t call_manager; /**< Handle for the Call Manager */
73 TelSimCardType_t card_type; /**< SIM Card Type */
75 gboolean bdtmf_ring; /**< dtmf ring? */
77 gboolean bis_no_sim; /**< SIM not available , if TRUE */
78 gboolean bdownload_call; /**< Automated call test after binary download , if TRUE */
80 /*No structure in TAPI 14Mar08 */
81 /*tapi_call_ccbs_info_t ccbs_info[CALL_VC_CCBS_NUMBER_MAX]; < call control for busy subscriber info */
82 int ccbs_index; /**< Index for ccbs_info*/
84 int barring_ind_type; /* barring ind type */
86 float aoc_ppm; /**< Price per unit value of currency meter */
90 status_class_cphs_type cphs_status; /**< stores the cphs status information*/
91 gboolean bcphs_read_success; /**< Flag for CPHS read status*/
94 /*Subscription Information */
95 unsigned int subscription_id[CALL_VC_TAPI_SUBSCRIPTION_MAX];
98 /*Client Information */
99 voicecall_cb client_callback; /**<Callback fucntion to send event to client*/
100 void *puser_data; /**<Stores the User data set during engine initialization*/
102 } call_vc_callagent_state_t;
105 * This function intializes the call agent
107 * @return Pointer to call agent state.
109 call_vc_callagent_state_t *_vc_core_ca_init_agent();
112 * This function changes the in out state of the call agent
114 * @return This function returns TRUE on success and FALSE on failure
115 * @param[in] pAgent Pointer to the call agent structure
116 * @param[in] new_state The new i/o state that should be set
117 * @see _vc_core_ca_change_agent_state
119 gboolean _vc_core_ca_change_inout_state(call_vc_callagent_state_t *pAgent, voicecall_inout_state_t new_state);
122 * This function changes the in call agent state
124 * @return This function returns TRUE on success and FALSE on failure
125 * @param[in] pAgent Pointer to the call agent structure
126 * @param[in] new_state The new call agent state that should be set
127 * @see _vc_core_ca_change_inout_state
129 gboolean _vc_core_ca_change_agent_state(call_vc_callagent_state_t *pAgent, call_vc_ca_state_t new_state);
132 * This function finalizes the call agent
134 * @return Returns void
135 * @param[in] pcall_agent Pointer to the call agent structure
137 void _vc_core_ca_finish_agent(call_vc_callagent_state_t *pcall_agent);
140 * This function checks if all the call members have terminated or not
142 * @return Returns TRUE if no call members exist, FALSE otherwise
143 * @param[in] pagent Pointer to the call agent structure
145 gboolean _vc_core_ca_check_end(call_vc_callagent_state_t *pagent);
148 * This function ends all the calls
150 * @return Returns TRUE on success and FALSE on failure
151 * @param[in] pagent Handle to voicecall engine
153 gboolean _vc_core_ca_end_all_calls(call_vc_callagent_state_t *pagent);
156 * This function ends all the active calls
158 * @return Returns TRUE on success and FALSE on failure
159 * @param[in] pagent Handle to voicecall engine
161 gboolean _vc_core_ca_end_active_calls(call_vc_callagent_state_t *pagent);
164 * This function ends all the held calls
166 * @return Returns TRUE on success and FALSE on failure
167 * @param[in] pagent Handle to voicecall engine
169 gboolean _vc_core_ca_end_held_calls(call_vc_callagent_state_t *pagent);
172 * This function sends the response to the SAT engine
174 * @return This function returns TRUE on success and FALSE on failure
175 * @param[in] pagent Pointer to the call agent structure
176 * @param[in] sat_rqst_resp_type sat rquest/response type used by the client
177 * @param[in] sat_response_type response to be sent to sat
179 gboolean _vc_core_ca_send_sat_response(call_vc_callagent_state_t *pagent, voicecall_engine_sat_rqst_resp_type sat_rqst_Resp_type, call_vc_sat_reponse_type_t sat_response_type);
182 * This function intializes the callagent data
185 * @param[in] pagent Pointer to the call agent structure
187 void _vc_core_ca_init_data(call_vc_callagent_state_t *pagent);
190 * This function sends response event to the registered client
192 * @return This function returns TRUE on success and FALSE on failure
193 * @param[in] pcall_agent Pointer to the call agent structure
194 * @param[in] event response event type
195 * @param[in] param1 param 1 to be passed to the client
196 * @param[in] param2 param 2 to be passed to the client
197 * @param[in] param3 param 3 to be passed to the client
199 gboolean _vc_core_ca_send_event_to_client(call_vc_callagent_state_t *pcall_agent, int event, int param1, int param2, void *param3);
202 * This function checks whether outgoing call is possible
204 * @return This function returns TRUE if outgoing call is possible or else FALSE
205 * @param[in] pcall_agent Pointer to the call agent structure
206 * @param[in] bemergency_number TRUE - if outgoing call being made is emergency call or else FALSE
208 gboolean _vc_core_ca_is_mocall_possible(call_vc_callagent_state_t *pcall_agent, gboolean bemergency_number);
211 * This function checks whether private call is possible or not
213 * @return This function returns TRUE if private call is possible or else FALSE
214 * @param[in] pcall_agent Pointer to the call agent structure
216 gboolean _vc_core_ca_is_private_call_possible(call_vc_callagent_state_t *pcall_agent);
219 * This function checks whether call transfer is possible
221 * @return This function returns TRUE if transfer is possible or else FALSE
222 * @param[in] pcall_agent Pointer to the call agent structure
224 gboolean _vc_core_ca_is_transfer_call_possible(call_vc_callagent_state_t *pcall_agent);
227 * This function checks whether conference call is possible
229 * @return This function returns TRUE if transfer is possible or else FALSE
230 * @param[in] pcall_agent Pointer to the call agent structure
232 gboolean _vc_core_ca_is_conf_call_possible(call_vc_callagent_state_t *pcall_agent);
235 * This function clears the data of a connected call givenits call handle
237 * @return Returns TRUE on success and FALSE on failure
238 * @param[in] pcall_agent Handle to voicecall engine
239 * @param[in] call_handle Call handle of the connected call to be cleared
241 gboolean _vc_core_ca_clear_connected_call(call_vc_callagent_state_t *pcall_agent, int call_handle);
243 #endif /* __VC_CORE_CALL_AGENT_H_ */