📄 outgoingcallhelper.c
字号:
}
}
/*****************************************************************************
* FUNCTION
* ShowOutgoingIndicationScreen
* DESCRIPTION
* Shows only outgoing call screen and takes control
* PARAMETERS
* number [IN]
* Number(?) [IN] To show on screen
* RETURNS
* void
*****************************************************************************/
void ShowOutgoingIndicationScreen(PU8 number)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* for SAT MO only */
SetSATScrnSavedFlag(FALSE);
SetPreviousState((CALL_STATE) GetCurrentState());
SetCurrentState(CM_OUTGOING_STATE);
gtmpOutgoingIndex = GetFirstFreeIndex();
AddNewCallInfo(
number,
(CALL_STATE) GetCurrentState(),
CM_IDLE_STATE,
CM_CALL_MO_STK,
(CM_CALL_HANDLE) (gtmpOutgoingIndex + 1),
CSMCC_VOICE_CALL);
OutgoingProcessCMEvent(CM_PS_SHOW_OUTGOING_CALL_SCREEN, NULL);
SetSATScrnSavedFlag(TRUE);
}
/*****************************************************************************
* FUNCTION
* RemoveOutgoingIndicationScreen
* DESCRIPTION
* Removes outgoing call screen
* PARAMETERS
* void
* Number(?) [IN] To show on screen
* RETURNS
* void
*****************************************************************************/
void RemoveOutgoingIndicationScreen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
CM_CALL_HANDLE handle;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* SAT MO fail case */
handle = GetOutgoingCallHandle();
if (handle == -1)
{
return;
}
SetCallState(handle, CM_IDLE_STATE, TRUE);
SetCurrentState(GetPreviousState());
SetPreviousState(CM_OUTGOING_STATE);
if (FALSE == GetSATScrnSavedFlag())
{
EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, NULL, NULL);
SetSATScrnSavedFlag(TRUE);
}
SetCallEndedBeforeConnFlag(FALSE);
/* GoBackfromNotifyScr(); */
ShowCallManagementErrorMessage(ERR_L4C_GEN_CAUSE);
}
/*****************************************************************************
* FUNCTION
* PsCBackSetCallFeatures
* DESCRIPTION
* This Sets the features of the call as per
* PARSING STR RSP
*
*
* PARSING_STRING_RSP from PS
* PARAMETERS
* info [?]
* RETURNS
* void
*****************************************************************************/
void PsCBackSetCallFeatures(void *info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MMI_PARSE_STR_RSP *rsp;
CM_CALL_HANDLE handle = -1;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PRINT_INFORMATION(("XXX In PsCBackSetCallFeatures \n"));
rsp = (MMI_PARSE_STR_RSP*) info;
if (TRUE == DeriveAndSetCallFeatures(info))
{
if (GetCCFlag() == TRUE)
{
PHB_CM_INTERFACE PhoneNumberStruct;
/* MO call */
#ifdef __MMI_BT_PROFILE__
/* stop audio background play before sco link */
mdi_audio_suspend_background_play();
/* establish sco link here */
mmi_profiles_bt_call_start_callback();
#endif /* __MMI_BT_PROFILE__ */
/* look up dialed number from phonebook first anyway */
/* auto redial and dial from list */
if (cm_p->redial_info.DialFromPhb != MMI_PHB_NONE)
{
mmi_phb_call_set_dial_from_list(cm_p->redial_info.DialFromPhb);
}
PhoneNumberStruct = mmi_phb_call_get_data_for_call_mgnt(GetOutgoingNumber(), TRUE);
SetCMPhoneBookStruct(&PhoneNumberStruct);
/* PhoneNumberStruct = GetCMPhoneBookStruct(); */
if (CHISTGetDialFromCallLogFlag() == 0)
{
/* not dial from call log => use phonebook data and name */
PRINT_INFORMATION(("*** In PsCBackSetCallFeatures, set MO name from PHB1 ***\n"));
SetOutgoingNamefromPhonebook();
}
else if (pfnUnicodeStrcmp((PS8) PhoneNumberStruct.name, (PS8) GetOutgoingName()) != 0)
{
/* dial from call log but phonebook name not match => don't use phonebook data */
PRINT_INFORMATION(("*** In PsCBackSetCallFeatures, set MO name from Call Log ***\n"));
memset(&PhoneNumberStruct, 0, sizeof(PHB_CM_INTERFACE));
PhoneNumberStruct.pictureId = IMG_PHB_DEFAULT;
SetCMPhoneBookStruct(&PhoneNumberStruct);
}
else
{
/* dial from call log but still use phonebook data */
PRINT_INFORMATION(("*** In PsCBackSetCallFeatures, set MO name from PHB2 ***\n"));
}
AlmDisableExpiryHandler();
OutgoingProcessCMEvent(CM_PS_SHOW_OUTGOING_CALL_SCREEN, NULL);
CHISTSetDialFromCallLogFlag(0);
return;
}
else if (rsp->info.opcode == SS_OPERATION)
{
/* SS string */
if (GetCurrentState() == CM_INCOMING_STATE)
{
history ss_scr;
S16 nHistory = 0;
//micha1106
if (!IsScreenPresent(SCR_CM_REQUESTINGUSSD))
{
ss_scr.scrnID = SCR_CM_REQUESTINGUSSD;
ss_scr.entryFuncPtr = EntryScrUSSDReq;
pfnUnicodeStrcpy((S8*) ss_scr.inputBuffer, (S8*) & nHistory);
InsertHistoryBeforeThisScrnReference(CM_SCR_MARKER, &ss_scr);
}
}
else
{
OutgoingProcessCMEvent(CM_PS_SHOW_REQUESTING_CALL_SCREEN, NULL);
}
}
else
{
/* must be SIM operation */
/* OutgoingProcessCMFailureEvent(CM_PS_CALLCONNECTED, ERR_INVALID_NUMBER_FORMAT); */
}
}
else if ((rsp->result.flag == 0) && (rsp->info.opcode == SIM_OPERATION))
{
DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
}
else if ((rsp->result.flag == 0) && (rsp->info.opcode == INVALID_OPERATION))
{
if (rsp->result.cause == PHB_L4C_ERROR)
{
OutgoingProcessCMFailureEvent(CM_PS_CALLCONNECTED, ERR_L4C_FDN_FAIL);
}
else if (rsp->result.cause == L4C_CMD_CONFLICT)
{
OutgoingProcessCMFailureEvent(CM_PS_CALLCONNECTED, ERR_L4C_GEN_CAUSE);
}
else
{
OutgoingProcessCMFailureEvent(CM_PS_CALLCONNECTED, ERR_INVALID_NUMBER_FORMAT);
}
}
else
{
OutgoingProcessCMFailureEvent(CM_PS_CALLCONNECTED, ERROR_FAIL);
RemoveSSReqScr();
}
g_phb_cntx.dial_from_list = MMI_PHB_NONE;
PurgeOutgoingCallsStructure();
SetCallEndedBeforeConnFlag(FALSE);
CHISTSetDialFromCallLogFlag(0);
SetCurrentState(GetPreviousState());
if (GetPreviousState() == CM_INCOMING_STATE)
{
if (GetTotalCallCount() == 1)
{
SetPreviousState(CM_IDLE_STATE);
}
else if (GetTotalActiveCallCount() == GetTotalCallCount() - 1)
{
SetPreviousState(CM_ACTIVE_STATE);
}
else if (GetTotalHoldCallCount() == GetTotalCallCount() - 1)
{
SetPreviousState(CM_HOLD_STATE);
}
}
/* reset phb data */
if (GetCurrentState() == CM_INCOMING_STATE)
{
handle = GetIncomingCallHandle();
}
else if (GetCurrentState() == CM_OUTGOING_STATE)
{
handle = GetOutgoingCallHandle();
}
if (handle != -1)
{
PHB_CM_INTERFACE phb_data;
phb_data = mmi_phb_call_get_data_for_call_mgnt(GetCallNumber(handle), FALSE);
#ifdef __MMI_INCOMING_CALL_VIDEO__
/* waiting call and ccbs invoke can't use video for display */
if (GetTotalCallCount() > 0 || GetCCBSFlag() == TRUE)
{
phb_data.videoId = 0;
}
#endif /* __MMI_INCOMING_CALL_VIDEO__ */
SetCMPhoneBookStruct(&phb_data);
}
SetDefaultVolumeKeyHandlers();
return;
}
/*****************************************************************************
* FUNCTION
* PsCbackOutgoingCallIdSync
* DESCRIPTION
* Helper function to get call list from PS to sync with MMI
*
* DIAL_IND from PS.
* PARAMETERS
* MsgStruct [?]
* RETURNS
* void
*****************************************************************************/
void PsCbackOutgoingCallIdSync(void *MsgStruct)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
CM_CALL_HANDLE handle;
U16 response;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PRINT_INFORMATION(("XXX - In PsCbackOutgoingCallIdSync XXX\n"));
handle = DeriveOutgoingCallIdRsp(MsgStruct, &response);
if (handle == -1 || handle > MAX_CALLS)
{
if (GetDialIndication() == TRUE)
{
ShowCallManagementErrorMessage(NO_ACTIVE_CALL);
return;
}
PRINT_INFORMATION(("Error in making outgoing call %d", response));
/* keep MO fail cause for later display if notify ss is ongoing */
SetCallEndCause(response);
/* MO fail */
/* SyncCallList(); */
SetDialIndication(FALSE);
LogCallInfoForCallHistory(GetOutgoingCallHandle());
GetEndTimeAndLogUnconnectedMOCall();
if (IsRedialSet())
{
SetRedialNumber();
}
OutgoingProcessCMFailureEvent(CM_PS_CALLCONNECTED, response);
/* reset call end before conn flag for next call */
SetCallEndedBeforeConnFlag(FALSE);
}
else
{
SetOutgoingCallHandle(handle);
SetDialIndication(TRUE);
if (GetTotalCallCount() > 1)
{
SyncCallList();
}
}
}
/*****************************************************************************
* FUNCTION
* OutgoingCallConnected
* DESCRIPTION
* Helper function to Generate CM known Stack Event CM_PS_CALLCONNECTED
* with the Structure containing CM_CALL_HANDLE.
*
* We could have mapped void* to CM_CALL_HANDLE and passed it to the
* state m/c. CONNECT_IND from PS
* PARAMETERS
* MsgStruct [?]
* This(?) [IN] Contains CM_CALL_HANDLE passed by the stack when call is connected)
* RETURNS
* void
*****************************************************************************/
void OutgoingCallConnected(void *MsgStruct)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MMI_CONNECT_IND *msg;
CM_CALL_HANDLE handle;
MYTIME t;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
mmi_jdd_tapi_make_call_result(JC_OK);
#endif
msg = (MMI_CONNECT_IND*) MsgStruct;
PRINT_INFORMATION(("XXX - In OutgoingCallConnected XXX\n"));
if (GetInternalAlert() == TRUE)
{
StopInternalOutgoingTone();
}
SetSpeechFlag(FALSE);
if (CM_CSD_CALL == (msg->call_type))
{
SetWapCallPresent(TRUE);
}
if (GetTotalCallCount() <= 1)
{
#ifdef __MMI_CONNECT_NOTICE__
/* play connect notice according to user defined style */
PlayConnectNotice();
#else /* __MMI_CONNECT_NOTICE__ */
playRequestedTone(CONNECT_TONE);
#endif /* __MMI_CONNECT_NOTICE__ */
}
if (GetOutgoingCallOrigin() == CM_CALL_MO_STK)
{
/* STK call doesn't have DIAL_IND, so need to set call id in CONNECT_IND */
SetOutgoingCallHandle(msg->call_id);
}
handle = GetOutgoingCallHandle();
/* log MO call with original number and name */
SetCalledNumWithTypeAux(GetMMIStructIndexof(handle), MsgStruct);
DTGetRTCTime(&t);
UpdateCallStartTimeAndLogCall(handle, &t);
/* set MO name for display in case number is changed by PS */
SetCalledNumWithType(GetMMIStructIndexof(handle), MsgStruct);
#ifdef __IP_NUMBER__
SetTempUseIPNumber(FALSE);
#endif
OutgoingProcessCMEvent(CM_PS_CALLCONNECTED, &handle);
}
/*****************************************************************************
* FUNCTION
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -