Add call recovery logic 28/220128/1 accepted/tizen/unified/20191218.120949 submit/tizen/20191218.023530
authorsinikang <sinikang@samsung.com>
Fri, 13 Dec 2019 08:32:57 +0000 (17:32 +0900)
committersinikang <sinikang@samsung.com>
Fri, 13 Dec 2019 08:32:57 +0000 (17:32 +0900)
[Issue]
case 1)
If call-manager is launched later than telephony-daemon,
and incoming call is recevied without callmgr.service running,
call-manager can't receive this incoming call.

case2)
If call-manager is re-launched with any unexpected reason,
call-manager can't get the existed call list and call info.

[Solution]
When call-manager is lauching, getting call-list form tapi.
If there is existed call-list, calling up the corresponding callback function.

Change-Id: Ic96ba6ba9ffb4fd2a30fef57e60ab8d1426d92c5
Signed-off-by: sinikang <sinikang@samsung.com>
module/src/callmgr-telephony.c
packaging/call-manager.spec

index fc09b4ed845d39e65d466947380f9e795725816b..b483a74114da75ee2d5b4333b4f32a31ed86bffe 100644 (file)
@@ -1701,6 +1701,53 @@ static int __callmgr_telephony_get_network_mcc_mnc(callmgr_telephony_t telephony
        return 0;
 }
 
+static void __callmgr_telephony_recover_call(callmgr_telephony_t telephony_handle)
+{
+       dbg("__callmgr_telephony_recover_call");
+       CM_RETURN_IF_FAIL(telephony_handle);
+
+       __callmgr_telephony_get_all_call_list(telephony_handle);
+
+       cm_telephony_call_data_t *call = NULL;
+       _callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_INCOMING, &call);
+       if (call) {
+               dbg("recover incoming call");
+               telephony_handle->cb_fn(CM_TELEPHONY_EVENT_INCOMING, (void *)call, telephony_handle->user_data);
+               return;
+       }
+
+       _callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_DIALING, &call);
+       if (call) {
+               dbg("recover dialing call");
+               telephony_handle->cb_fn(CM_TELEPHONY_EVENT_DIALING, (void *)call->call_id, telephony_handle->user_data);
+               return;
+       }
+
+       _callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_ALERT, &call);
+       if (call) {
+               dbg("recover alerting call");
+               telephony_handle->cb_fn(CM_TELEPHONY_EVENT_DIALING, (void *)call->call_id, telephony_handle->user_data);
+               telephony_handle->cb_fn(CM_TELEPHONY_EVENT_ALERT, (void *)call->call_id, telephony_handle->user_data);
+               return;
+       }
+
+       _callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &call);
+       if (call) {
+               dbg("recover active call");
+               telephony_handle->cb_fn(CM_TELEPHONY_EVENT_ACTIVE, (void *)call->call_id, telephony_handle->user_data);
+               return;
+       }
+
+       _callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_HELD, &call);
+       if (call) {
+               dbg("recover held call");
+               telephony_handle->cb_fn(CM_TELEPHONY_EVENT_HELD, (void *)call->call_id, telephony_handle->user_data);
+               return;
+       }
+
+       err("No call data to recover");
+}
+
 static int __callmgr_telephony_init(callmgr_telephony_t telephony_handle)
 {
        CM_RETURN_VAL_IF_FAIL(telephony_handle, -1);
@@ -1770,6 +1817,7 @@ static int __callmgr_telephony_init(callmgr_telephony_t telephony_handle)
                telephony_handle->active_sim_slot = CM_TELEPHONY_SIM_1;
        }
 
+       __callmgr_telephony_recover_call(telephony_handle);
        return 0;
 }
 
index 6bc93ea0192ef0f2604a09f780a76f3c2ae2a05b..f9604d9459dc7a3a22ad9d745c5dd4d22c290a61 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 2
-%define patchlevel 61
+%define patchlevel 62
 %define ext_feature 0
 
 Name:           call-manager