OutgoingCallManagement.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:201k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*******************************************************************************
- * Modification Notice:
- * --------------------------
- * This software is modified by MediaTek Inc. and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2001
- *
- *******************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * OutgoingCallmanagement.c
- *
- * Project:
- * --------
- * Maui_Software
- *
- * Description:
- * ------------
- * .......
- *
- * Author:
- * -------
- * -------
- *
- *------------------------------------------------------------------------------
- * $Log$
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- * Apply new bootup revise APIs
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- *******************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**************************************************************
- FILENAME : OutgoingCallmanagement.c
- PURPOSE : Call Management application
- REMARKS : nil
- AUTHOR : Subramanya BG
- DATE : Nov 11,02
- **************************************************************/
- #include "stdC.h"
- #include "MMI_Features.h"
- #include "L4Dr.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "DebugInitDef.h"
- #include "ProtocolEvents.h"
- #include "EventsGprot.h"
- #include "HistoryGprot.h"
- #include "SubLCDHistoryGprot.h"
- #include "GlobalDefs.h"
- #include "GlobalScrEnum.h"
- #include "KeyBrd.h"
- #include "TimerEvents.h"
- #include "CommonScreens.h"
- #include "wgui.h"
- #include "Wgui_categories_popup.h"
- #include "wgui_categories_CM.h"
- #include "DateTimeGprot.h"
- /* micha0521 */
- #include "SATDefs.h"
- #include "SATGProts.h"
- #include "SimDetectionGexdcl.h"
- #include "gpioInc.h"
- #include "CSP.h"
- #include "CallSetUp.h"
- #include "ProfileGprots.h"
- #include "ManageCallMain.h"
- #include "PhoneBookDef.h"
- #include "PhoneBookGprot.h"
- #include "MessagesExDcl.h"
- #include "MessagesResourceData.h"
- #include "SMSApi.h"
- #include "AlarmFrameworkProt.h"
- #include "mdi_datatype.h"
- #include "mdi_audio.h"
- #ifdef __MMI_VOICE_MEMO__
- #include "VoiceMemoProt.h"
- #endif
- #ifdef __MMI_SOUND_RECORDER__
- #include "SoundRecorderProt.h"
- #endif
- #ifdef __MMI_AUDIO_PLAYER__
- #include "AudioPlayerProt.h"
- #endif
- #ifdef __MMI_BT_HP_SUPPORT__
- #include "BTMMIHPGprots.h"
- #endif
- #ifdef __MMI_BT_SUPPORT__
- #include "BTMMIScrGprots.h"
- #endif
- #ifdef __CTM_SUPPORT__
- #include "TextPhoneDef.h"
- #include "TextPhoneProt.h"
- #endif /* __CTM_SUPPORT__ */
- #ifdef __MMI_VOIP__
- #include "VoIPGProt.h"
- #endif
- #include "CallManagementIdDef.h"
- #include "CallManagementStruct.h"
- #include "CallStructureManagementProt.h"
- #include "CmErrorTypes.h"
- #include "CmErrorHandlersProt.h"
- #include "HistoryHelperProt.h"
- #include "CommonStubsProt.h"
- #include "PsCallHelperDef.h"
- #include "mmiapi_struct.h"
- #include "PsCallHelperGprot.h"
- #include "RedialHelperGProt.h"
- #include "CallManagementGprot.h"
- #include "IncomingCallManagementProt.h"
- #include "OutgoingCallHelperProt.h"
- #include "OutgoingCallManagementProt.h"
- /* micha1115 */
- #include "CallSetUpEnum.h"
- #include "SimDetectionGprot.h"
- #define TEMP_NO 10
- #define SCR_TEXT_LEN 50
- static OUTGOING_CALL gCurrOutcall; /* This is a global variable usefull till the */
- static PU8 gcallList[MAX_CALLS];
- static U16 gcallListImage[MAX_CALLS];
- static U16 gcallListlen = 0;
- static U16 gHilitedCall = 0;
- static U8 gListOperation = 0;
- U16 gtmpOutgoingIndex;
- extern MYTIME gTimeStructForCallDuration;
- extern const U16 CMIdleScreenDigits[];
- extern S8 DTMFPadCallBuffer[MAX_DIGITS_USSD];
- extern PU8 gdispnameForSubLCD;
- extern void MMIProcessActionMsg(void);
- #if defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__)
- extern S8 *mmi_phb_image_get_path_from_id(U16 index);
- #endif
- /*****************************************************************************
- * FUNCTION
- * ReinitializeOutgoingCall
- * DESCRIPTION
- * To ReInitialize the Outgoing Call Management Application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ReinitializeOutgoingCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDialIndication(FALSE);
- #ifdef __IP_NUMBER__
- SetTempUseIPNumber(FALSE);
- #endif
- SetProtocolEventHandler(PsCBackPlayInternalTone, PRT_PLAY_GSM_TONE);
- SetProtocolEventHandler(OutgoingCallConnected, PRT_OUTGOINGCALL_CONNECTED);
- SetProtocolEventHandler(PsCbackOutgoingCallIdSync, PRT_OUTGOINGCALL_EVENT_RSP);
- SetProtocolEventHandler(PsCBackUSSDResponse, PRT_USSD_RES_SUCCESS);
- #ifdef MMI_ON_HARDWARE_P
- SetProtocolEventHandler(MakeCallReqInd, PRT_MMI_MAKE_CALL_REQ_IND);
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * InitOutGoingCall
- * DESCRIPTION
- * To Initialize the Outgoing Call Management Application
- *
- * This function sets up the handlers required for event flow and
- * application management.This function is invoked from InitIncomingCall.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitOutGoingCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReinitializeOutgoingCall();
- SetHiliteHandler(MITEM2011_CM_S_ACTIVE_END, HiliteM2019AllActiveEnd);
- SetHiliteHandler(MITEM2011_CM_END_SINGLE, HiliteM2011EndSingle);
- SetHiliteHandler(MITEM2011_CM_INC_END_SINGLE, HiliteM2011IncEndSingle);
- SetHiliteHandler(MITEM2019_CM_ALL_ACTIVE_END, HiliteM2019AllActiveEnd);
- SetHiliteHandler(MITEM2020_CM_ALL_HELD_END, HiliteM2020AllHeldEnd);
- SetHiliteHandler(MITEM2050_CM_END_HELD_ENDALL_HELD, HiliteM2020AllHeldEnd);
- SetHiliteHandler(MITEM2011_CM_END, HiliteM2016AllCallEnd);
- SetHiliteHandler(MITEM2011_CM_END_ALL, HiliteM2016AllCallEnd);
- SetHiliteHandler(MITEM2016_CM_ALL_CALL_END, HiliteM2016AllCallEnd);
- SetHiliteHandler(MITEM_OUTGOING_REJECT, HiliteIncomingReject);
- SetHiliteHandler(MITEM2010_CM_ACTIVE_HOLD, HiliteM2010ActiveHold);
- SetHiliteHandler(MITEM2010_CM_M_ACTIVE_HOLD, HiliteM2010ActiveHold);
- SetHiliteHandler(MITEM2012_CM_HELD_RETRIEVE, HiliteM2012HeldRetrieve);
- SetHiliteHandler(MITEM2012_CM_M_HELD_RETRIEVE, HiliteM2012HeldRetrieve);
- SetHiliteHandler(MITEM2014_CM_CALL_SWAP, HiliteM2014Swap);
- SetHiliteHandler(MITEM2015_CM_CALL_CONFER, HiliteM2015Conference);
- SetHiliteHandler(MITEM2017_CM_CALL_TRANSFER, HiliteM2017Transfer);
- SetHiliteHandler(MITEM2018_CM_CALL_SPLIT, HiliteM2018Split);
- SetHiliteHandler(MITEM2031_CM_PBOOK, HiliteM2031PBookAppEntry);
- SetHiliteHandler(MITEM2032_CM_SMS, HiliteM2032MsgAppEntry);
- #ifdef __MMI_VOICE_MEMO__
- SetHiliteHandler(MITEM2022_CM_VOICE_MEMO, HiliteM2022VoiceMemo);
- #endif
- #ifdef __MMI_SOUND_RECORDER__
- SetHiliteHandler(MITEM2026_CM_SOUND_RECORDER, HiliteM2026SoundRecorder);
- #endif
- #ifdef __MMI_AUDIO_PLAYER__
- SetHiliteHandler(MITEM2025_CM_AUDIO_PLAYER, HiliteM2025AudioPlayer);
- #endif
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- SetHiliteHandler(MITEM_CM_BT_SETPATH, HiliteBTCMSetPath);
- #endif
- SetHiliteHandler(MITEM2020_CM_MUTE, HiliteM2020Mute);
- SetHiliteHandler(MITEM2024_CM_DTMF, HiliteM2024DTMF);
- SetHiliteHandler(MITEM2021_CM_NEWCALL, HiliteM2021NewCall);
- #ifdef __CTM_SUPPORT__
- SetHiliteHandler(MITEM2027_CM_CTM, HiliteM2027CTM);
- #endif
- SetHintHandler(MITEM2020_CM_MUTE, Hint2020Mute);
- SetHintHandler(MITEM2024_CM_DTMF, Hint2024DTMF);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2011EndSingle
- * DESCRIPTION
- * hilite handler to invoke End Single function call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2011EndSingle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2011 End Single n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- #ifdef __GPRS_MODE__
- SetLeftSoftkeyFunction(HangupHilited, KEY_EVENT_UP);
- #else
- SetLeftSoftkeyFunction(EndSingleAndGoBack, KEY_EVENT_UP);
- #endif
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2011IncEndSingle
- * DESCRIPTION
- * hilite handler to invoke End Single function call
- * when MT call present
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2011IncEndSingle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2011 End Single n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(EndSingleAndGoBack, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2011SingleActiveEnd
- * DESCRIPTION
- * Hilite function for selecting active call to end
- *
- * In case there is only one active call the incoming call must be accepted
- * otherwise a screen to select an active call to end must be Shown
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2011SingleActiveEnd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(EndSingleActiveAndGoBack, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2019AllActiveEnd
- * DESCRIPTION
- * hilite handler to invoke function that hangup all the active call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2019AllActiveEnd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2019 AllActiveEnd n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(HangupallActive, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2020AllHeldEnd
- * DESCRIPTION
- * hilite handler to invoke the function that hangup all the heldcall
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2020AllHeldEnd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2020 AllHeldEnd n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(HangupallHeld, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2016AllCallEnd
- * DESCRIPTION
- * hilite handler to invoke the hangup of all the calls
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2016AllCallEnd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2016 AllCallEnd n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(KbCBackEndAllCallsExceptIncoming, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteIncomingReject
- * DESCRIPTION
- * hilite handler to incoming reject call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteIncomingReject(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n HiliteIncomingRejectn"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(KbCBackCallIncomingRejected, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2010ActiveHold
- * DESCRIPTION
- * hilite handler to invoke the hold function call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2010ActiveHold(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2010 ActiveHoldn"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(MakeActiveCallHold, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2012HeldRetrieve
- * DESCRIPTION
- * hilite handler to invoke the Retrieve function call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2012HeldRetrieve(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2012 HeldRetrieve n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(RetrieveHeldCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2014Swap
- * DESCRIPTION
- * hilite handler to invoke the Swap function call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2014Swap(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2014 Swap n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(SwapCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2015Conference
- * DESCRIPTION
- * hilite handler to invoke the Conference function call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2015Conference(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2015 Conference n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(ConferenceCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2017Transfer
- * DESCRIPTION
- * hilite handler to invoke the function that transfer the call
- *
- * yet to implement
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2017Transfer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2017 Transfer n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(TransferCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2018Split
- * DESCRIPTION
- * hilite handler to invoke the Split function call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2018Split(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2018 Split n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- #ifdef __GPRS_MODE__
- SetLeftSoftkeyFunction(SplitHilited, KEY_EVENT_UP);
- #else
- SetLeftSoftkeyFunction(SplitAndGoBack, KEY_EVENT_UP);
- #endif
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * DummyEnterPhbFrmActiveCall
- * DESCRIPTION
- * set CM screen flag before go to PHB application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DummyEnterPhbFrmActiveCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetCMScrnFlag(FALSE);
- mmi_phb_call_enter_from_active_call();
- DeleteScreenIfPresent(SCR1003_CM_ACTIVECALLOPTIONS);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2031PBookAppEntry
- * DESCRIPTION
- * hilite handler to invoke the Pbook app entry
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2031PBookAppEntry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2031 PBookAppEntry n"));
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetKeyHandler(DummyEnterPhbFrmActiveCall, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(DummyEnterPhbFrmActiveCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * DummyPreEntryScrMessagesMenuList
- * DESCRIPTION
- * set CM screen flag before go to SMS application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DummyPreEntryScrMessagesMenuList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetCMScrnFlag(FALSE);
- PreEntryScrMessagesMenuList();
- DeleteScreenIfPresent(SCR1003_CM_ACTIVECALLOPTIONS);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2032MsgAppEntry
- * DESCRIPTION
- * hilite handler to invoke the Msg App Entry function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2032MsgAppEntry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2032 MsgAppEntry n"));
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetKeyHandler(DummyPreEntryScrMessagesMenuList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(DummyPreEntryScrMessagesMenuList, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #ifdef __MMI_VOICE_MEMO__
- /*****************************************************************************
- * FUNCTION
- * DummyEntryVoiceMemoInCall
- * DESCRIPTION
- * set CM screen flag before go to Voice Memo application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DummyEntryVoiceMemoInCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetCMScrnFlag(FALSE);
- EntryVoiceMemoInCall();
- DeleteScreenIfPresent(SCR1003_CM_ACTIVECALLOPTIONS);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2022VoiceMemo
- * DESCRIPTION
- * hilite handler to invoke the VoiceMemo function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2022VoiceMemo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2022 Voice Memo n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(DummyEntryVoiceMemoInCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #endif /* __MMI_VOICE_MEMO__ */
- #ifdef __MMI_SOUND_RECORDER__
- /*****************************************************************************
- * FUNCTION
- * DummyEntrySoundRecorderInCall
- * DESCRIPTION
- * set CM screen flag before go to Sound Recorder application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DummyEntrySoundRecorderInCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetCMScrnFlag(FALSE);
- mmi_sndrec_entry_in_call();
- DeleteScreenIfPresent(SCR1003_CM_ACTIVECALLOPTIONS);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2026SoundRecorder
- * DESCRIPTION
- * hilite handler to invoke the VoiceMemo function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2026SoundRecorder(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2026 Sound Recorder n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(DummyEntrySoundRecorderInCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #endif /* __MMI_SOUND_RECORDER__ */
- #ifdef __MMI_AUDIO_PLAYER__
- /*****************************************************************************
- * FUNCTION
- * DummyEntryAudioPlayerInCall
- * DESCRIPTION
- * set CM screen flag before go to Audio Player application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DummyEntryAudioPlayerInCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetCMScrnFlag(FALSE);
- mmi_audply_entry_main();
- DeleteScreenIfPresent(SCR1003_CM_ACTIVECALLOPTIONS);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2025AudioPlayer
- * DESCRIPTION
- * hilite handler to invoke the AudioPlayer function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2025AudioPlayer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2025 Audio Player n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(DummyEntryAudioPlayerInCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #endif /* __MMI_AUDIO_PLAYER__ */
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- /*****************************************************************************
- * FUNCTION
- * HiliteBTCMSetPath
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteBTCMSetPath(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n CM--BT Set Voice Path n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(ProcessBTSetVoicePath, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessBTSetVoicePath
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ProcessBTSetVoicePath(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_bt_is_incall_aud_swap2bt() == MMI_TRUE)
- {
- /* Current voice path in BT, shall transfer to AG */
- mmi_bt_switch_voice_path_incall(MMI_FALSE);
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- }
- else
- {
- /* Current voice path in AG, shall transfer to BT */
- mmi_bt_switch_voice_path_incall(MMI_TRUE);
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- }
- }
- #endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */
- /*****************************************************************************
- * FUNCTION
- * HiliteM2020Mute
- * DESCRIPTION
- * hilite handler to invoke the Mute function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2020Mute(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2020 Mute n"));
- if (IsPhoneInMute())
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_SCR1002_OFF_LSK);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_SCR1002_ON_LSK);
- }
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(OptionMuteorUnMutetheCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2024DTMF
- * DESCRIPTION
- * hilite handler to invoke the DTMF function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2024DTMF(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2024 DTMF n"));
- if (GetDTMFFlag() == TRUE)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_SCR1002_OFF_LSK);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_SCR1002_ON_LSK);
- }
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(DTMFFunction, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #ifdef __CTM_SUPPORT__
- /*****************************************************************************
- * FUNCTION
- * HiliteM2027CTM
- * DESCRIPTION
- * hilite handler to invoke the CTM connection
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2027CTM(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2027 CTM n"));
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(mmi_ctm_connect, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #endif /* __CTM_SUPPORT__ */
- /*****************************************************************************
- * FUNCTION
- * HiliteM2023LoudSp
- * DESCRIPTION
- * hilite handler to invoke the LoudSpeaker function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2023LoudSp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2023 Loud Speaker n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(LoudSpeakerFunction /* fromOptions */ , KEY_EVENT_UP);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteM2021NewCall
- * DESCRIPTION
- * hilite handler to invoke the NewCall function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteM2021NewCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n 2021 New Call n"));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
- SetLeftSoftkeyFunction(EnterScreenAndHandleDigit, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * Hint2020Mute
- * DESCRIPTION
- * hint handler to get mute status
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void Hint2020Mute(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsPhoneInMute() == TRUE)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * Hint2024DTMF
- * DESCRIPTION
- * hint handler to get dtmf status
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void Hint2024DTMF(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetDTMFFlag() == TRUE)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * MakeMOForAT
- * DESCRIPTION
- * Makes MO Call from AT Command
- * PARAMETERS
- * num [IN]
- * length [IN]
- * callType [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void MakeMOForAT(PS8 num, U8 length, U8 callType)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PHB_CM_INTERFACE phb_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetCurrentState() == CM_OUTGOING_STATE)
- {
- if (cm_p->redial_info.RedialTimer == TRUE)
- {
- /* stop redialing */
- ResetRedialAttempts();
- SetCurrentState(CM_IDLE_STATE);
- }
- else
- {
- /* already MO, ignore it */
- return;
- }
- }
- memset(&gCurrOutcall, 0, sizeof(OUTGOING_CALL));
- if (strlen((void*)num) > MAX_DIGIT)
- {
- PRINT_INFORMATION(("XXX Number too big XXX n"));
- ShowCallManagementErrorMessage(ERR_INVALID_NUMBER_FORMAT);
- return;
- }
- if (length > 0)
- {
- AnsiiToUnicodeString((PS8) gCurrOutcall.Number, (PS8) num);
- }
- SetPreviousState((CALL_STATE) GetCurrentState());
- SetCurrentState(CM_OUTGOING_STATE);
- gtmpOutgoingIndex = GetFirstFreeIndex();
- AddNewCallInfo(
- (PU8) gCurrOutcall.Number,
- GetCurrentState(),
- GetPreviousState(),
- CM_CALL_MO,
- (CM_CALL_HANDLE) (gtmpOutgoingIndex + 1),
- callType);
- SetCCFlag(TRUE);
- SetDialIndication(FALSE);
- /* MO call */
- /* look up dialed number from phonebook first anyway */
- if (length > 0)
- {
- phb_data = mmi_phb_call_get_data_for_call_mgnt((PU8) gCurrOutcall.Number, FALSE);
- SetCMPhoneBookStruct(&phb_data);
- SetOutgoingNamefromPhonebook();
- }
- if (callType == CM_CSD_CALL)
- {
- stopRequestedTone(MESSAGE_TONE);
- }
- #ifdef __MMI_BT_PROFILE__
- else
- {
- /* 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__ */
- AlmDisableExpiryHandler();
- SetProtocolEventHandler(OutgoingCallConnected, PRT_OUTGOINGCALL_CONNECTED);
- OutgoingProcessCMEvent(CM_PS_SHOW_OUTGOING_CALL_SCREEN, NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * OutgoingProcessCMEvent
- * DESCRIPTION
- * This is the Entry function for all the Events while the Call-Management application
- * is Active.
- *
- * This function handles the events from both keyboard and protocol stack.
- * The keyboard events have KB in there defination and Protocol has PS.
- * PARAMETERS
- * inEvenType [IN]
- * MsgStruct [?]
- * pointer(?) [IN] To the event's associated structure)
- * RETURNS
- * void
- *****************************************************************************/
- void OutgoingProcessCMEvent(CM_EVENT_TYPES inEvenType, void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- ACTION_RESULT result = CM_CALL_FAILURE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("XXX In OutgoingProcessCMEventn"));
- switch (inEvenType)
- {
- case CM_PS_SHOW_OUTGOING_CALL_SCREEN:
- ProcessShowOutgoingCallScreen();
- break;
- case CM_PS_SHOW_REQUESTING_CALL_SCREEN:
- if (GetActiveScreenId() == SCR_CM_REQUESTINGUSSD)
- {
- /* current active screen is SS requesting, display and remove previous*/
- EntryScrUSSDReq();
- RemoveSSReqScr();
- SetDelScrnIDCallbackHandler(SCR_CM_REQUESTINGUSSD, (HistoryDelCBPtr) SSReqHistoryDelHdlr);
- }
- else if (IsScreenPresent(SCR_CM_REQUESTINGUSSD))
- {
- /* SS requesting screen is in history, do nothing */
- }
- else
- {
- /* current active screen is NOT SS requesting, not in history also, display requesting screen*/
- EntryScrUSSDReq();
- }
- /* if (IsScreenPresent(CM_SCR_MARKER) == FALSE)
- AddMarkerToHistory(); */
- break;
- case CM_PS_USSD_RECVD:
- ProcessUSSDrecieved(MsgStruct);
- break;
- case CM_KB_OUTGOINGCALL:
- /* MO SEND key */
- result = ProcessKBOutgoingEvent(MsgStruct);
- break;
- case CM_PS_CALLCONNECTED:
- /* connect ind */
- result = ProcessPSCallconnectedEvent(MsgStruct);
- break;
- case CM_KB_HANGUPREQ:
- /* 1X send, drop single call */
- result = ProcessKBHangupReqEvent(MsgStruct);
- break;
- case CM_PS_HANGUPSUC:
- result = ProcessPSHangupSucEvent(MsgStruct);
- break;
- case CM_KB_HANGUPALLREQ:
- /* END key in CM */
- result = ProcessKBHangupallReqEvent(MsgStruct);
- break;
- case CM_PS_HANGUPALLSUC:
- result = ProcessPSHangupallSucEvent(MsgStruct);
- break;
- case CM_KB_HANGUPALLACTREQ:
- /* Menu End All Active */
- result = ProcessKBHangupallActReqEvent(MsgStruct);
- break;
- case CM_PS_HANGUPALLACTSUC:
- result = ProcessPSHangupallActSucEvent(MsgStruct);
- break;
- case CM_KB_HANGUPALLHLDREQ:
- result = ProcessKBHangupallHldReqEvent(MsgStruct);
- break;
- case CM_PS_HANGUPALLHLDSUC:
- result = ProcessPSHangupallHldSucEvent(MsgStruct);
- break;
- case CM_KB_HOLDREQ:
- result = ProcessKBHoldReqEvent(MsgStruct);
- break;
- case CM_PS_HOLDSUC:
- result = ProcessPSHoldSucEvent(MsgStruct);
- break;
- case CM_KB_RETRIEVEREQ:
- result = ProcessKBRetrieveReqEvent(MsgStruct);
- break;
- case CM_PS_RETRIEVESUC:
- result = ProcessPSRetrieveSucEvent(MsgStruct);
- break;
- case CM_KB_SWAPREQ:
- result = ProcessKBSwapReqEvent(MsgStruct);
- break;
- case CM_PS_SWAPSUC:
- result = ProcessPSSwapSucEvent(MsgStruct);
- break;
- case CM_KB_CONFREQ:
- result = ProcessKBConfReqEvent(MsgStruct);
- break;
- case CM_PS_CONFSUC:
- result = ProcessPSConfSucEvent(MsgStruct);
- break;
- case CM_KB_SPLITREQ:
- result = ProcessKBSplitReqEvent(MsgStruct);
- break;
- case CM_PS_SPLITSUC:
- result = ProcessPSSplitSucEvent(MsgStruct);
- break;
- case CM_KB_ECT_REQ:
- result = ProcessKBEctReqEvent(MsgStruct);
- break;
- case CM_PS_ECT_SUC:
- result=ProcessPSEctSuccessful(MsgStruct);
- break;
- case CM_KB_CALL_DEFLECT_REQ:
- MakePsCallDeflect((void*)PsCBackCallDeflected, (PU8) MsgStruct);
- ShowCategory302Screen(NULL);
- break;
- case CM_PS_INCOMING_CALL_DEFLECT:
- ShowCategory302Screen(NULL);
- break;
- default:
- PRINT_INFORMATION(("n CM Event Handler does not exist n"));
- break;
- }
- PRINT_INFORMATION_2((MMI_TRACE_G5_CM, "*-------[OutgoingCallManagement.c] OutgoingProcessCMEvent: result = "
- " %d-------*n", (int)result));
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessShowOutgoingCallScreen
- * DESCRIPTION
- * This is the function to show outgoing call only when the Call list is recieved
- *
- * This invokes the protocol function if the state is in Idle/hold state.
- * In Active state,it makes the request to hold and after success it initiates the call.
- * PARAMETERS
- * void
- * void(?) [IN] *(this points to OUTGOING_CALL structure)
- * ACTION_RESULT(?) [OUT]
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.(?)
- *****************************************************************************/
- void ProcessShowOutgoingCallScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("XXX In ProcessShowOutgoingCallScreen n"));
- switch (GetPreviousState())
- {
- case CM_IDLE_STATE:
- /* do not have to suspend audio for CSD call */
- EntryScr1001OutgoingCall();
- if (GetOutgoingCallType() != CM_CSD_CALL)
- {
- mdi_audio_suspend_background_play();
- }
- if (IsScreenPresent(CM_SCR_MARKER) == FALSE)
- {
- AddMarkerToHistory();
- }
- break;
- case CM_INCOMING_STATE:
- case CM_HOLD_STATE:
- case CM_ACTIVE_STATE:
- EntryScr1001OutgoingCall();
- if (GetOutgoingCallOrigin() == CM_CALL_MO_STK)
- {
- AddMarkerToHistory();
- }
- break;
- default:
- PRINT_INFORMATION(("n KBOutgoingEvent CM State Machine is in incorrect state n"));
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessKBOutgoingEvent
- * DESCRIPTION
- * This is the function to process Keyboard(Request) Event CM_KB_OUTGOINGCALL.
- *
- * This invokes the protocol function if the state is in Idle/hold state.
- * In Active state,it makes the request to hold and after success it initiates the call.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to OUTGOING_CALL structure)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessKBOutgoingEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memcpy(&gCurrOutcall, MsgStruct, sizeof(OUTGOING_CALL));
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- if (AllowMoreCalls() && DTMFPadCallBuffer[0] != 0)
- {
- SetPreviousState(CM_IDLE_STATE);
- SetCurrentState(CM_OUTGOING_STATE);
- gtmpOutgoingIndex = GetFirstFreeIndex();
- AddNewCallInfo(
- gCurrOutcall.Number,
- CM_OUTGOING_STATE,
- CM_IDLE_STATE,
- CM_CALL_MO,
- (CM_CALL_HANDLE) (gtmpOutgoingIndex + 1),
- CSMCC_VOICE_CALL);
- MakePsInitiateCall((PU8) DTMFPadCallBuffer, (void*)OutgoingCallConnected);
- }
- else
- {
- ShowCallManagementErrorMessage(NO_ACTIVE_CALL);
- return CM_CALL_FAILURE;
- }
- break;
- case CM_OUTGOING_STATE:
- PRINT_INFORMATION(("XXX In ProcessKBOutgoingEvent already outgoing, can't make MOn"));
- ShowCallManagementErrorMessage(ERR_L4C_GEN_CAUSE);
- return CM_CALL_FAILURE;
- case CM_INCOMING_STATE:
- case CM_HOLD_STATE:
- case CM_ACTIVE_STATE:
- /* send SS when MT call and previous USSR seession exists,
- need to abort previous session */
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- DeleteScreenIfPresent(ITEM_SCR_USSR_EDIT);
- if (AllowMoreCalls())
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_OUTGOING_STATE);
- gtmpOutgoingIndex = GetFirstFreeIndex();
- AddNewCallInfo(
- gCurrOutcall.Number,
- GetCurrentState(),
- CM_IDLE_STATE,
- CM_CALL_MO,
- (CM_CALL_HANDLE) (gtmpOutgoingIndex + 1),
- CSMCC_VOICE_CALL);
- MakePsInitiateCall((PU8) DTMFPadCallBuffer, (void*)OutgoingCallConnected);
- }
- else
- {
- ShowCallManagementErrorMessage(NO_ACTIVE_CALL);
- return CM_CALL_FAILURE;
- }
- break;
- default:
- PRINT_INFORMATION(("n KBOutgoingEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessPSCallconnectedEvent
- * DESCRIPTION
- * This is the function to process Protocol(Response) Event CM_PS_CALLCONNECTED.
- *
- * This change the state of the call to ACTIVE & also changes the
- * state of the State m/c.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to CM_CALL_HANDLE of the call which requested CM_KB_OUTGOINGCALL)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessPSCallconnectedEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE callHandle;
- CM_CALL_HANDLE *handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- handle = (CM_CALL_HANDLE*) MsgStruct;
- callHandle = *handle;
- //SetCallHandleForStartTimeUpdate(callHandle);
- if (callHandle == -1)
- {
- PRINT_INFORMATION(("n PSCallconnectedEvent Getting the Connected Handle has -1 n"));
- return CM_CALL_FAILURE;
- }
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n PSCallconnectedEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- MakeHold();
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_ACTIVE_STATE);
- SetCallState(gtmpOutgoingIndex, CM_ACTIVE_STATE, FALSE);
- if (GetWapCallPresent())
- {
- ShowSubLCDScreen(EntrySubLcdScr1002ActiveCall);
- CMGetExactTime(UpdateCallStartTimeforWapCall);
- /* in wap call => no marker in history */
- if (IsScreenPresent(CM_SCR_MARKER))
- {
- DeleteNScrId(CM_SCR_MARKER);
- GoBackHistory();
- }
- else
- {
- GoBackHistory();
- }
- break;
- }
- if (GetTotalCallCount() > 1)
- {
- CM_CALL_HANDLE handle;
- handle = GetIncomingCallHandle();
- if (handle != -1)
- {
- PHB_CM_INTERFACE phb_data;
- SetPreviousState(CM_ACTIVE_STATE);
- SetCurrentState(CM_INCOMING_STATE);
- if (GetNotifySSFlag() == TRUE)
- {
- SetNotifySSFlag(FALSE);
- SetCbackAfterSS(NULL);
- }
- /* initiate call start time without get into active call screen */
- CMGetExactTime(UpdateCallStartTimeforWapCall);
- /* MT call caller picture, ringtone...will be overwrite by MO call,
- it needs to be restored after MO call connected */
- 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);
- GoBackToHistory(ITEMSCR_INCOMING_CALL);
- }
- else
- {
- GoBackToHistory(SCR_CM_ACTIVECALLSCREEN);
- }
- }
- else
- {
- if (IsScreenPresent(SCR_CM_ACTIVECALLSCREEN))
- {
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- GoBackToHistory(SCR_CM_ACTIVECALLSCREEN);
- }
- else
- {
- EntryScr1002ActiveCall();
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- DeleteUptoCmScreen();
- }
- }
- break;
- case CM_INCOMING_STATE:
- PRINT_INFORMATION(("n PSCallconnectedEvent CM_INCOMING_STATE not handled still n"));
- break;
- case CM_ACTIVE_STATE:
- PRINT_INFORMATION(("n PSCallconnectedEvent CM_ACTIVE_STATE not handled still n"));
- break;
- case CM_HOLD_STATE:
- PRINT_INFORMATION(("n PSCallconnectedEvent CM_HOLD_STATE not handled still n"));
- break;
- default:
- PRINT_INFORMATION(("n PSCallconnectedEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessKBHangupReqEvent
- * DESCRIPTION
- * This is the function to process Keyboard(Request) Event CM_KB_HANGUPREQ.
- *
- * This Sets the flag CM_HANGUP_REQUESTED and invoke the protocol function irrespective of the state.
- * The chances of this being invoked in idle state is very less.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to CM_CALL_HANDLE of the call to get dropped)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessKBHangupReqEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE handle;
- CALL_STATE state;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("XXX In ProcessKBHangupReqEventn"));
- if (GetInternalAlert() == TRUE)
- {
- StopInternalOutgoingTone();
- }
- handle = *((CM_CALL_HANDLE*) MsgStruct);
- state = GetCallState(handle);
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("nKBHangupEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- SetCallflag(handle, CM_HANGUP_REQUESTED, TRUE);
- if (state == CM_ACTIVE_STATE || state == CM_HOLD_STATE || state == CM_INCOMING_STATE)
- {
- /* Start by Julia: Drop call refinement */
- SetCallState(handle, CM_DISCONNECTING_STATE, TRUE);
- //EntryScr1001OutgoingCall();
- // End by Julia
- MakePsEndSelectiveCall((void*)HangupReqSucess, handle);
- }
- else if ((GetDialIndication() == FALSE) || (GetOutgoingCallType() == CM_CSD_CALL))
- {
- SetCallAbortReqSentFlag(TRUE);
- /* Start by Julia: Drop call refinement */
- handle = GetOutgoingCallHandle();
- SetCallState(handle, CM_DISCONNECTING_STATE, TRUE);
- //EntryScr1001OutgoingCall();
- // End by Julia
- MakePsAthRequest((void*)PsCBackOutgoingCallEnded);
- }
- else
- {
- /* Start by Julia: Drop call refinement */
- SetCallState(handle, CM_DISCONNECTING_STATE, TRUE);
- //EntryScr1001OutgoingCall();
- // End by Julia
- MakePsEndSelectiveCall((void*)HangupReqSucess, handle);
- }
- break;
- case CM_INCOMING_STATE:
- // Start by Julia: Drop call refinement
- // Drop call refinement is not applicable when waiting call exists
- SetCallflag(handle, CM_HANGUP_REQUESTED, TRUE);
- MakePsEndSelectiveCall((void*)HangupReqSucess, handle);
- break;
- /* End by Julia */
- case CM_ACTIVE_STATE:
- case CM_HOLD_STATE:
- SetCallflag(handle, CM_HANGUP_REQUESTED, TRUE);
- /* Start by Julia: Drop call refinement */
- SetCallState(handle, CM_DISCONNECTING_STATE, TRUE);
- //EntryScr1002ActiveCall();
- // End by Julia
- MakePsEndSelectiveCall((void*)HangupReqSucess, handle);
- break;
- default:
- PRINT_INFORMATION(("n KBHangupEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessPSHangupSucEvent
- * DESCRIPTION
- * This is the function to process Protocol(Response) Event CM_PS_HANGUPSUC.
- *
- * This resets the CM_HANGUP_REQUESTED flag and then change the states of the call to IDLE
- * if necessary it also changes the state of the State m/c.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to CM_CALL_HANDLE of the call which requested CM_KB_HANGUPREQ)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessPSHangupSucEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE *handle;
- U8 flag = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("XXX In ProcessPSHangupSucEvent XXX"));
- PRINT_INFORMATION(("n X@X@X@X!!n"));
- handle = (CM_CALL_HANDLE*) MsgStruct;
- if ((*handle == -1) || (GetMMIStructIndexof(*handle) == -1))
- {
- PRINT_INFORMATION(("nBad call handle -1 in HangupSucn"));
- #ifdef __MMI_VOIP__
- /* call back voip to connect voip */
- if ((mmi_voip_app_total_call() != 0) && (mmi_voip_app_get_conn_flag() == MMI_VOIP_CALL_CONN_VOIP))
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_NONE);
- mmi_voip_entry_ans_to_conn_voip();
- }
- #endif /* __MMI_VOIP__ */
- return CM_CALL_FAILURE;
- }
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n PSHangupSucEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- PRINT_INFORMATION(("XXX In ProcessPSHangupSucEvent : Outgoing StateXXX"));
- LogCallInfoForCallHistory(*handle);
- if (GetCallState(*handle) == CM_OUTGOING_STATE)
- {
- PRINT_INFORMATION(("XXX In ProcessPSHangupSucEvent : Call being dropped is outgoingXXX"));
- flag = TRUE;
- GetEndTimeAndNotifyCallAborted();
- if (GetOutgoingCallOrigin() == CM_CALL_MO_STK)
- {
- SATCallExitCause(SAT_CALL_DISCONNECT_BEFORE_CONNECT);
- }
- }
- else
- {
- GetEndTimeAndNotifyEndCallDuration(*handle);
- }
- #ifdef __IP_NUMBER__
- SetTempUseIPNumber(FALSE);
- #endif
- ResetCallflag((*handle), CM_HANGUP_REQUESTED, TRUE);
- SetCallState((*handle), CM_IDLE_STATE, TRUE);
- if (GetTotalCallCount() == 0)
- {
- PRINT_INFORMATION(("XXX In ProcessPSHangupSucEvent :GetTotalCallCount=0XXX"));
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_IDLE_STATE);
- }
- else
- {
- PRINT_INFORMATION(("XXX In ProcessPSHangupSucEvent :GetTotalCallCount not 0 XXX"));
- if (flag)
- {
- SetCurrentState(GetPreviousState());
- SetPreviousState(CM_OUTGOING_STATE);
- }
- else if (CM_OUTGOING_STATE == GetCurrentState())
- {
- break;
- }
- if (GetTotalCallCount() == GetTotalHoldCallCount())
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_HOLD_STATE);
- }
- }
- break;
- case CM_INCOMING_STATE:
- PRINT_INFORMATION(("XXX In ProcessPSHangupSucEvent : Incoming StateXXX"));
- LogCallInfoForCallHistory(*handle);
- /* rel active and accept waiting but waiting is released by network */
- if (GetIncomingCallHandle() == *handle)
- {
- SetCurrentState(GetPreviousState());
- SetPreviousState(CM_INCOMING_STATE);
- SetCallState((*handle), CM_IDLE_STATE, TRUE);
- }
- else
- {
- GetEndTimeAndNotifyEndCallDuration(*handle);
- SetCallState((*handle), CM_IDLE_STATE, TRUE);
- if (GetTotalActiveCallCount() != 0)
- {
- SetPreviousState(CM_ACTIVE_STATE);
- }
- else if (GetTotalHoldCallCount() != 0)
- {
- SetPreviousState(CM_HOLD_STATE);
- }
- }
- break;
- case CM_HOLD_STATE:
- case CM_ACTIVE_STATE:
- PRINT_INFORMATION(("XXX In ProcessPSHangupSucEvent : HOLD/Active StateXXX"));
- LogCallInfoForCallHistory(*handle);
- GetEndTimeAndNotifyEndCallDuration(*handle);
- ResetCallflag((*handle), CM_HANGUP_REQUESTED, TRUE);
- SetCallState((*handle), CM_IDLE_STATE, TRUE);
- if (GetTotalCallCount() == 0)
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_IDLE_STATE);
- }
- else if ((GetTotalActiveCallCount() == 0) && (GetTotalCallCount() == GetTotalHoldCallCount()))
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_HOLD_STATE);
- }
- break;
- default:
- PRINT_INFORMATION(("n PSHangupSucEvent CM State m/c Corrupted n"));
- #ifdef __MMI_VOIP__
- /* call back voip to connect voip */
- if ((mmi_voip_app_total_call() != 0) && (mmi_voip_app_get_conn_flag() == MMI_VOIP_CALL_CONN_VOIP))
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_NONE);
- mmi_voip_entry_ans_to_conn_voip();
- }
- #endif /* __MMI_VOIP__ */
- return CM_CALL_FAILURE;
- }
- #ifdef __MMI_VOIP__
- /* call back voip to connect voip */
- if ((mmi_voip_app_total_call() != 0) && (mmi_voip_app_get_conn_flag() == MMI_VOIP_CALL_CONN_VOIP))
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_NONE);
- mmi_voip_entry_ans_to_conn_voip();
- }
- #endif /* __MMI_VOIP__ */
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessKBHangupallReqEvent
- * DESCRIPTION
- * This is the function to process Keyboard(Request) Event CM_KB_HANGUPALLREQ.
- *
- * This Sets the flag CM_HANGUP_REQUESTED to all the calls
- * Invoke the protocol function irrespective of the state.
- * This is always Invoked in Active state.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to NULL as the Hangup is requested on all calls)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessKBHangupallReqEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n KBHangupallReqEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_INCOMING_STATE:
- // Start by Julia: Drop call refinement
- // Drop call refinement is not applicable when waiting call exists
- SetAllHangupFlag();
- MakePsHangupallRequest((void*)HangupallReqSucess);
- break;
- /* End by Julia */
- case CM_OUTGOING_STATE:
- case CM_HOLD_STATE:
- case CM_ACTIVE_STATE:
- SetAllHangupFlag();
- /* Start by Julia: Drop call refinement */
- SetAllExceptWaitingCallState(CM_DISCONNECTING_STATE);
- //EntryScr1002ActiveCall();
- // End by Julia
- MakePsHangupallRequest((void*)HangupallReqSucess);
- break;
- default:
- PRINT_INFORMATION(("n KBHangupallReqEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessPSHangupallSucEvent
- * DESCRIPTION
- * This is the function to process Protocol(Response) Event CM_PS_HANGUPALLSUC.
- *
- * This resets the CM_HANGUP_REQUESTED flag & change the state of the all calls
- * to IDLE.It also changes the state m/c to IDLE.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Is Null as the request CM_KB_HANGUPALLREQ is on all calls)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessPSHangupallSucEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE *handle;
- CALL_STATE state;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- handle = (CM_CALL_HANDLE*) MsgStruct;
- /* Start by Julia: Drop call refinement */
- if ((*handle) == -1 || GetMMIStructIndexof(*handle) == -1)
- {
- /* call already dropped */
- PRINT_INFORMATION(("nBad call handle -1 in HangupAllSucn"));
- #ifdef __MMI_VOIP__
- /* call back voip to connect voip */
- if ((mmi_voip_app_total_call() != 0) && (mmi_voip_app_get_conn_flag() == MMI_VOIP_CALL_CONN_VOIP))
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_NONE);
- mmi_voip_entry_ans_to_conn_voip();
- }
- #endif /* __MMI_VOIP__ */
- return CM_CALL_FAILURE;
- }
- /* End by Julia */
- LogCallInfoForCallHistory(*handle);
- state = GetCallState(*handle);
- if (state != CM_STATE_UNKNOWN)
- {
- /* incoming call will be handled in SetCallState */
- if (state != CM_INCOMING_STATE)
- {
- GetEndTimeAndNotifyEndCallDuration(*handle);
- }
- SetCallState((*handle), CM_IDLE_STATE, TRUE);
- }
- if (GetTotalActiveCallCount() + GetTotalHoldCallCount() > 0)
- {
- #ifdef __MMI_VOIP__
- /* call back voip to connect voip */
- if ((mmi_voip_app_total_call() != 0) && (mmi_voip_app_get_conn_flag() == MMI_VOIP_CALL_CONN_VOIP))
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_NONE);
- mmi_voip_entry_ans_to_conn_voip();
- }
- #endif /* __MMI_VOIP__ */
- return CM_CALL_SUCCESS;
- }
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n PSHangupallSucEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_INCOMING_STATE:
- case CM_OUTGOING_STATE:
- case CM_HOLD_STATE:
- case CM_ACTIVE_STATE:
- if (GetTotalCallCount() == 0)
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_IDLE_STATE);
- }
- else if (state == CM_INCOMING_STATE || state == CM_OUTGOING_STATE)
- {
- SetCurrentState(GetPreviousState());
- SetPreviousState(state);
- }
- break;
- default:
- PRINT_INFORMATION(("n PSHangupallSucEvent CM State m/c Corrupted n"));
- #ifdef __MMI_VOIP__
- /* call back voip to connect voip */
- if ((mmi_voip_app_total_call() != 0) && (mmi_voip_app_get_conn_flag() == MMI_VOIP_CALL_CONN_VOIP))
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_NONE);
- mmi_voip_entry_ans_to_conn_voip();
- }
- #endif /* __MMI_VOIP__ */
- return CM_CALL_FAILURE;
- }
- #ifdef __MMI_VOIP__
- /* call back voip to connect voip */
- if ((mmi_voip_app_total_call() != 0) && (mmi_voip_app_get_conn_flag() == MMI_VOIP_CALL_CONN_VOIP))
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_NONE);
- mmi_voip_entry_ans_to_conn_voip();
- }
- #endif /* __MMI_VOIP__ */
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessKBHangupallActReqEvent
- * DESCRIPTION
- * This is the function to process Keyboard(Request) Event CM_KB_HANGUPALLACTREQ.
- *
- * This Sets the flag CM_HANGUP_REQUESTED to all the Active calls
- * Invoke the protocol function irrespective of the state.
- * This is always Invoked in Active state as active call take precedence over held call.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to NULL as the Hangup is requested on all Active calls)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessKBHangupallActReqEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n KBHangupallActReqEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- PRINT_INFORMATION(("n KBHangupallActReqEvent CM_OUTGOING_STATE not handled still n"));
- break;
- case CM_INCOMING_STATE:
- // Start by Julia: Drop call refinement
- // Drop call refinement is not applicable when waiting call exists
- SetAllActHangupFlag();
- MakePsHangupallActiveRequest((void*)HangupallActReqSucess);
- break;
- /* End by Julia */
- case CM_ACTIVE_STATE:
- SetAllActHangupFlag();
- /* Start by Julia: Drop call refinement */
- SetAllActiveCallState(CM_DISCONNECTING_STATE);
- //EntryScr1002ActiveCall();
- // End by Julia
- MakePsHangupallActiveRequest((void*)HangupallActReqSucess);
- break;
- case CM_HOLD_STATE:
- PRINT_INFORMATION(("n KBHangupallActReqEvent CM_HOLD_STATE not handled still n"));
- break;
- default:
- PRINT_INFORMATION(("n KBHangupallActReqEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessPSHangupallActSucEvent
- * DESCRIPTION
- * This is the function to process Protocol(Response) Event CM_PS_HANGUPALLACTSUC.
- *
- * This resets the CM_HANGUP_REQUESTED flag & change the state of the all Active calls
- * to IDLE.If necessary,It also changes the state of the state m/c.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Is Null as the request CM_KB_HANGUPALLACTREQ is on all Active calls)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessPSHangupallActSucEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE *handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n *** In ProcessPSHangupallActSucEventn"));
- handle = (CM_CALL_HANDLE*) MsgStruct;
- /* Start by Julia: Drop call refinement */
- if ((*handle) == -1)
- {
- PRINT_INFORMATION(("nBad call handle -1 in HangupAllActSucn"));
- return CM_CALL_FAILURE;
- }
- /* End by Julia */
- LogCallInfoForCallHistory(*handle);
- GetEndTimeAndNotifyEndCallDuration(*handle);
- SetCallState(*handle, CM_IDLE_STATE, TRUE);
- if (GetTotalActiveCallCount() >= 1)
- {
- return CM_CALL_SUCCESS;
- }
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n PSHangupallActSucEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- PRINT_INFORMATION(("n PSHangupallActSucEvent CM_OUTGOING_STATE not handled still n"));
- break;
- case CM_INCOMING_STATE:
- case CM_ACTIVE_STATE:
- MakeAllActHangup();
- if (GetTotalCallCount() == 0)
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_IDLE_STATE);
- }
- break;
- case CM_HOLD_STATE:
- PRINT_INFORMATION(("n PSHangupallActSucEvent CM_HOLD_STATE not handled still n"));
- break;
- default:
- PRINT_INFORMATION(("n Illegal state to be in n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessKBHangupallHldReqEvent
- * DESCRIPTION
- * This is the function to process Keyboard(Request) Event CM_KB_HANGUPALLHLDREQ.
- *
- * This Sets the flag CM_HANGUP_REQUESTED to all the Hold/Held calls
- * Invoke the protocol function irrespective of the state.
- * This is Invoked in Active or Hold state.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to NULL as the Hangup is requested on all Hold State calls)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessKBHangupallHldReqEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetAllHldHangupFlag();
- // Start by Julia: Drop call refinement
- // Drop call refinement is not applicable when waiting call exists
- if (GetCurrentState() != CM_INCOMING_STATE)
- {
- SetAllHeldCallState(CM_DISCONNECTING_STATE);
- /* EntryScr1002ActiveCall(); */
- }
- /* End by Julia */
- MakePsSendRelHeld((void*)HangupallHldReqSucess);
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessPSHangupallHldSucEvent
- * DESCRIPTION
- * This is the function to process Protocol(Response) Event CM_PS_HANGUPALLHLDSUC.
- *
- * This resets the CM_HANGUP_REQUESTED flag & change the state of the all held calls
- * to IDLE.If necessary,It also changes the state of the state m/c.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Is Null as the request CM_KB_HANGUPALLHLDREQ is on all Held/Hold state calls)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessPSHangupallHldSucEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE *handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- handle = (CM_CALL_HANDLE*) MsgStruct;
- /* Start by Julia: Drop call refinement */
- if ((*handle) == -1)
- {
- PRINT_INFORMATION(("nBad call handle -1 in HangupAllHldSucn"));
- return CM_CALL_FAILURE;
- }
- /* End by Julia */
- LogCallInfoForCallHistory(*handle);
- GetEndTimeAndNotifyEndCallDuration(*handle);
- SetCallState((*handle), CM_IDLE_STATE, TRUE);
- if (GetTotalHoldCallCount() > 0)
- {
- return CM_CALL_SUCCESS;
- }
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n PSHangupallHldSucEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- PRINT_INFORMATION(("n PSHangupallHldSucEvent CM_OUTGOING_STATE not handled still n"));
- break;
- case CM_INCOMING_STATE:
- PRINT_INFORMATION(("n PSHangupallHldSucEvent CM_INCOMING_STATE not handled still n"));
- break;
- case CM_ACTIVE_STATE:
- case CM_HOLD_STATE:
- if (GetTotalCallCount() == 0)
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_IDLE_STATE);
- }
- break;
- default:
- PRINT_INFORMATION(("n PSHangupallHldSucEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessKBHoldReqEvent
- * DESCRIPTION
- * This is the function to process Keyboard(Request) Event CM_KB_HOLDREQ.
- *
- * This Sets the flag CM_HOLD_REQUESTED to all the active call
- * Invoke the protocol function irrespective of the state.
- * The chances of this being invoked in Idle or Hold state is very less.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Points to NULL as the hold is request on all active calls)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessKBHoldReqEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetChldReqSent() != CM_ACTION_NONE)
- {
- return CM_CALL_FAILURE;
- }
- flag = GetAllCallFlags();
- if (((flag & CM_SWAP_REQUESTED) != 0) ||
- ((flag & CM_CONF_REQUESTED) != 0) ||
- ((flag & CM_ECT_REQUESTED) != 0))
- {
- return CM_CALL_FAILURE;
- }
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n KBHoldReqEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- PRINT_INFORMATION(("n KBHoldReqEvent CM_OUTGOING_STATE not handled still n"));
- break;
- case CM_INCOMING_STATE:
- PRINT_INFORMATION(("n KBHoldReqEvent CM_INCOMING_STATE not handled still n"));
- break;
- case CM_ACTIVE_STATE:
- SetHoldFlag();
- MakePsActiveHold((void*)HoldReqSucess);
- break;
- case CM_HOLD_STATE:
- PRINT_INFORMATION(("n KBHoldReqEvent CM_HOLD_STATE not handled still n"));
- break;
- default:
- PRINT_INFORMATION(("n KBHoldReqEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessPSHoldSucEvent
- * DESCRIPTION
- * This is the function to process Protocol(Response) Event CM_PS_HOLDSUC.
- *
- * This resets the CM_HOLD_REQUESTED flag & change the state of the call from
- * ACTIVE to HOLD if necessary it also changes the state of the State m/c.
- * PARAMETERS
- * MsgStruct [?]
- * ACTION_RESULT(?) [OUT]
- * this(?) [IN] Is Null as the request CM_KB_HOLDREQ is on all active call)
- * RETURNS
- * This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
- *****************************************************************************/
- ACTION_RESULT ProcessPSHoldSucEvent(void *MsgStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- PRINT_INFORMATION(("n PSHoldSucEvent CM_IDLE_STATE not handled still n"));
- break;
- case CM_OUTGOING_STATE:
- PRINT_INFORMATION(("n PSHoldSucEvent CM_OUTGOING_STATE not handled still n"));
- break;
- case CM_INCOMING_STATE:
- PRINT_INFORMATION(("n PSHoldSucEvent CM_INCOMING_STATE n"));
- MakeHold();
- EntryScr1005NotifyHoldSucess();
- SyncCallList();
- break;
- case CM_ACTIVE_STATE:
- PRINT_INFORMATION(("n PSHoldSucEvent CM_ACTIVE_STATE n"));
- MakeHold();
- EntryScr1005NotifyHoldSucess();
- break;
- case CM_HOLD_STATE:
- PRINT_INFORMATION(("n HoldSucEvent CM_HOLD_STATE not handled still n"));
- break;
- default:
- PRINT_INFORMATION(("n PSHoldSucEvent CM State m/c Corrupted n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_SUCCESS;
- }