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 */
42 CALL_VC_CA_STATE_WAIT_SWAP_HOLD_OR_ACTIVATE, /**< Wait for swapping activce/hold call state */
43 CALL_VC_CA_STATE_WAIT_SWAP_HOLD, /**< Wait for swapping held call state */
44 CALL_VC_CA_STATE_WAIT_SWAP_ACTIVE, /**< Wait for swapping active call state */
45 CALL_VC_CA_STATE_WAIT_SWAP, /**< Wait for swap state */
46 CALL_VC_CA_STATE_WAIT_HOLD, /**< Wait for hold state */
47 CALL_VC_CA_STATE_WAIT_UNHOLD, /**< Wait for unhold state */
48 CALL_VC_CA_STATE_WAIT_JOIN, /**< Wait for join state */
49 CALL_VC_CA_STATE_WAIT_TRANSFER_CNF, /**< Wait for transfer confirmation state */
50 CALL_VC_CA_STATE_WAIT_TRANSFER_CALLEND, /**< Wait for transfer callend state */
51 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_ACTIVECALL, /**< Wait for release all active call state */
52 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_HOLDCALL, /**< Wait for release all held call state */
53 CALL_VC_CA_STATE_SENDMSG_CALLBOX, /**< Message send callbox active state */
54 CALL_VC_CA_STATE_VIEW_CONTACT_DETAIL_CALLBOX, /**< Contact detail view state */
55 CALL_VC_CA_STATE_SAVE_TO_CONTACT_CALLBOX, /**< Save to contact state */
56 CALL_VC_CA_STATE_SS_WAIT_RELEASE_ALL_ACTIVECALL, /**< Wait for release all active calls */
57 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_CALLS, /**< Wait for release all calls */
58 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_CALLS_TO_SETUP, /**< Wait for release all calls to setup */
59 CALL_VC_CA_STATE_WAIT_RELEASE_ALL_CALLS_TO_SWITCH_TO_VIDEO_CALL,/**< Wait for release all calls to setup videocall */
60 CALL_VC_CA_STATE_MAX_NUM /**< Max value for the state */
64 * This structure defines voicecall agent data
66 typedef struct _voicecall_engine_t {
67 TapiHandle *tapi_handle;
68 call_vc_ca_state_t callagent_state; /**< Call Agent State */
69 voicecall_inout_state_t io_state; /**< Voicecall Engine IO State */
70 call_vc_manager_t call_manager; /**< Handle for the Call Manager */
71 TelSimCardType_t card_type; /**< SIM Card Type */
73 gboolean bdtmf_ring; /**< dtmf ring? */
75 gboolean bis_no_sim; /**< SIM not available , if TRUE */
76 gboolean bdownload_call; /**< Automated call test after binary download , if TRUE */
78 /*No structure in TAPI 14Mar08 */
79 /*tapi_call_ccbs_info_t ccbs_info[CALL_VC_CCBS_NUMBER_MAX]; < call control for busy subscriber info */
80 int ccbs_index; /**< Index for ccbs_info*/
82 int barring_ind_type; /* barring ind type */
84 float aoc_ppm; /**< Price per unit value of currency meter */
88 status_class_cphs_type cphs_status; /**< stores the cphs status information*/
89 gboolean bcphs_read_success; /**< Flag for CPHS read status*/
92 /*Subscription Information */
93 unsigned int subscription_id[CALL_VC_TAPI_SUBSCRIPTION_MAX];
96 /*Client Information */
97 voicecall_cb client_callback; /**<Callback fucntion to send event to client*/
98 void *puser_data; /**<Stores the User data set during engine initialization*/
100 } call_vc_callagent_state_t;
103 * This function intializes the call agent
105 * @return Pointer to call agent state.
107 call_vc_callagent_state_t *_vc_core_ca_init_agent();
110 * This function changes the in out state of the call agent
112 * @return This function returns TRUE on success and FALSE on failure
113 * @param[in] pAgent Pointer to the call agent structure
114 * @param[in] new_state The new i/o state that should be set
115 * @see _vc_core_ca_change_agent_state
117 gboolean _vc_core_ca_change_inout_state(call_vc_callagent_state_t *pAgent, voicecall_inout_state_t new_state);
120 * This function changes the in call agent state
122 * @return This function returns TRUE on success and FALSE on failure
123 * @param[in] pAgent Pointer to the call agent structure
124 * @param[in] new_state The new call agent state that should be set
125 * @see _vc_core_ca_change_inout_state
127 gboolean _vc_core_ca_change_agent_state(call_vc_callagent_state_t *pAgent, call_vc_ca_state_t new_state);
130 * This function finalizes the call agent
132 * @return Returns void
133 * @param[in] pcall_agent Pointer to the call agent structure
135 void _vc_core_ca_finish_agent(call_vc_callagent_state_t *pcall_agent);
138 * This function checks if all the call members have terminated or not
140 * @return Returns TRUE if no call members exist, FALSE otherwise
141 * @param[in] pagent Pointer to the call agent structure
143 gboolean _vc_core_ca_check_end(call_vc_callagent_state_t *pagent);
146 * This function ends all the calls
148 * @return Returns TRUE on success and FALSE on failure
149 * @param[in] pagent Handle to voicecall engine
151 gboolean _vc_core_ca_end_all_calls(call_vc_callagent_state_t *pagent);
154 * This function ends all the active calls
156 * @return Returns TRUE on success and FALSE on failure
157 * @param[in] pagent Handle to voicecall engine
159 gboolean _vc_core_ca_end_active_calls(call_vc_callagent_state_t *pagent);
162 * This function ends all the held calls
164 * @return Returns TRUE on success and FALSE on failure
165 * @param[in] pagent Handle to voicecall engine
167 gboolean _vc_core_ca_end_held_calls(call_vc_callagent_state_t *pagent);
170 * This function sends the response to the SAT engine
172 * @return This function returns TRUE on success and FALSE on failure
173 * @param[in] pagent Pointer to the call agent structure
174 * @param[in] sat_rqst_resp_type sat rquest/response type used by the client
175 * @param[in] sat_response_type response to be sent to sat
177 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);
180 * This function intializes the callagent data
183 * @param[in] pagent Pointer to the call agent structure
185 void _vc_core_ca_init_data(call_vc_callagent_state_t *pagent);
188 * This function sends response event to the registered client
190 * @return This function returns TRUE on success and FALSE on failure
191 * @param[in] pcall_agent Pointer to the call agent structure
192 * @param[in] event response event type
193 * @param[in] param1 param 1 to be passed to the client
194 * @param[in] param2 param 2 to be passed to the client
195 * @param[in] param3 param 3 to be passed to the client
197 gboolean _vc_core_ca_send_event_to_client(call_vc_callagent_state_t *pcall_agent, int event, int param1, int param2, void *param3);
200 * This function checks whether outgoing call is possible
202 * @return This function returns TRUE if outgoing call is possible or else FALSE
203 * @param[in] pcall_agent Pointer to the call agent structure
204 * @param[in] bemergency_number TRUE - if outgoing call being made is emergency call or else FALSE
206 gboolean _vc_core_ca_is_mocall_possible(call_vc_callagent_state_t *pcall_agent, gboolean bemergency_number);
209 * This function checks whether private call is possible or not
211 * @return This function returns TRUE if private call is possible or else FALSE
212 * @param[in] pcall_agent Pointer to the call agent structure
214 gboolean _vc_core_ca_is_private_call_possible(call_vc_callagent_state_t *pcall_agent);
217 * This function checks whether call transfer is possible
219 * @return This function returns TRUE if transfer is possible or else FALSE
220 * @param[in] pcall_agent Pointer to the call agent structure
222 gboolean _vc_core_ca_is_transfer_call_possible(call_vc_callagent_state_t *pcall_agent);
225 * This function checks whether conference call is possible
227 * @return This function returns TRUE if transfer is possible or else FALSE
228 * @param[in] pcall_agent Pointer to the call agent structure
230 gboolean _vc_core_ca_is_conf_call_possible(call_vc_callagent_state_t *pcall_agent);
233 * This function clears the data of a connected call givenits call handle
235 * @return Returns TRUE on success and FALSE on failure
236 * @param[in] pcall_agent Handle to voicecall engine
237 * @param[in] call_handle Call handle of the connected call to be cleared
239 gboolean _vc_core_ca_clear_connected_call(call_vc_callagent_state_t *pcall_agent, int call_handle);
241 #endif /* __VC_CORE_CALL_AGENT_H_ */