CallType callType = TYPE_UNDEFINED_CALL;
String phoneNumber;
int callId = 0;
+ int err = 0;
_CallManagerImpl* pCallManagerImpl = static_cast <_CallManagerImpl*>(pUserData);
+ pCallManagerImpl->__curCallState = CALL_STATUS_IDLE;
if (strcmp(pNotiId, TAPI_NOTI_VOICE_CALL_STATUS_IDLE) == 0
|| strcmp(pNotiId,TAPI_NOTI_VIDEO_CALL_STATUS_IDLE) == 0)
{
TelCallStatusIdleNoti_t* pNotiData = (TelCallStatusIdleNoti_t*)pData;
callId = pNotiData->id;
- pCallManagerImpl->__curCallState = CALL_STATUS_IDLE;
+
+ err = tel_get_call_status_all(pHandle, OnCallStatusCallback, pCallManagerImpl);
+ SysLog(NID_TEL, "The tel_get_call_status_all() returned %d value", err);
}
else
{
callId = pNotiData->id;
}
- int err = tel_get_call_status_all(pHandle, OnCallStatusCallback, pCallManagerImpl);
+ err = tel_get_call_status_all(pHandle, OnCallStatusCallback, pCallManagerImpl);
SysLog(NID_TEL, "The tel_get_call_status_all() returned %d value", err);
phoneNumber = pCallManagerImpl->GetPhoneNumber(pHandle, callId);
void
_CallManagerImpl::OnTelephonyCallForwardResponseReceived(Tizen::Base::String phoneNumber, result r)
-{
+{
SysLog(NID_TEL, "The listener has called with result %s and phonenumber is %ls", GetErrorMessage(r), phoneNumber.GetPointer());
_CallForwardEventArg* pEventArg = new (std::nothrow)_CallForwardEventArg(_CALL_FORWARD_EVENT_RESPONSE_RECEIVED, phoneNumber, r);
}
}
+
void
_CallManagerImpl::OnCallStatusCallback(TelCallStatus_t* status, void* pUserData)
{
_CallManagerImpl* pImpl = static_cast<_CallManagerImpl*>(pUserData);
- // Priority : Ringing/Dialing > Communicating > Hold
- // ToDO : multi party call scenario
+ CallStatus tempCallStatus = CALL_STATUS_IDLE;
switch (status->CallState)
{
case TAPI_CALL_STATE_IDLE:
- pImpl->__curCallState = CALL_STATUS_IDLE;
+ tempCallStatus = CALL_STATUS_IDLE;
break;
case TAPI_CALL_STATE_ACTIVE:
- pImpl->__curCallState = CALL_STATUS_COMMUNICATING;
+ tempCallStatus = CALL_STATUS_COMMUNICATING;
break;
case TAPI_CALL_STATE_HELD:
- pImpl->__curCallState = CALL_STATUS_HOLDING;
+ tempCallStatus = CALL_STATUS_HOLDING;
break;
case TAPI_CALL_STATE_INCOMING:
- pImpl->__curCallState = CALL_STATUS_RINGING;
+ tempCallStatus = CALL_STATUS_RINGING;
break;
case TAPI_CALL_STATE_DIALING:
case TAPI_CALL_STATE_ALERT:
- pImpl->__curCallState = CALL_STATUS_DIALING;
+ tempCallStatus = CALL_STATUS_DIALING;
break;
default:
break;
}
+ if (tempCallStatus == CALL_STATUS_RINGING)
+ {
+ pImpl->__curCallState = CALL_STATUS_RINGING;
+ }
+ else if ((tempCallStatus == CALL_STATUS_DIALING) && (pImpl->__curCallState != CALL_STATUS_RINGING))
+ {
+ pImpl->__curCallState = CALL_STATUS_DIALING;
+ }
+ else if ((tempCallStatus == CALL_STATUS_COMMUNICATING) && (pImpl->__curCallState != CALL_STATUS_RINGING) && (pImpl->__curCallState != CALL_STATUS_DIALING))
+ {
+ pImpl->__curCallState = CALL_STATUS_COMMUNICATING;
+ }
+ else if ((tempCallStatus == CALL_STATUS_HOLDING) && (pImpl->__curCallState != CALL_STATUS_RINGING) && (pImpl->__curCallState != CALL_STATUS_DIALING) && (pImpl->__curCallState != CALL_STATUS_COMMUNICATING))
+ {
+ pImpl->__curCallState = CALL_STATUS_HOLDING;
+ }
+
return;
}
int err = TAPI_API_SUCCESS;
result r = E_SUCCESS;
+ __curCallState = CALL_STATUS_IDLE;
err = tel_get_call_status_all(__pHandle, OnCallStatusCallback, this);
SysLog(NID_TEL, "The tel_get_call_status_all() returned %d value", err);