Fixed N_SE-9138
authorJungmin Kim <jm15.kim@samsung.com>
Wed, 5 Sep 2012 13:24:00 +0000 (22:24 +0900)
committerJungmin Kim <jm15.kim@samsung.com>
Wed, 5 Sep 2012 13:26:37 +0000 (22:26 +0900)
Patch set 2:
Remove white space

Change-Id: I2dadc7b6a78ea9d9f50fe57815e4c3b55b131b5c

call-engine/core/include/vc-core-engine.h
call-engine/core/vc-core-engine.c
call-engine/include/voice-call-core.h
call-engine/voice-call-core.c

index 37b523f..453a19d 100644 (file)
@@ -380,6 +380,7 @@ voicecall_error_t _vc_core_engine_get_sat_dtmf_hidden_mode(voicecall_engine_t *p
 voicecall_error_t _vc_core_engine_send_sat_response(voicecall_engine_t *pvoicecall_agent, voicecall_engine_sat_rqst_resp_type sat_rqst_resp_type, call_vc_sat_reponse_type_t sat_response_type);
 
 voicecall_error_t _vc_core_engine_set_to_default_values(voicecall_engine_t *pvoicecall_agent);
+voicecall_error_t _vc_core_engine_check_incoming_handle(voicecall_engine_t *pvoicecall_agent, int call_id);
 
 /* Tapi response call back */
 void _vc_core_engine_dial_call_resp_cb(TapiHandle *handle, int result, void *tapi_data, void *user_data);
index d232cf2..be81dd3 100755 (executable)
@@ -2767,6 +2767,31 @@ voicecall_error_t _vc_core_engine_set_to_default_values(voicecall_engine_t *pvoi
        return ERROR_VOICECALL_NONE;
 }
 
+voicecall_error_t _vc_core_engine_check_incoming_handle(voicecall_engine_t *pvoicecall_agent, int call_id)
+{
+       CALL_ENG_DEBUG(ENG_DEBUG, "Start Incoming handle : %d", call_id);
+
+       call_vc_callagent_state_t *pcall_agent = (call_vc_callagent_state_t *)pvoicecall_agent;
+       TapiResult_t error = TAPI_API_SUCCESS;
+       TelCallStatus_t call_status;
+       memset(&call_status, 0x0, sizeof(TelCallStatus_t));
+
+       error = tel_get_call_status(pcall_agent->tapi_handle, call_id, &call_status);
+
+       if (error != TAPI_API_SUCCESS) {
+               /* If incoming call handle is not valid, terminate current incoming call */
+               CALL_ENG_DEBUG(ENG_DEBUG, "tel_get_call_status Error: %d", error);
+               CALL_ENG_DEBUG(ENG_DEBUG, "Adding Incoming End Event to Idle Callback");
+               _vc_core_ca_change_inout_state(pcall_agent, VC_INOUT_STATE_INCOME_END);
+
+               g_idle_add(__call_vc_incoming_call_end_idle_cb, pcall_agent);
+               return ERROR_VOICECALL_TAPI_ERROR;
+       }
+
+       CALL_ENG_DEBUG(ENG_DEBUG, "End");
+       return ERROR_VOICECALL_NONE;
+}
+
 void _vc_core_engine_dial_call_resp_cb(TapiHandle *handle, int result, void *tapi_data, void *user_data)
 {
        CALL_ENG_DEBUG(ENG_DEBUG, "_vc_core_engine_dial_call_resp_cb");
index ca8dc07..d4ccc98 100755 (executable)
@@ -94,10 +94,12 @@ typedef struct _call_vc_core_state_t {
        int mo_end_cause_type;                                          /**<MO call end cause type */
        int mo_end_call_handle;                                         /**<MO call end call handle */
        int mtcall_silent_reject_handle;
+       int mtcall_handle;                                              /**<MT call handle for checking validation */
        guint mo_redial_timer;
        guint minute_minder_timer;
 } call_vc_core_state_t;
-\r/**
+
+/**
  * This struct provides a structure for call incoming info data.
  */
 typedef struct _call_vc_core_incoming_info_t {
index f8535ba..c64e966 100755 (executable)
@@ -51,6 +51,7 @@ gboolean mo_redial_timer_cb(void *data);
 #define SET_PATH_TIMER_VALUE   50
 static guint g_set_path_timer_handler = 0;
 static gboolean __voicecall_core_set_path_timer_cb(gpointer puser_data);
+static gboolean __voicecall_core_check_incoming_handle(gpointer puser_data);
 
 /* For Debug Information, Call Engine Event name string constant */
 char *gszcall_engine_event[VC_ENGINE_EVENT_MAX] = {
@@ -1023,6 +1024,9 @@ static gboolean voicecall_core_cb(int event, int param1, int param2, void *param
                                                CALL_ENG_DEBUG(ENG_DEBUG, "2nd MT call alert.");
                                        }
                                        voicecall_snd_play_alert(pcall_core->papp_snd);
+
+                                       pcall_core->mtcall_handle = call_handle;
+                                       g_idle_add(__voicecall_core_check_incoming_handle, pcall_core);
                                }
                        }
                }
@@ -3704,3 +3708,21 @@ void voicecall_core_process_dtmf_send_status(call_vc_core_state_t *pcall_core, g
        __voicecall_core_handle_dtmf_ack(pcall_core, bsuccess);
 }
 
+/**
+ * This function checks validation of incoming handle
+ *
+ * @return             gboolean
+ * @param[in]          puser_data              Handle to voicecall core
+ */
+static gboolean __voicecall_core_check_incoming_handle(gpointer puser_data)
+{
+       call_vc_core_state_t *pcall_core = (call_vc_core_state_t *)puser_data;
+       VOICECALL_RETURN_FALSE_IF_FAIL(pcall_core);
+
+       _vc_core_engine_check_incoming_handle(pcall_core->pcall_engine, pcall_core->mtcall_handle);
+
+       return FALSE;
+}
+
+
+