#include <stdio.h>
#include <FBaseSys.h>
#include <FSystem.h>
+#include <FTelephony.h>
#include "ITapiModem.h"
#include "ITapiSim.h"
#include "CallInfo.h"
using namespace Tizen::Social;
using namespace Tizen::System;
using namespace Tizen::Base::Collection;
+using namespace Tizen::Telephony;
const char* callEventList[] = {
TAPI_NOTI_VOICE_CALL_STATUS_IDLE,
__isSpeakerOn = false;
__pSoundManager = null;
__pCalllogMgr = null;
+ __pNetworkManager = null;
}
TelephonyManager::~TelephonyManager(void)
{
return r;
}
- __pActiveCallList = new (std::nothrow) HashMapT<long, CallInfo>();
+ __pActiveCallList = new (std::nothrow) HashMapT<long, AppCallInfo>();
__pActiveCallList->Construct(IDI_MAX_ACTIVE_CALLS);
//Initialize the Settings Manager to fetch call settings
{
return E_FAILURE;
}
+ __pNetworkManager = new NetworkManager();
+ if(__pNetworkManager != null)
+ {
+ __pNetworkManager->Construct(this);
+ }
return r;
}
if (isEmergency && __pActiveCallList->GetCount() > 0)
{
//Get first call handle
- CallInfo endCallInfo;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ AppCallInfo endCallInfo;
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
pCallList->GetAt(0, endCallInfo);
int callHandle = endCallInfo.GetCallHandle()->ToLong();
delete pCallList;
{
//Check if there is already an active call,
//Put the already active call on hold.
- CallInfo holdCallInfo;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ AppCallInfo holdCallInfo;
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
pCallList->GetAt(0, holdCallInfo);
//Check if call is active, then put on hold
result r = E_FAILURE;
//fetch ended callInfo from active call list
- CallInfo endCall;
+ AppCallInfo endCall;
r = __pActiveCallList->GetValue(callHandle.ToLong(), endCall);
if (r == E_SUCCESS)
{
}
//Check If Ended call matches Dialed Call.
- CallInfo endCall;
+ AppCallInfo endCall;
if (__pDialedCall != null && __pDialedCall->GetContactNumber().Equals(contactNumber))
{
endCall = *__pDialedCall;
}
result
-TelephonyManager::EndCall(CallInfo& endCallInfo)
+TelephonyManager::EndCall(AppCallInfo& endCallInfo)
{
result r = E_FAILURE;
}
result
+TelephonyManager::AnswerAutoRejectCall(int callHandle)
+{
+ AppLogDebug("Enter ");
+ result r = E_FAILURE;
+ TelCallAnswerType_t answerType = TAPI_CALL_ANSWER_ACCEPT;
+ int res = -1;
+
+ AppLogDebug("tel_answer_call");
+ answerType = TAPI_CALL_ANSWER_REJECT;
+ AppCallInfo rejectedCallInfo;
+ rejectedCallInfo = *(__pIncomingCall);
+ rejectedCallInfo.SetCalllogType(CALL_LOG_TYPE_VOICE_BLOCKED);
+ SaveCallInfoToLogsDb(rejectedCallInfo);
+ delete __pIncomingCall;
+ __pIncomingCall = null;
+ // redirect to reject call back handler as the flow has to be handled
+ res = tel_answer_call(__pTapiHandle, callHandle, answerType, &HandleCallbackResponse, this);
+
+ if (res == TAPI_CAUSE_SUCCESS)
+ {
+ r = E_SUCCESS;
+ }
+ else
+ {
+ r = E_FAILURE;
+ }
+ return r;
+}
+
+result
TelephonyManager::AnswerCall(int callHandle, bool acceptCall)
{
+ AppLogDebug("Enter %d",acceptCall);
result r = E_FAILURE;
__pSoundManager->StopAlert();
TelCallAnswerType_t answerType = TAPI_CALL_ANSWER_ACCEPT;
}
else
{
+ AppLogDebug("tel_answer_call");
answerType = TAPI_CALL_ANSWER_REJECT;
// redirect to reject call back handler as the flow has to be handled
res = tel_answer_call(__pTapiHandle, callHandle, answerType, &HandleRejectCallbackResponse, this);
//construct and fetch new Incoming call Info
String incomingHandle;
incomingHandle.Append(callHandle);
- CallInfo* pDuplicateCallInfo = FetchIncomingCallHandleN(incomingHandle, String(L""));
+ AppCallInfo* pDuplicateCallInfo = FetchIncomingCallHandleN(incomingHandle, String(L""));
if(pDuplicateCallInfo == null)
{
r = E_FAILURE;
//Call connected successfully
r = E_SUCCESS;
//update status of first call to "OnHold"
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
- CallInfo firstCallInfo;
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ AppCallInfo firstCallInfo;
pCallList->GetAt(0, firstCallInfo);
- //replace old object with update CallInfo
- CallInfo* pHeldCallInfo = new (std::nothrow) CallInfo();
+ //replace old object with update AppCallInfo
+ AppCallInfo* pHeldCallInfo = new (std::nothrow) AppCallInfo();
*pHeldCallInfo = firstCallInfo;
pHeldCallInfo->SetOnHold(true);
__pActiveCallList->Remove(firstCallInfo.GetCallHandle()->ToLong());
case ANSERWING_OPTION_END_SINGLE_CALL:
{
//Transfer Old active calls to a separate list to avoid any processing in HandleIdleCallback().
- HashMapT<long, CallInfo>* pEndCallsList = __pActiveCallList;
+ HashMapT<long, AppCallInfo>* pEndCallsList = __pActiveCallList;
//create a new ActiveCallList
- __pActiveCallList = new (std::nothrow) HashMapT<long, CallInfo>();
+ __pActiveCallList = new (std::nothrow) HashMapT<long, AppCallInfo>();
__pActiveCallList->Construct(IDI_MAX_ACTIVE_CALLS);
//accept call and reject all active calls with 'TAPI_CALL_ANSWER_REPLACE'
//Call connected successfully
r = E_SUCCESS;
//Add calls information to call log before deleting from active call list.
- IListT<CallInfo>* pCallList = pEndCallsList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = pEndCallsList->GetValuesN();
if(pCallList != null)
{
- CallInfo endCallInfo;
+ AppCallInfo endCallInfo;
if (pCallList->GetAt(0, endCallInfo) == E_SUCCESS)
{
SaveCallInfoToLogsDb(endCallInfo);
case ANSERWING_OPTION_REPLACE_ACTIVE_CALL:
{
//Replace "Active" call by incoming call and save ended call to call logs db.
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
- CallInfo callToBeEnded;
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ AppCallInfo callToBeEnded;
pCallList->GetAt(0, callToBeEnded);
//Check if the call is on "Hold", then fetch 2nd callInfo
if (callToBeEnded.IsOnHold() == true)
case ANSERWING_OPTION_REPLACE_HELD_CALL:
{
//Replace "Held" call by incoming call and save ended call to call logs db.
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
//"Held" call is to be ended
- CallInfo callToBeEnded;
+ AppCallInfo callToBeEnded;
//"Active" call will be put on Hold
- CallInfo callToPutOnHold;
+ AppCallInfo callToPutOnHold;
pCallList->GetAt(0, callToBeEnded);
//Check if the call is NOT "Held", then fetch 2nd callInfo
if (callToBeEnded.IsOnHold() == false)
}
else
{
- IListT<CallInfo>* pParticipantsInfo = callToBeEnded.GetCallerList();
+ IListT<AppCallInfo>* pParticipantsInfo = callToBeEnded.GetCallerList();
//need to end every participant individually for conference call
for (int index = 0; index < pParticipantsInfo->GetCount(); index++)
{
- CallInfo memberCallInfo;
+ AppCallInfo memberCallInfo;
pParticipantsInfo->GetAt(index, memberCallInfo);
res = tel_end_call(__pTapiHandle, memberCallInfo.GetCallHandle()->ToLong(), TAPI_CALL_END, &HandleCallbackResponse, this);
}
//Call connected successfully and active call is "Onhold"
r = E_SUCCESS;
//replace old object with update CallInfo
- CallInfo* pHeldCallInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pHeldCallInfo = new (std::nothrow) AppCallInfo();
*pHeldCallInfo = callToPutOnHold;
pHeldCallInfo->SetOnHold(true);
__pActiveCallList->Remove(callToPutOnHold.GetCallHandle()->ToLong());
// and processing of Incoming call is handled in HandleActiveCallback().
//Transfer Old active calls to a separate list to avoid any processing in HandleIdleCallback().
- HashMapT<long, CallInfo>* pEndCallsList = __pActiveCallList;
+ HashMapT<long, AppCallInfo>* pEndCallsList = __pActiveCallList;
//create a new ActiveCallList
- __pActiveCallList = new (std::nothrow) HashMapT<long, CallInfo>();
+ __pActiveCallList = new (std::nothrow) HashMapT<long, AppCallInfo>();
__pActiveCallList->Construct(IDI_MAX_ACTIVE_CALLS);
//End all active calls and all hold calls
r = E_SUCCESS;
//Add calls information to call log before deleting from active call list.
- IListT<CallInfo>* pCallList = pEndCallsList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = pEndCallsList->GetValuesN();
if(pCallList != null)
{
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
- CallInfo endCallInfo;
+ AppCallInfo endCallInfo;
if (pCallList->GetAt(index, endCallInfo) == E_SUCCESS)
{
SaveCallInfoToLogsDb(endCallInfo);
//Check if there are any existing active calls
if (__pActiveCallList->GetCount())
{
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
- CallInfo holdCallInfo;
+ AppCallInfo holdCallInfo;
r = pCallList->GetAt(index, holdCallInfo);
//check if an active call is found with matching contact no.
{
result r = E_FAILURE;
//fetch conference callInfo to end
- CallInfo confCallToEnd;
+ AppCallInfo confCallToEnd;
bool isConferenceCallFound = false;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
{
result r = E_FAILURE;
int confCallIndex = -1;
- CallInfo confCallToHold;
+ AppCallInfo confCallToHold;
bool isConferenceCallFound = false;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
int confCallCount = pCallList->GetCount();
for (int index = 0; index < confCallCount; index++)
{
confCallToHold.SetOnHold(false);
}
- CallInfo* pConfCallInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pConfCallInfo = new (std::nothrow) AppCallInfo();
*pConfCallInfo = confCallToHold;
__pActiveCallList->Remove(callHandle);
__pActiveCallList->Add(callHandle, *pConfCallInfo);
{
result r = E_FAILURE;
int res = -1;
- CallInfo activeCall;
- CallInfo heldCall;
+ AppCallInfo activeCall;
+ AppCallInfo heldCall;
// Use enumerator to access elements in the map
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
r = pCallList->GetAt(0, activeCall);
if (r == E_SUCCESS)
}
result
-TelephonyManager::HoldActiveCall(CallInfo* pActiveCallInfo, bool holdCall)
+TelephonyManager::HoldActiveCall(AppCallInfo* pActiveCallInfo, bool holdCall)
{
unsigned int callHandle = pActiveCallInfo->GetCallHandle()->ToLong();
int retStatus = -1;
if (retStatus == TAPI_CAUSE_SUCCESS)
{
- CallInfo* pHeldCallInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pHeldCallInfo = new (std::nothrow) AppCallInfo();
//copy state into new callinfo object
*pHeldCallInfo = *pActiveCallInfo;
{
TelCallDial_t structDialCall;
+ AppLogDebug("Enter %ls",contactNumber.GetPointer());
+ //Temp String to replace , with P and ; with W
+ String TempContactNum;
+ TempContactNum.Append(contactNumber);
+ TempContactNum.Replace(L",",L"W");
+ TempContactNum.Replace(L";",L",");
//conversion "contactNumber" to char*
- const wchar_t* pContact = contactNumber.GetPointer();
- int len = contactNumber.GetLength()+1;
+ const wchar_t* pContact = TempContactNum.GetPointer();
+ int len = TempContactNum.GetLength()+1;
char* pNumber = new (std::nothrow) char[len];
wcstombs(pNumber, pContact, len);
delete __pDialedCall;
__pDialedCall = null;
}
- __pDialedCall = new (std::nothrow) CallInfo();
+ __pDialedCall = new (std::nothrow) AppCallInfo();
__pDialedCall->SetContactNumber(contactNumber);
__pDialedCall->SetEmergency(isEmergency);
result r = FetchContactInfoForNumber(contactNumber);
{
result r = E_FAILURE;
int confCallIndex = -1;
- CallInfo endConfCall;
+ AppCallInfo endConfCall;
bool isConferenceCallFound = false;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
}
//Identify the call to be ended and remove from list on API success
- CallInfo callToBeEnded;
- IListT<CallInfo>* pParticipantList = endConfCall.GetCallerList();
+ AppCallInfo callToBeEnded;
+ IListT<AppCallInfo>* pParticipantList = endConfCall.GetCallerList();
int participantCount = pParticipantList->GetCount();
for (int index = 0; index < participantCount; index++)
{
{
result r = E_FAILURE;
int confCallIndex = -1;
- CallInfo endConfCall;
+ AppCallInfo endConfCall;
bool isConferenceCallFound = false;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
}
//Identify the call to be ended and remove from list on API success
- CallInfo callToBeEnded;
+ AppCallInfo callToBeEnded;
pCallList = endConfCall.GetCallerList();
callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
//Check if incoming call is rejected
if (pTelManager->__pIncomingCall != null && (rejectedCallHandle == (unsigned int) pTelManager->__pIncomingCall->GetCallHandle()->ToLong()))
{
- CallInfo rejectedCallInfo;
+ AppCallInfo rejectedCallInfo;
rejectedCallInfo = *(pTelManager->__pIncomingCall);
delete pTelManager->__pIncomingCall;
pTelManager->__pIncomingCall = null;
}
}
//Send notification to user
- ArrayListT<CallInfo>* pCallList = null;
+ ArrayListT<AppCallInfo>* pCallList = null;
if (isLastCall)
{
//save 'RejectedCall' to list to show on EndCallForm
- pCallList = new (std::nothrow) ArrayListT<CallInfo>();
+ pCallList = new (std::nothrow) ArrayListT<AppCallInfo>();
pCallList->Construct(1);
- CallInfo* pRejectedCall = new (std::nothrow) CallInfo();
+ AppCallInfo* pRejectedCall = new (std::nothrow) AppCallInfo();
*pRejectedCall = rejectedCallInfo;
pCallList->Add(*pRejectedCall);
}
else
{
//fetch active calls to show appropriate scene
- pCallList = static_cast<ArrayListT<CallInfo>*>(pTelManager->__pActiveCallList->GetValuesN());
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(pTelManager->__pActiveCallList->GetValuesN());
}
pTelManager->__pEventListener->HandleCallDisconnected(isLastCall, *pCallList);
delete pCallList;
{
unsigned int tempHandle = 0;
TelCallInfoJoinedNoti_t joinedInfoNotification;
- CallInfo confCallInfo;
+ AppCallInfo confCallInfo;
memcpy(&tempHandle, pData, sizeof(TS_UINT));
joinedInfoNotification.id = tempHandle;
- CallInfo activeCall;
- CallInfo heldCall;
+ AppCallInfo activeCall;
+ AppCallInfo heldCall;
// Use enumerator to access elements in the map
- IListT<CallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
result r = pCallList->GetAt(0, activeCall);
if (r == E_SUCCESS)
r = pCallList->GetAt(1, heldCall);
if (r == E_SUCCESS)
{
- CallInfo* pConfCallInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pConfCallInfo = new (std::nothrow) AppCallInfo();
unsigned int activeCallHandle = activeCall.GetCallHandle()->ToLong();
unsigned int heldCallHandle = heldCall.GetCallHandle()->ToLong();
if (activeCall.IsConferenceCall() == true)
TelephonyManager* pTelManager = (TelephonyManager*) pUserData;
if (callBackResult == TAPI_CAUSE_SUCCESS)
{
- IListT<CallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
IListT<long>* pKeyList = pTelManager->__pActiveCallList->GetKeysN();
int callCount = pTelManager->__pActiveCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
- CallInfo* pTempCallInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pTempCallInfo = new (std::nothrow) AppCallInfo();
pCallList->GetAt(index, *pTempCallInfo);
(pTempCallInfo->IsOnHold() == false) ? pTempCallInfo->SetOnHold(true) : pTempCallInfo->SetOnHold(false);
long callHandle;
TelCallEndCnf_t callEndNotification;
memcpy(&callEndNotification, pData, sizeof(TelCallEndCnf_t));
//Fetch conference call
- CallInfo endConfCall;
+ AppCallInfo endConfCall;
bool isConferenceCallFound = false;
- IListT<CallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
}
bool
-TelephonyManager::HandleParticipantEndedFromConference(unsigned int participantCallHandle, CallInfo& conferenceCall)
+TelephonyManager::HandleParticipantEndedFromConference(unsigned int participantCallHandle, AppCallInfo& conferenceCall)
{
AppLogDebug("ENTER");
//to check if participant call was found and ended.
bool isParticipantCallEnded = false;
//Identify the call to be ended and remove from list.
- CallInfo callToBeEnded;
- IListT<CallInfo>* pCallerList = conferenceCall.GetCallerList();
+ AppCallInfo callToBeEnded;
+ IListT<AppCallInfo>* pCallerList = conferenceCall.GetCallerList();
int callerCount = pCallerList->GetCount();
for (int index = 0; index < callerCount; index++)
{
//Check if last participant removed. If yes, switch to single active view
if (conferenceCall.GetCallerListCount() == 1)
{
- CallInfo callFromList;
+ AppCallInfo callFromList;
pCallerList = conferenceCall.GetCallerList();
pCallerList->GetAt(0, callFromList);
//construct a new single active call
- CallInfo* pActiveCall = new (std::nothrow) CallInfo();
+ AppCallInfo* pActiveCall = new (std::nothrow) AppCallInfo();
*pActiveCall = callFromList;
//update conference status and Hold status
pActiveCall->SetConference(false);
pActiveCall = null;
//using the callConnected to switch to single active screen
//or update multiple active call screen
- IListT<CallInfo>* pActiveCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pActiveCallList = __pActiveCallList->GetValuesN();
__pEventListener->HandleCallConnected(*pActiveCallList);
delete pActiveCallList;
pActiveCallList = null;
}
else
{
- CallInfo callFromList;
+ AppCallInfo callFromList;
pCallerList = conferenceCall.GetCallerList();
pCallerList->GetAt(0, callFromList);
//construct a new conference call
- CallInfo* pConfCallInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pConfCallInfo = new (std::nothrow) AppCallInfo();
*pConfCallInfo = conferenceCall;
if (confCallHandle == participantCallHandle)
{
TelCallSplitCnf_t callSplitNotification;
memcpy(&callSplitNotification, pData, sizeof(TelCallSplitCnf_t));
int confCallIndex = -1;
- CallInfo endConfCall;
+ AppCallInfo endConfCall;
bool isConferenceCallFound = false;
- IListT<CallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = pTelManager->__pActiveCallList->GetValuesN();
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
delete pCallList;
pCallList = null;
//Identify the call to be ended and remove from list on API success
- CallInfo callToBeEnded;
+ AppCallInfo callToBeEnded;
pCallList = endConfCall.GetCallerList();
callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
//Set hold for the other single call
// and add to the list
- CallInfo callFromList;
+ AppCallInfo callFromList;
pCallList = endConfCall.GetCallerList();
pCallList->GetAt(0, callFromList);
- CallInfo* pHeldCall = new (std::nothrow) CallInfo();
+ AppCallInfo* pHeldCall = new (std::nothrow) AppCallInfo();
*pHeldCall = callFromList;
pHeldCall->SetConference(false);
pHeldCall->SetOnHold(true);
{
//Set hold flag for conference call
endConfCall.SetOnHold(true);
- CallInfo callFromList;
+ AppCallInfo callFromList;
pCallList = endConfCall.GetCallerList();
pCallList->GetAt(0, callFromList);
- CallInfo* pConfCallInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pConfCallInfo = new (std::nothrow) AppCallInfo();
*pConfCallInfo = endConfCall;
if (confCallHandle == callSplitNotification.id)
{
}
}
//Add the new active call to active call list
- CallInfo* pActiveCall = new (std::nothrow) CallInfo();
+ AppCallInfo* pActiveCall = new (std::nothrow) AppCallInfo();
*pActiveCall = callToBeEnded;
pActiveCall->SetConference(false);
pActiveCall->SetOnHold(false);
{
//fetch ended confCall details
result r = E_FAILURE;
- CallInfo endConfCallInfo;
- IListT<CallInfo>* pActiveCallList = pTelManager->__pActiveCallList->GetValuesN();
+ AppCallInfo endConfCallInfo;
+ IListT<AppCallInfo>* pActiveCallList = pTelManager->__pActiveCallList->GetValuesN();
if(pActiveCallList != null && pActiveCallList->GetCount() > 0)
{
for (int index = 0; index < pActiveCallList->GetCount(); index++)
//check if the ended call was the last call and show notification to user
bool isLastCall = (pTelManager->__pActiveCallList->GetCount() == 0);
- ArrayListT<CallInfo>* pCallList = null;
+ ArrayListT<AppCallInfo>* pCallList = null;
if (isLastCall)
{
pTelManager->__pSoundManager->SetlastEndedConferenceCall();
//stop sound session
pTelManager->__pSoundManager->StopSession();
//send empty call list to show dialer or call log screen
- pCallList = new (std::nothrow) ArrayListT<CallInfo>();
+ pCallList = new (std::nothrow) ArrayListT<AppCallInfo>();
}
else
{
//fetch active calls to show appropriate scene
- pCallList = static_cast<ArrayListT<CallInfo>*>(pTelManager->__pActiveCallList->GetValuesN());
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(pTelManager->__pActiveCallList->GetValuesN());
}
//notify listener that call is disconnected.
pTelManager->__pEventListener->HandleCallDisconnected(isLastCall, *pCallList);
unsigned int endCallHandle = idleNotification.id;
//empty active call list or no dialed or incoming calls - ignore this event
- IListT<CallInfo>* pActiveCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pActiveCallList = __pActiveCallList->GetValuesN();
if((pActiveCallList == null || pActiveCallList->GetCount() <= 0) && __pDialedCall == null && __pIncomingCall == null)
{
delete pActiveCallList;
//Check if ended call was among conference caller list,
//then divert event to "HandleParticipantEndedFromConference()"
- CallInfo confCallInfo;
+ AppCallInfo confCallInfo;
bool isConferenceCallChanged = false;
- for (int index = 0; index < pActiveCallList->GetCount(); index++)
+ for (int index = 0; (pActiveCallList != null && index < pActiveCallList->GetCount()); index++)
{
//fetch conference call
result r = pActiveCallList->GetAt(index, confCallInfo);
}
//check if ended call was among the active call list and not a conference call
- CallInfo endCallInfo;
+ AppCallInfo endCallInfo;
result r = __pActiveCallList->GetValue(endCallHandle, endCallInfo);
if (r == E_SUCCESS)
{
//It comes here only if the ended call was either a "unconnected" dialed call or an "Missed" incoming call.
bool isLastCall = (__pActiveCallList->GetCount() == 0);
- ArrayListT<CallInfo>* pCallList = null;
+ ArrayListT<AppCallInfo>* pCallList = null;
//Check if dialed call was ended
if (isDialedCallEnded == true)
{
delete __pIncomingCall;
__pIncomingCall = null;
//update missed status
- endCallInfo.SetCalllogType(CALL_LOG_TYPE_VOICE_MISSED);
+ endCallInfo.SetCalllogType(CALL_LOG_TYPE_VOICE_MISSED_UNSEEN);
}
//save ended call to call log db.
SaveCallInfoToLogsDb(endCallInfo);
if (isLastCall == true)
{
__pSoundManager->StopSession();
- pCallList = new (std::nothrow) ArrayListT<CallInfo>();
+ pCallList = new (std::nothrow) ArrayListT<AppCallInfo>();
pCallList->Construct(1);
if (isMissedIncomingCallEnded == false)
{
}
else
{
- pCallList = static_cast<ArrayListT<CallInfo>*>(__pActiveCallList->GetValuesN());
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pActiveCallList->GetValuesN());
}
__pEventListener->HandleCallDisconnected(isLastCall, *pCallList);
delete pCallList;
}
bool
-TelephonyManager::HandleEndNormalActiveCall(CallInfo& endCallInfo)
+TelephonyManager::HandleEndNormalActiveCall(AppCallInfo& endCallInfo)
{
// This function gets called only from HandleIdleCallback(),
// to handle disconnection of normal active calls.
__pActiveCallList->Remove(endCallInfo.GetCallHandle()->ToLong());
//check if the ended call was the last call and show notification to user
bool isLastCall = (__pActiveCallList->GetCount() == 0);
- ArrayListT<CallInfo>* pCallList = null;
+ ArrayListT<AppCallInfo>* pCallList = null;
if (isLastCall)
{
//stop sound session
__pSoundManager->StopSession();
//save "End" CallInfo to list to show EndCallForm
- pCallList = new (std::nothrow) ArrayListT<CallInfo>();
+ pCallList = new (std::nothrow) ArrayListT<AppCallInfo>();
pCallList->Construct(1);
pCallList->Add(endCallInfo);
}
else
{
//fetch active calls to show appropriate scene
- pCallList = static_cast<ArrayListT<CallInfo>*>(__pActiveCallList->GetValuesN());
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pActiveCallList->GetValuesN());
}
//Save "End" call info to call log database
if (__pDialedCall == null)
{
//construct new dialed call
- __pDialedCall = new (std::nothrow) CallInfo();
+ __pDialedCall = new (std::nothrow) AppCallInfo();
TelCallStatus_t callStatus;
int res = tel_get_call_status(__pTapiHandle, dialingNotification.id, &callStatus);
TelCallStatusActiveNoti_t activeNotification;
memcpy(&newCallHandle, pData, sizeof(TS_UINT));
activeNotification.id = newCallHandle;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
//Check if the "Held" call was activated, i.e it is already present in already activated calls list.
bool toHandleEvent = true;
for (int callIndex = 0; (callIndex < pCallList->GetCount() && toHandleEvent == true); callIndex++ )
{
- CallInfo tempCallInfo;
+ AppCallInfo tempCallInfo;
pCallList->GetAt(callIndex, tempCallInfo);
unsigned int tempCallHandle = tempCallInfo.GetCallHandle()->ToLong();
//Check if active callback came for "HandleJoinCallbackResponse"
else
{
//check individual participants of conf call
- IListT<CallInfo>* pConfCallList = tempCallInfo.GetCallerList();
+ IListT<AppCallInfo>* pConfCallList = tempCallInfo.GetCallerList();
int confCallCount = pConfCallList->GetCount();
for (int callIndex = 0; (callIndex < confCallCount && toHandleEvent == true); callIndex++)
{
- CallInfo confCallerInfo;
+ AppCallInfo confCallerInfo;
pConfCallList->GetAt(callIndex, confCallerInfo);
unsigned int confCallerHandle = confCallerInfo.GetCallHandle()->ToLong();
if (confCallerHandle == activeNotification.id)
{
//Here it comes, only if either new dialed or incoming call was connected.
//This function should be called only from "HandleActiveCallback()".
- CallInfo* pConnectedCall = null;
+ AppCallInfo* pConnectedCall = null;
//to check if incoming call was connected
bool isIncomingCallConnected = false;
// Otherwise Correct the code in some other function, if it comes here.
AppLogDebug("Error - Connected call was neither one of active calls nor it was dialed or incoming call");
//Construct a new CallInfo object for call
- pConnectedCall = new (std::nothrow) CallInfo();
+ pConnectedCall = new (std::nothrow) AppCallInfo();
pConnectedCall->SetCallHandle(connectedCallHandle);
TelCallStatus_t callStatus;
pConnectedCall = null;
//notify listener that call is connected.
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
__pSoundManager->SetSoundMode(SOUND_MODE_VOICE);
__pEventListener->HandleCallConnected(*pCallList);
if (isIncomingCallConnected == true)
}
bool
-TelephonyManager::CheckIncomingCallToBeRejected(CallInfo* pIncomingCallInfo)
+TelephonyManager::CheckIncomingCallToBeRejected(AppCallInfo* pIncomingCallInfo)
{
+ AppLogDebug("Enter");
int callHandle = pIncomingCallInfo->GetCallHandle()->ToLong();
String contactNumber(L"");
contactNumber.Append(pIncomingCallInfo->GetContactNumber());
if (((__pSettingsManager->GetUnknownRejectStatus() == true) && (pIncomingCallInfo->GetContactInfo() == null))
|| (__pSettingsManager->IsCallToBeRejected(contactNumber) == true))
{
- AnswerCall(callHandle,false);
+ AnswerAutoRejectCall(callHandle);
return true;
}
return false;
}
}
-CallInfo*
+AppCallInfo*
TelephonyManager::GetConferenceCallInfoN(void)
{
- CallInfo* pConfCallInfo = null;
+ AppCallInfo* pConfCallInfo = null;
- IListT<CallInfo>* pCallList = __pActiveCallList->GetValuesN();
+ IListT<AppCallInfo>* pCallList = __pActiveCallList->GetValuesN();
int callCount = pCallList->GetCount();
for (int index = 0; index < callCount; index++)
{
- CallInfo callInfo;
+ AppCallInfo callInfo;
pCallList->GetAt(index, callInfo);
if (callInfo.IsConferenceCall() == true)
{
- pConfCallInfo = new (std::nothrow) CallInfo();
+ pConfCallInfo = new (std::nothrow) AppCallInfo();
*pConfCallInfo = callInfo;
//Found the Conference call
break;
return pConfCallInfo;
}
-IListT<CallInfo>*
+IListT<AppCallInfo>*
TelephonyManager::GetCallListN(void)
{
- ArrayListT<CallInfo>* pCallList = null;
+ ArrayListT<AppCallInfo>* pCallList = null;
if (__pActiveCallList != null)
{
- pCallList = static_cast<ArrayListT<CallInfo>*>(__pActiveCallList->GetValuesN());
+ pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pActiveCallList->GetValuesN());
}
return pCallList;
}
}
void
-TelephonyManager::StartAlert(CallInfo& incomingCallInfo)
+TelephonyManager::StartAlert(AppCallInfo& incomingCallInfo)
{
String contactRingTone(L"");
String contactNumber = incomingCallInfo.GetContactNumber();
return null;
}
-CallInfo*
+AppCallInfo*
TelephonyManager::FetchIncomingCallHandleN(const String& callHandle, const String& contactNumber)
{
if(__pIncomingCall != null)
return null;
}
//construct incoming call info object
- __pIncomingCall = new (std::nothrow) CallInfo();
+ __pIncomingCall = new (std::nothrow) AppCallInfo();
__pIncomingCall->SetCallHandle(incomingHandle);
//contact number
}
//construct a new callinfo object to pass its ownership to caller.
- CallInfo* pNewIncomingCall = new (std::nothrow) CallInfo();
+ AppCallInfo* pNewIncomingCall = new (std::nothrow) AppCallInfo();
*pNewIncomingCall = *__pIncomingCall;
return pNewIncomingCall;
}
|| (pCallStatus->CallState == TAPI_CALL_STATE_WAITING)))
{
//construct incoming call details
- pTelManager->__pIncomingCall = new (std::nothrow) CallInfo();
+ pTelManager->__pIncomingCall = new (std::nothrow) AppCallInfo();
pTelManager->__pIncomingCall->SetCallHandle(pCallStatus->CallHandle);
//contact number
String contactNumber(pCallStatus->pNumber);
}
void
-TelephonyManager::SaveCallInfoToLogsDb(CallInfo& endCallInfo)
+TelephonyManager::SaveCallInfoToLogsDb(AppCallInfo& endCallInfo)
{
if (endCallInfo.IsConferenceCall() == false)
{
{
//Conference call
int confCallCount = endCallInfo.GetCallerListCount();
- IListT<CallInfo>* pParticipantList = endCallInfo.GetCallerList();
+ IListT<AppCallInfo>* pParticipantList = endCallInfo.GetCallerList();
for (int index = 0; index < confCallCount; index++)
{
- CallInfo participantInfo;
+ AppCallInfo participantInfo;
if (pParticipantList->GetAt(index, participantInfo) == E_SUCCESS)
{
//Add call ended to call log database
}
}
}
+
+void
+TelephonyManager::OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus)
+{
+
+ if(networkStatus.IsCallServiceAvailable() == false)
+ {
+ EndAllCalls();
+ }
+}