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 __VC_CORE_CALL_AGENT_H_
19 #define __VC_CORE_CALL_AGENT_H_
22 #include "vc-core-callmanager.h"
24 #include "status-interface.h"
27 /**< Maximum Telephony Event */
28 #define CALL_VC_TAPI_CALL_EVENT_MAX_NUM 33
29 #define CALL_VC_SIMATK_EVENT_MAX_NUM 3 /**< Maximum SIM ATK Event */
30 #define CALL_VC_TAPI_READY_EVENT_NUM 1 /**< Tapi Service Ready 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)
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 call_vc_ca_state_t callagent_state; /**< Call Agent State */
70 voicecall_inout_state_t io_state; /**< Voicecall Engine IO State */
71 call_vc_manager_t call_manager; /**< Handle for the Call Manager */
72 TelSimCardType_t card_type; /**< SIM Card Type */
74 gboolean bdtmf_ring; /**< dtmf ring? */
76 gboolean bonly_sos_call; /**< only SOS calls possible , if TRUE */
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*/
85 float aoc_ppm; /**< Price per unit value of currency meter */
89 status_class_cphs_type cphs_status; /**< stores the cphs status information*/
90 gboolean bcphs_read_success; /**< Flag for CPHS read status*/
93 /*Subscription Information */
94 unsigned int subscription_id[CALL_VC_TAPI_SUBSCRIPTION_MAX];
97 /*Client Information */
98 voicecall_cb client_callback; /**<Callback fucntion to send event to client*/
99 void *puser_data; /**<Stores the User data set during engine initialization*/
101 } call_vc_callagent_state_t;
104 * This function intializes the call agent
106 * @return Pointer to call agent state.
108 call_vc_callagent_state_t *_vc_core_ca_init_agent();
111 * This function changes the in out state of the call agent
113 * @return This function returns TRUE on success and FALSE on failure
114 * @param[in] pAgent Pointer to the call agent structure
115 * @param[in] new_state The new i/o state that should be set
116 * @see _vc_core_ca_change_agent_state
118 gboolean _vc_core_ca_change_inout_state(call_vc_callagent_state_t *pAgent, voicecall_inout_state_t new_state);
121 * This function changes the in call agent state
123 * @return This function returns TRUE on success and FALSE on failure
124 * @param[in] pAgent Pointer to the call agent structure
125 * @param[in] new_state The new call agent state that should be set
126 * @see _vc_core_ca_change_inout_state
128 gboolean _vc_core_ca_change_agent_state(call_vc_callagent_state_t *pAgent, call_vc_ca_state_t new_state);
131 * This function finalizes the call agent
133 * @return Returns void
134 * @param[in] pcall_agent Pointer to the call agent structure
136 void _vc_core_ca_finish_agent(call_vc_callagent_state_t *pcall_agent);
139 * This function checks if all the call members have terminated or not
141 * @return Returns TRUE if no call members exist, FALSE otherwise
142 * @param[in] pagent Pointer to the call agent structure
144 gboolean _vc_core_ca_check_end(call_vc_callagent_state_t *pagent);
147 * This function ends all the calls
149 * @return Returns TRUE on success and FALSE on failure
150 * @param[in] pagent Handle to voicecall engine
152 gboolean _vc_core_ca_end_all_calls(call_vc_callagent_state_t *pagent);
155 * This function ends all the active calls
157 * @return Returns TRUE on success and FALSE on failure
158 * @param[in] pagent Handle to voicecall engine
160 gboolean _vc_core_ca_end_active_calls(call_vc_callagent_state_t *pagent);
163 * This function ends all the held calls
165 * @return Returns TRUE on success and FALSE on failure
166 * @param[in] pagent Handle to voicecall engine
168 gboolean _vc_core_ca_end_held_calls(call_vc_callagent_state_t *pagent);
171 * This function sends the response to the SAT engine
173 * @return This function returns TRUE on success and FALSE on failure
174 * @param[in] pagent Pointer to the call agent structure
175 * @param[in] sat_rqst_resp_type sat rquest/response type used by the client
176 * @param[in] sat_response_type response to be sent to sat
178 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);
181 * This function intializes the callagent data
184 * @param[in] pagent Pointer to the call agent structure
186 void _vc_core_ca_init_data(call_vc_callagent_state_t *pagent);
189 * This function sends response event to the registered client
191 * @return This function returns TRUE on success and FALSE on failure
192 * @param[in] pcall_agent Pointer to the call agent structure
193 * @param[in] event response event type
194 * @param[in] param1 param 1 to be passed to the client
195 * @param[in] param2 param 2 to be passed to the client
196 * @param[in] param3 param 3 to be passed to the client
198 gboolean _vc_core_ca_send_event_to_client(call_vc_callagent_state_t *pcall_agent, int event, int param1, int param2, void *param3);
201 * This function checks whether outgoing call is possible
203 * @return This function returns TRUE if outgoing call is possible or else FALSE
204 * @param[in] pcall_agent Pointer to the call agent structure
205 * @param[in] bemergency_number TRUE - if outgoing call being made is emergency call or else FALSE
207 gboolean _vc_core_ca_is_mocall_possible(call_vc_callagent_state_t *pcall_agent, gboolean bemergency_number);
210 * This function checks whether private call is possible or not
212 * @return This function returns TRUE if private call is possible or else FALSE
213 * @param[in] pcall_agent Pointer to the call agent structure
215 gboolean _vc_core_ca_is_private_call_possible(call_vc_callagent_state_t *pcall_agent);
218 * This function checks whether call transfer is possible
220 * @return This function returns TRUE if transfer is possible or else FALSE
221 * @param[in] pcall_agent Pointer to the call agent structure
223 gboolean _vc_core_ca_is_transfer_call_possible(call_vc_callagent_state_t *pcall_agent);
226 * This function checks whether conference call is possible
228 * @return This function returns TRUE if transfer is possible or else FALSE
229 * @param[in] pcall_agent Pointer to the call agent structure
231 gboolean _vc_core_ca_is_conf_call_possible(call_vc_callagent_state_t *pcall_agent);
234 * This function clears the data of a connected call givenits call handle
236 * @return Returns TRUE on success and FALSE on failure
237 * @param[in] pcall_agent Handle to voicecall engine
238 * @param[in] call_handle Call handle of the connected call to be cleared
240 gboolean _vc_core_ca_clear_connected_call(call_vc_callagent_state_t *pcall_agent, int call_handle);
242 #endif /* __VC_CORE_CALL_AGENT_H_ */