#include <FTelephony.h>
#include "ITapiModem.h"
#include "ITapiSim.h"
+#include "CallApp.h"
#include "CallInfo.h"
#include "CallTelephonyManager.h"
#include "CallSettingsManager.h"
using namespace Tizen::System;
using namespace Tizen::Base::Collection;
using namespace Tizen::Telephony;
+using namespace Tizen::Base::Utility;
const char* callEventList[] = {
TAPI_NOTI_VOICE_CALL_STATUS_IDLE,
TelephonyManager::EndActiveCall(Long callHandle)
{
result r = E_FAILURE;
-
//fetch ended callInfo from active call list
AppCallInfo endCall;
r = __pActiveCallList->GetValue(callHandle.ToLong(), endCall);
{
r = EndCall(endCall);
}
+
return r;
}
//Call connected successfully
r = E_SUCCESS;
//Add calls information to call log before deleting from active call list.
- /*IListT<AppCallInfo>* pCallList = pEndCallsList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = pEndCallsList->GetValuesN();
if(pCallList != null)
{
AppCallInfo endCallInfo;
SaveCallInfoToLogsDb(endCallInfo);
}
delete pCallList;
- }*/
+ }
pEndCallsList->RemoveAll();
delete pEndCallsList;
}
//Incoming Call connected successfully
r = E_SUCCESS;
//save to ended call to call logs db.
- //SaveCallInfoToLogsDb(callToBeEnded);
+ SaveCallInfoToLogsDb(callToBeEnded);
}
break;
break;
}
//"Held" call successfully ended - Add call ended to call log database
- //SaveCallInfoToLogsDb(callToBeEnded);
+ SaveCallInfoToLogsDb(callToBeEnded);
//accept incoming call by Holding "Active" call using "TAPI_CALL_ANSWER_HOLD_AND_ACCEPT".
res = tel_answer_call(__pTapiHandle, incomingCallHandle, TAPI_CALL_ANSWER_HOLD_AND_ACCEPT, &HandleCallbackResponse, this);
IListT<AppCallInfo>* pCallList = pEndCallsList->GetValuesN();
if(pCallList != null)
{
-/* int callCount = pCallList->GetCount();
+ int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
AppCallInfo endCallInfo;
{
SaveCallInfoToLogsDb(endCallInfo);
}
- }*/
+ }
delete pCallList;
pCallList = null;
}
pConfCallInfo->AddCallToCallerList(heldCall);
pConfCallInfo->SetCallHandle(activeCallHandle);
//Set call start time
- if (pConfCallInfo->GetCallConnectTime() > heldCall.GetCallConnectTime())
+ //if (pConfCallInfo->GetCallConnectTime() > heldCall.GetCallConnectTime())
+ if (pConfCallInfo->GetDurationTime() > heldCall.GetDurationTime())
{
pConfCallInfo->SetCallConnectTime(heldCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(heldCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(heldCall.GetCallNotificationTime());
}
}
pConfCallInfo->AddCallToCallerList(activeCall);
pConfCallInfo->SetCallHandle(heldCallHandle);
//Set call start time
- if (pConfCallInfo->GetCallConnectTime() > activeCall.GetCallConnectTime())
+ //if (pConfCallInfo->GetCallConnectTime() > activeCall.GetCallConnectTime())
+ if (pConfCallInfo->GetDurationTime() > activeCall.GetDurationTime())
{
pConfCallInfo->SetCallConnectTime(activeCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(activeCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(activeCall.GetCallNotificationTime());
}
}
pConfCallInfo->AddCallToCallerList(heldCall);
pConfCallInfo->SetCallHandle(activeCallHandle);
//Set call start time
- if (activeCall.GetCallConnectTime() > heldCall.GetCallConnectTime())
+ //if (activeCall.GetCallConnectTime() > heldCall.GetCallConnectTime())
+ if (activeCall.GetDurationTime() > heldCall.GetDurationTime())
{
pConfCallInfo->SetCallConnectTime(heldCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(heldCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(heldCall.GetCallNotificationTime());
}
else
{
pConfCallInfo->SetCallConnectTime(activeCall.GetCallConnectTime());
+ pConfCallInfo->SetDurationTime(activeCall.GetDurationTime());
pConfCallInfo->SetCallNotificationTime(activeCall.GetCallNotificationTime());
}
}
conferenceCall.RemoveCallFromCallerList(index);
//update its status to individual call before saving to database
callToBeEnded.SetConference(false);
- // SaveCallInfoToLogsDb(callToBeEnded);
+ SaveCallInfoToLogsDb(callToBeEnded);
isParticipantCallEnded = true;
break;
}
AppLog("ENTER");
//This callback comes only if a conference call is ended by user.
TelephonyManager* pTelManager = (TelephonyManager*) pUserData;
+ AppCallInfo heldCall;
if (callBackResult == TAPI_CAUSE_SUCCESS && pData != null)
{
//fetch ended confCall details
//remove the conference call handle from active call list to avoid any processing in HandleIdleCallback().
pTelManager->__pActiveCallList->Remove(endConfCallInfo.GetCallHandle()->ToLong());
//Save "End" Conf. call info to call log database
- // pTelManager->SaveCallInfoToLogsDb(endConfCallInfo);
+ pTelManager->SaveCallInfoToLogsDb(endConfCallInfo);
//check if the ended call was the last call and show notification to user
bool isLastCall = (pTelManager->__pActiveCallList->GetCount() == 0);
{
//fetch active calls to show appropriate scene
pCallList = static_cast<ArrayListT<AppCallInfo>*>(pTelManager->__pActiveCallList->GetValuesN());
+ r = pCallList->GetAt(0, heldCall);
+ if (r == E_SUCCESS)
+ {
+ //pTelManager->HoldActiveCall(&heldCall, false);
+ AppCallInfo* pHeldCallInfo = new (std::nothrow) AppCallInfo();
+ unsigned int callHandle = heldCall.GetCallHandle()->ToLong();
+ //copy state into new callinfo object
+ *pHeldCallInfo = heldCall;
+
+ //set call to hold state
+ pHeldCallInfo->SetOnHold(false);
+
+ pTelManager->__pActiveCallList->Remove(callHandle);
+ //replace old object with new
+ pTelManager->__pActiveCallList->Add(callHandle, *pHeldCallInfo);
+ delete pCallList;
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(pTelManager->__pActiveCallList->GetValuesN());
+ }
}
//notify listener that call is disconnected.
pTelManager->__pEventListener->HandleCallDisconnected(isLastCall, *pCallList);
//update missed status
endCallInfo.SetCalllogType(CALL_LOG_TYPE_VOICE_MISSED_UNSEEN);
//save ended call to call log db.
- SaveCallInfoToLogsDb(endCallInfo);
+ //SaveCallInfoToLogsDb(endCallInfo);
}
- /*//save ended call to call log db.
- SaveCallInfoToLogsDb(endCallInfo);*/
+ //save ended call to call log db.
+ SaveCallInfoToLogsDb(endCallInfo);
//notify listener that call is disconnected.
if (isLastCall == true)
TelephonyManager::HandleEndNormalActiveCall(AppCallInfo& endCallInfo)
{
AppLogDebug("Enter");
+ result r = E_FAILURE;
+ AppCallInfo heldCall;
// This function gets called only from HandleIdleCallback(),
// to handle disconnection of normal active calls.
if (endCallInfo.IsConferenceCall() == false)
ArrayListT<AppCallInfo>* pCallList = null;
if (isLastCall)
{
+ __pSoundManager->GetTimer()->Cancel();
//stop sound session
__pSoundManager->StopSession();
//save "End" CallInfo to list to show EndCallForm
}
else
{
- //fetch active calls to show appropriate scene
- pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pActiveCallList->GetValuesN());
+ if(__pIncomingCall == null)
+ {
+ //fetch active calls to show appropriate scene
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pActiveCallList->GetValuesN());
+ //fetch the held call on disconnecting the active call and activate it.
+ r = pCallList->GetAt(0, heldCall);
+ if (r == E_SUCCESS)
+ {
+ HoldActiveCall(&heldCall, false);
+ delete pCallList;
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pActiveCallList->GetValuesN());
+ }
+ }
}
//Save "End" call info to call log database
- //SaveCallInfoToLogsDb(endCallInfo);
+ SaveCallInfoToLogsDb(endCallInfo);
//notify listener that call is disconnected.
__pEventListener->HandleCallDisconnected(isLastCall, *pCallList);
delete pCallList;
long long startTime = 0;
SystemTime::GetTicks(startTime);
__pDialedCall->SetCallNotificationTime(startTime);
- SaveCallInfoToLogsDb(*__pDialedCall);
+ //SaveCallInfoToLogsDb(*__pDialedCall);
}
void
long long startTime = 0;
SystemTime::GetTicks(startTime);
pConnectedCall->SetCallConnectTime(startTime);
+ CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+ pConnectedCall->SetDurationTime(pPhoneApp->GetCallAppTicks());
if(GetCurrentCallCount() == 0)
{
__pSoundManager->SetMinuteReminderTone();
//transfer ownership to Active calls list
__pActiveCallList->Add(connectedCallHandle, *(pConnectedCall));
- if (pConnectedCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING)
+/* if (pConnectedCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING)
{
SaveCallInfoToLogsDb(*pConnectedCall);
- }
+ }*/
pConnectedCall = null;
//notify listener that call is connected.
{
r = E_FAILURE;
}
+
+ //Pattern to compare all characters except 0-9 * # P ; , +
+ String phoneNumberPattern(L"[^0-9*#P,p+;]");
+ RegularExpression checkPhoneNumber;
+ checkPhoneNumber.Construct(phoneNumberPattern);
+ //If there is any character other than these listed above then display invalid number
+ bool resultMatch = checkPhoneNumber.Match(contactNumber,false);
+ //return false for patterns other than 0-9 * # P ; , +
+ if(resultMatch == true)
+ {
+ //return phone number is invalid
+ r = E_FAILURE;
+ }
//TODO: check if valid phone number else return error message
return r;
}