CallManagementIncoming.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:214k
源码类别:
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:
- * ---------
- * CallManagementIncoming.c
- *
- * Project:
- * --------
- * Maui_Software
- *
- * Description:
- * ------------
- * .......
- *
- * Author:
- * -------
- * -------
- *
- *------------------------------------------------------------------------------
- * $Log$
- *
- * removed!
- * removed!
- * Add compile option for touch screen.
- *
- * removed!
- * removed!
- * Disable center key
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- * Add compile option
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- * clear Delete Screen Handler after user selects OK
- *
- * removed!
- * removed!
- * Don't resume audio when the incoming call is in black list.
- *
- * removed!
- * removed!
- * allow English character (uppercase and lowercase)
- *
- * removed!
- * removed!
- * enable center key and set handler for it.
- *
- * 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!
- *
- *
- * 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!
- *
- *
- *******************************************************************************/
- /**
- * 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 : CallManagementIncoming.c
- PURPOSE : Call Management application
- REMARKS : To keep in mind that History must always be saved
- Skipping nodes it to be decided
- AUTHOR : Ashish
- DATE : Nov 8,02
- **************************************************************/
- #include "stdC.h"
- #include "MMI_Features.h"
- #include "L4Dr.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "DebugInitDef.h"
- #include "MMI_trc.h"
- #include "ProtocolEvents.h"
- #include "EventsGprot.h"
- #include "HistoryGprot.h"
- #include "SubLCDHistoryGprot.h"
- #include "GlobalDefs.h"
- #include "GlobalStruct.h"
- #include "GlobalScrEnum.h"
- #include "WrapperGprot.h"
- #include "KeyBrd.h"
- #include "TimerEvents.h"
- #include "wgui.h"
- #include "Wgui_categories_popup.h"
- #include "wgui_categories_CM.h"
- #include "wgui_categories_util.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_categories_multimedia.h"
- #include "CSP.h"
- #include "gdi_include.h" /* for GDI's color define */
- #include "ProfileGprots.h"
- #include "BootUp.h"
- #include "PowerOnChargerProt.h"
- #include "MessagesExDcl.h"
- #include "SmsPsHandler.h"
- #include "MessagesResourceData.h"
- #include "SMSApi.h"
- #include "AlarmFrameworkProt.h"
- #include "SATDefs.h"
- #include "SATGProts.h"
- #include "SimDetectionGexdcl.h"
- #include "gpioInc.h"
- #include "PhoneBookDef.h"
- #include "PhoneBookGprot.h"
- #include "CallSetUp.h"
- #include "mdi_datatype.h"
- #include "mdi_audio.h"
- #include "AudioInc.h"
- #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 "RedialHelperGProt.h"
- #include "CommonStubsProt.h"
- #include "PsCallHelperDef.h"
- #include "mmiapi_struct.h"
- #include "PsCallHelperGprot.h"
- #include "CallManagementGprot.h"
- #include "OutgoingCallHelperProt.h"
- #include "OutgoingCallManagementProt.h"
- #include "MessagesResourceData.h"
- #include "IncomingCallManagementProt.h"
- #include "PhonebookDef.h" /* For enum IMG_PHB_DEFAULT */
- #include "CommonScreens.h" /* for popup window timer. */
- #ifdef __MMI_BT_HP_SUPPORT__
- #include "BTMMIHPGprots.h"
- #endif
- #ifdef __MMI_BT_SUPPORT__
- #include "BTMMIScrGprots.h"
- #endif
- #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
- #include "ddl.h"
- #include "jcutils.h"
- #include "jcerror.h"
- #include "jdd_tapi.h"
- #endif
- /* static CM_CALL_HANDLE gCallToEnd;// This is the call Selected for ending */
- static CM_CALL_HANDLE gMyCallHandle;
- static S8 CallDeflectBuffer[MAX_NUMBER];
- static U8 gDTMFConfirmBuf[MAX_DTMFBUF_DIGITS];
- static U8 cashSign[8];
- static U8 AocBuffer[10];
- static pBOOL gAttempToReject = FALSE;
- static pBOOL gAttempToAnswer = FALSE;
- static pBOOL gAcceptIncoming = FALSE; /* tells if there is a incoming call waiting to be accepted */
- /* static pBOOL gHold2End=FALSE;// tells if there is a pending hold call 2 end */
- /* static U16 gIdleScreenDigitsAnyKeyAnswer[MAX_CM_SCREEN_DIGITS_ANYKEY] =
- {
- KEY_0,KEY_1,KEY_2,KEY_3,
- KEY_4,KEY_5,KEY_6,KEY_7,
- KEY_8,KEY_9,KEY_STAR,KEY_POUND,
- KEY_UP_ARROW,
- KEY_DOWN_ARROW,
- KEY_LEFT_ARROW,
- KEY_RIGHT_ARROW,
- KEY_CLEAR, KEY_ENTER, KEY_QUICK_ACS
- }; */
- S16 CallDeflectDigitKeyCode = -1;
- U16 gSSEvent = 0;
- MMI_BOOL gSSEventNotifyPresent = MMI_FALSE;
- U16 gSSEventNotify = 0;
- extern U8 isEarphonePlugged;
- extern U32 gSumACMValue;
- extern S8 gUSSDbuf[];
- extern S8 UnicodeDTMFPadCallBuffer[];
- extern const U16 CMIdleScreenDigits[];
- extern PU8 gdispnameForSubLCD;
- extern U8 isCSPPresent;
- #ifdef WAP_SUPPORT
- extern int wap_bearer_csd_is_disc(void);
- #endif
- #ifdef __MMI_CLAMSHELL__
- extern BOOL IsClamClose(void);
- #endif
- extern void show_call_cost_UI(PU8 symbol, PU8 value);
- /*****************************************************************************
- * FUNCTION
- * ReinitalizeIncomingCall
- * DESCRIPTION
- * To Re-Initialize the Incoming Call Management Application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ReinitalizeIncomingCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(PsCBackIncomingCallAccepted, PRT_INCOMINGCALL_ACCEPT_SUCCESS);
- SetProtocolEventHandler(PsCBackCallIncoming, PRT_INCOMINGCALL_EVENT);
- SetProtocolEventHandler(PsCBackCallWait, PRT_INCOMING_CALL_WAIT);
- SetProtocolEventHandler(PsCBackSpeechIndication, PRT_SPEECH_IND_EVENT);
- SetProtocolEventHandler(PsCBackAocIndication, PRT_AOC_EVENT_IND);
- SetProtocolEventHandler(PsCBackNotifySSInd, PRT_NOTIFY_SS_EVENT);
- SetProtocolEventHandler(PsCBackCcbsActivate, PRT_OUTGOING_DISCONNECT_IND);
- SetProtocolEventHandler(PsCBackCCBSInvoked, PRT_CCBS_NOTIFY_IND);
- SetProtocolEventHandler(PsCBackConfirmDTMFString, PRT_DTMF_CONFIRM_IND);
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- SetProtocolEventHandler(PsCBackUSSNInd, PRT_USSN_IND);
- SetProtocolEventHandler(PsCBackUSSRInd, PRT_USSR_IND);
- SetProtocolEventHandler(CALLSETClipRsp, PRT_MMI_SS_CLIP_INTERROGATE_IND);
- SetProtocolEventHandler(CALLSETClirRsp, PRT_MMI_SS_CLIR_INTERROGATE_IND);
- SetProtocolEventHandler(CALLSETColpRsp, PRT_MMI_SS_COLP_INTERROGATE_IND);
- SetProtocolEventHandler(CALLSETColrRsp, PRT_MMI_SS_COLR_INTERROGATE_IND);
- SetProtocolEventHandler(CALLSETCnapRsp, PRT_MMI_SS_CNAP_INTERROGATE_IND);
- SetProtocolEventHandler(CALLSETCcbsQueryRsp, PRT_MMI_SS_CCBS_RSP);
- SetProtocolEventHandler(CALLSETEmlppQueryRsp, PRT_MMI_SS_EMLPP_RSP);
- SetProtocolEventHandler(CALLSETWaitingRsp, PRT_MMI_SS_CALL_WAIT_RSP);
- SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- SetProtocolEventHandler(CALLSETBarringRsp, PRT_MMI_SS_CALL_BARRING_RSP);
- SetProtocolEventHandler(CALLSETBarringPassRsp, PRT_MMI_SS_CHANGE_PASSWORD_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * InitIncomingCall
- * DESCRIPTION
- * To Initialize the Incoming Call Management Application
- *
- * This function sets up the handlers required for event flow and
- * application management
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitIncomingCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReinitalizeIncomingCall();
- SetHiliteHandler(MITEM_INC_OPT_ANSWER, HiliteMenuIncomingAnswer);
- SetHiliteHandler(MITEM_INC_OPT_DEFLN, HiliteMenuIncomingCallDeflection);
- SetHiliteHandler(MITEM_CCBS_OPT_DIAL, HiliteMenuCCBSDial);
- SetHiliteHandler(MITEM_INC_ACT_OPT_END_ACT, HiliteM2019AllActiveEnd);
- SetHiliteHandler(MITEM_IAH_OPT_END_ACT, HiliteM2019AllActiveEnd);
- SetHiliteHandler(MITEM_IMA_OPT_END_ONE_ACT, HiliteM2011SingleActiveEnd);
- SetHiliteHandler(MITEM_IMAH_OPT_END_ONE_ACT, HiliteM2019AllActiveEnd);
- SetHiliteHandler(MITEM_IMA_OPT_END_ALL_ACT, HiliteMenuEndAllCalls);
- SetHiliteHandler(MITEM_INC_MHLD_OPT_END, HiliteMenuEndAllCalls);
- SetHiliteHandler(MITEM_IAH_OPT_END_ALL, HiliteMenuEndAllCalls);
- SetHiliteHandler(MITEM_INC_HLD_OPT_END, HiliteM2020AllHeldEnd);
- SetHiliteHandler(MITEM_IAH_OPT_END_HLD, HiliteM2020AllHeldEnd);
- SetHiliteHandler(MITEM_IAMH_ALL_HELD_END, HiliteM2020AllHeldEnd);
- SetHiliteHandler(MITEM_INC_ACT_OPT_HOLD_ACT, HiliteM2014Swap);
- SetHiliteHandler(MITEM_IMA_OPT_HOLD_CONF, HiliteM2014Swap);
- SetHiliteHandler(MITEM_INC_HLD_OPT_RTRV, HiliteM2014Swap);
- SetHiliteHandler(MITEM_INC_MHLD_OPT_RTRV, HiliteM2014Swap);
- SetHiliteHandler(MITEM_IAH_OPT_SWAP, HiliteM2014Swap);
- SetHiliteHandler(MITEM_IAH_OPT_CONFER, HiliteM2015Conference);
- SetHiliteHandler(MITEM_IAH_OPT_TRANSFER, HiliteM2017Transfer);
- SetHiliteHandler(MITEM_IMA_OPT_SPLIT, HiliteM2018Split);
- SetHiliteHandler(MITEM_INC_ACT_OPT_MUTE, HiliteM2020Mute);
- SetHiliteHandler(MITEM_INC_ACT_OPT_LOUDSP, HiliteM2023LoudSp);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteMenuIncomingAnswer
- * DESCRIPTION
- * Hilite function for Incoming Answer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteMenuIncomingAnswer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(KbCBackCallIncomingAccepted, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteMenuIncomingCallDeflection
- * DESCRIPTION
- * Hilite function for Call Deflection
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteMenuIncomingCallDeflection(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_HiliteMenuIncomingCallDeflection));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(HandleCallDelfectDigitEntry, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteMenuCCBSDial
- * DESCRIPTION
- * hilite handler to invoke the function that dials the ccbs call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteMenuCCBSDial(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_HiliteMenuCCBSDial));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(KbCBackCCBSDialCall, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteMenuEndAllCalls
- * DESCRIPTION
- * Hilite function End all call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteMenuEndAllCalls(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_HiliteMenuEndAllCalls));
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(KbCBackEndAllCallsExceptIncoming, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackCallIncoming
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * is an incoming call
- *
- * The toHistory is so that the Incoming Call Screen is saved
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackCallIncoming(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackCallIncoming));
- ProcessIncomingEvents(CM_PS_CALL_INCOMING, info);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackCallWait
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * is an incoming call
- *
- * The toHistory is so that the Incoming Call Screen is saved
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackCallWait(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackCallWait));
- ProcessIncomingEvents(CM_PS_CALL_WAIT, info);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackNetworkCallDropped
- * DESCRIPTION
- * This function is called back by the protocol stack when the
- * Netowrk drops incoming call
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackNetworkCallDropped(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackNetworkCallDropped));
- if (GetInternalAlert() == TRUE)
- {
- StopInternalOutgoingTone();
- }
- #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
- mmi_jdd_tapi_make_call_result(JC_ERR_TAPI_NETWORK_UNREACHABLE);
- #endif
- ProcessIncomingEvents(CM_PS_NWK_CALL_DROP, info);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackActivatedCCBS
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * CCBS activation response is received
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackActivatedCCBS(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (CheckChldRequestSuccess(info, &result))
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackActivatedCCBS1));
- ProcessIncomingEvents(CM_PS_ACTIVATED_CCBS, info);
- }
- else
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackActivatedCCBS2));
- ProcessIncomingFailureEvents(CM_PS_ACTIVATED_CCBS, result);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackCcbsActivate
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * is outgoing call disconnect indication(CCBS)
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackCcbsActivate(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackCcbsActivate));
- result = CheckRspCcbsFlag(info);
- if (result == TRUE)
- {
- ProcessIncomingEvents(CM_PS_CCBS_ACTIVATE, info);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackCCBSInvoked
- * DESCRIPTION
- * This function is called back by the protocol stack when CCBS
- * notification is there
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackCCBSInvoked(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackCCBSInvoked));
- SetCCBSFlag(TRUE);
- ProcessIncomingEvents(CM_PS_CCBS_INVOKE, info);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackNotifySSInd
- * DESCRIPTION
- * This function is intended for registering no on operation
- * for PS Callback
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackNotifySSInd(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackNotifySSInd));
- ProcessIncomingEvents(CM_PS_SS_EVENT, info);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackSpeechIndication
- * DESCRIPTION
- * This function is called back by the protocol stack when the
- * Held Call is made active.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackSpeechIndication(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackSpeechIndication));
- ProcessIncomingEvents(CM_PS_SPEECH_IND, info);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackAocIndication
- * DESCRIPTION
- * This function is called back by the protocol stack when the AOC
- * indication is sent by the PS
- *
- * Info passed to the function is the call handle
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackAocIndication(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackAocIndication));
- ProcessIncomingEvents(CM_PS_AOC_INDICATION, info);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackConfirmDTMFString
- * DESCRIPTION
- * This is CBack for -- Indication
- * PARAMETERS
- * info [?]
- * data(?) [IN] From PS
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackConfirmDTMFString(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_DTMF_CONFIRM_IND *msg = (MMI_DTMF_CONFIRM_IND*) info;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(gDTMFConfirmBuf, 0, MAX_DTMFBUF_DIGITS);
- strcpy((PS8) gDTMFConfirmBuf, (PS8) msg->digits);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackAocIndication));
- if (GetExitScrnID() == SCR_CM_ACTIVECALLSCREEN)
- SetGroupKeyHandler(
- NULL,
- (PU16) CMIdleScreenDigits,
- MAX_CM_SCREEN_DIGITS - 1,
- KEY_EVENT_DOWN);
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__) )
- SetCenterSoftkeyFunction(NULL, KEY_EVENT_UP);
- #endif
- ProcessIncomingEvents(CM_PS_CONFIRM_DTMF_STRING, NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * NotifyCMClampOpen
- * DESCRIPTION
- * Clamp Open Handler for CM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_CLAMSHELL__
- void NotifyCMClampOpen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetCurrentState() == CM_INCOMING_STATE)
- {
- if (TRUE == (((MMI_ANSWERING_MODE*) GetAnswerMode())->coverAnswer))
- {
- KbCBackCallIncomingAccepted();
- }
- #ifdef __MMI_INCOMING_CALL_VIDEO__
- else
- {
- CM_CALL_HANDLE handle;
- U16 imgId;
- handle = GetIncomingCallHandle();
- imgId = GetCallImgId(handle);
- /* overwrite sub LCD with static image */
- if ((imgId & 0x8000) || ((imgId & 0x3fff) >= VDO_ID_PHB_MTCALL_1))
- {
- /* user defined video file or system default video resource */
- /* draw static sub LCD */
- DisableCategory17VideoUpdate();
- ShowCategory332Screen(IMG_CM_STATE_CONNECTED);
- EnableCategory17VideoUpdate();
- }
- }
- #endif /* __MMI_INCOMING_CALL_VIDEO__ */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * NotifyCMClampClose
- * DESCRIPTION
- * Clamp Close Handler for CM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void NotifyCMClampClose(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isEarphonePlugged
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- || mmi_bt_is_incall_aud_swap2bt() == MMI_TRUE
- #endif
- )
- {
- return;
- }
- if (isInCall())
- {
- cm_p->history_info.IsClamCloseEndCall = MMI_TRUE;
- }
- DeInitCM();
- }
- #endif /* __MMI_CLAMSHELL__ */
- /*****************************************************************************
- * FUNCTION
- * HangupAllCalls
- * DESCRIPTION
- * Hangs Up All Calls
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HangupAllCalls(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_HangupAllCalls));
- #ifdef WAP_SUPPORT
- if (GetWapCallPresent() && wap_bearer_csd_is_disc())
- {
- return;
- }
- #endif /* WAP_SUPPORT */
- /* Start by Julia: Drop call refinement */
- if (GetDisconnectingCallHandle() != -1)
- {
- ReleaseCall();
- return;
- }
- SetNotifySSFlag(FALSE);
- /* End by Julia */
- if (GetCurrentState() == CM_OUTGOING_STATE && GetTotalCallCount() == 1)
- {
- handle = GetOutgoingCallHandle();
- SetDropRequestFlag(TRUE);
- if ((GetCallflag(handle, TRUE) & CM_HANGUP_REQUESTED) == 0)
- {
- OutgoingProcessCMEvent(CM_KB_HANGUPREQ, &handle);
- }
- }
- /* hangup single MT call should use reject instead of rel all */
- else if (GetCurrentState() == CM_INCOMING_STATE && GetTotalCallCount() == 1
- && gAttempToAnswer == FALSE)
- {
- KbCBackCallIncomingRejected();
- }
- else
- {
- U8 flag;
- /* swapping can't decide which call is active and held,
- issue rel all req instead */
- flag = GetAllCallFlags();
- if ((GetTotalActiveCallCount() > 0) && (GetTotalHoldCallCount() > 0) &&
- (((flag & CM_SWAP_REQUESTED) != 0) || ((flag & CM_CONF_REQUESTED) != 0) ||
- ((flag & CM_ECT_REQUESTED) != 0)))
- {
- SetAllCallsHangupFlag();
- ProcessIncomingEvents(CM_KB_HANG_ALL_CALLS, NULL);
- }
- #ifdef __MMI_CLAMSHELL__
- /* attemp to answer waiting call and press END key
- should rel all calls because we can't be sure of
- current call state and rel active or rel held */
- else if (GetCurrentState() == CM_INCOMING_STATE && GetTotalCallCount() > 1
- && IsClamClose() == FALSE && gAttempToAnswer == FALSE)
- {
- KbCBackCallIncomingRejected();
- }
- #endif /* __MMI_CLAMSHELL__ */
- else if (GetChldReqSent() == 0)
- {
- if ((GetTotalActiveCallCount() > 0) && (GetTotalHoldCallCount() > 0) &&
- (((flag & CM_SWAP_REQUESTED) == 0) || ((flag & CM_CONF_REQUESTED) == 0))
- #ifdef __MMI_CLAMSHELL__
- && IsClamClose() == FALSE
- #endif
- )
- {
- /* clam open */
- /* rel active and accept */
- ProcessIncomingEvents(CM_KB_END_ALL_ACTIVE_RETRIEVE_HELD, NULL);
- return;
- }
- }
- SetAllCallsHangupFlag();
- ProcessIncomingEvents(CM_KB_HANG_ALL_CALLS, NULL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * KbCBackCallIncomingAccepted
- * DESCRIPTION
- * This function is called back by the keyboard handler
- * when the user selects accepts incoming call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackCallIncomingAccepted(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_charbat_context.LowBatteryTxProhibitFlag == 1)
- {
- SET_LOW_BATTERY_ALARM_THRESHOLD(LBAT_TALK_DURCNT_PROHIBIT);
- }
- else
- {
- SET_LOW_BATTERY_ALARM_THRESHOLD(LBAT_TALK_DURCNT_NORMAL);
- }
- g_charbat_context.LowBatteryCutOffCallCnt = 0;
- if ((GetTotalActiveCallCount() > 0 && GetTotalHoldCallCount() > 0) ||
- CheckAllCallflag() == TRUE ||
- GetIncomingCallType() != CSMCC_VOICE_CALL)
- {
- ShowCallManagementErrorMessage(NO_ACTIVE_CALL);
- return;
- }
- /* preempt auto answer by manual answer before timeout */
- if (GetAutoAnswerFlag() == TRUE)
- {
- StopTimer(CM_AUTOANSWER_NOTIFYDURATION_TIMER);
- SetAutoAnswerFlag(FALSE);
- }
- if (GetWapCallPresent() || GetActiveCallType() == CM_DATA_CALL
- #ifdef __CTM_SUPPORT__
- || IsScreenPresent(SCR_CTM_TALKING)
- #endif
- )
- {
- KbCBackEndActiveAcceptIncomingCall();
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_UP);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_UP);
- return;
- }
- handle = GetIncomingCallHandle();
- if ((GetCallflag(handle, TRUE) & CM_HANGUP_REQUESTED))
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_KbCBackCallIncomingAccepted));
- return;
- }
- #ifdef __MMI_BT_HP_SUPPORT__
- if (mmi_bt_get_sco_state() != MMIBT_SCO_CON)
- {
- mmi_bt_set_answer_by_ag_flag(MMI_TRUE);
- }
- #endif /* __MMI_BT_HP_SUPPORT__ */
- UnSilencethePhone();
- StopIncomingCallIndication();
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_ACCEPT, NULL);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_UP);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * KbCBackCallIncomingRejected
- * DESCRIPTION
- * This function is called back by the keyboard handler
- * when the user selects rejects incoming call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackCallIncomingRejected(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gAttempToReject = TRUE;
- UnSilencethePhone();
- StopIncomingCallIndication();
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_REJECT, NULL);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_UP);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_UP);
- /* if (GetExitScrnID() == ITEMSCR_INCOMING_CALL)
- {
- #ifdef __MMI_INCOMING_CALL_VIDEO__
- CM_CALL_HANDLE handle;
- U16 imgId;
- handle = GetIncomingCallHandle();
- imgId = GetCallImgId(handle);
- // pause video
- if ((imgId & 0x8000) || ((imgId & 0x3fff) >= VDO_ID_PHB_MTCALL_1))
- StopCategory17Video();
- else
- #endif
- MOMTHideAnimation();
- } */
- }
- #ifdef __MMI_SIDEKEY_SUPPRESS_RING__
- /*****************************************************************************
- * FUNCTION
- * KbCBackCallIncomingRejectedNoTone
- * DESCRIPTION
- * Reject MT call and stop ring tone when long press
- * or double press side down key
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackCallIncomingRejectedNoTone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gAttempToReject = TRUE;
- UnSilencethePhone();
- //ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RSK, KEY_EVENT_UP); //jerson modify 20070622
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_REJECT, NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * KbCBackCallIncomingSuppressTone
- * DESCRIPTION
- * Set key handler for side down key in its first press
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackCallIncomingSuppressTone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //SetKeyHandler(KbCBackCallIncomingRejectedNoTone, KEY_VOL_DOWN, KEY_EVENT_UP);
- SetKeyHandler(KbCBackCallIncomingRejectedNoTone, KEY_RSK, KEY_EVENT_UP); //jerson modify 20070622
- }
- #endif /* __MMI_SIDEKEY_SUPPRESS_RING__ */
- /*****************************************************************************
- * FUNCTION
- * KbCBackEndActiveAcceptIncomingCall
- * DESCRIPTION
- * End active and accept waiting call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackEndActiveAcceptIncomingCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopIncomingCallIndication();
- ProcessIncomingEvents(CM_KB_END_ACTIVE_ACCEPT_INCOMING, NULL);
- }
- /**************************************************************
- FUNCTION NAME : KbCBackEndSelectiveActiveCall(void)
- PURPOSE : This function is called back by the keyboard handler
- when the user selects option to End an active call
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : nil
- **************************************************************/
- /* void KbCBackEndSelectiveActiveCall(void)
- {
- if (gCallToEnd!=-1)
- MakePsEndSelectiveCall ((void*)PsCBackselectedCallEnded, gCallToEnd);
- else
- PRINT_INFORMATION(("CM_TEST File: [%s] Line: [%d] <<No Call To End>>n",__FILE__,__LINE__));
- } */
- /*****************************************************************************
- * FUNCTION
- * KbCBackEndAllCallsExceptIncoming
- * DESCRIPTION
- * This function is called back by the keyboard handler
- * when the user selects rejects incoming call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackEndAllCallsExceptIncoming(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UnSilencethePhone();
- OutgoingProcessCMEvent(CM_KB_HANGUPALLREQ, (void*)NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * IgnoreCCBS
- * DESCRIPTION
- * To invoke the function that ignore the CCBS invoke
- *
- * yet to implement
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IgnoreCCBS(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_IgnoreCCBS));
- SetDialIndication(FALSE);
- SetActivatedCcbsFlag(FALSE);
- DropRequest();
- }
- /*****************************************************************************
- * FUNCTION
- * ActivateCCBS
- * DESCRIPTION
- * To invoke the function that activates the CCBS
- *
- * yet to implement
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ActivateCCBS(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ActivateCCBS));
- SetActivatedCcbsFlag(TRUE);
- MakePsActivateCCBS((void*)PsCBackActivatedCCBS);
- }
- /*****************************************************************************
- * FUNCTION
- * KbCBackCCBSDialCall
- * DESCRIPTION
- * This function is called back by the keyboard handler
- * when the user selects dial ccbs
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackCCBSDialCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UnSilencethePhone();
- StopIncomingCallIndication();
- CCBSUpdateCallInfo();
- ProcessIncomingEvents(CM_PS_CCBS_INVOKE_DIAL, NULL);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_UP);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * KbCBackCCBSInvokeRejected
- * DESCRIPTION
- * This function is called back by the keyboard handler
- * when the user selects rejects ccbs invoke
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void KbCBackCCBSInvokeRejected(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UnSilencethePhone();
- StopIncomingCallIndication();
- ProcessIncomingEvents(CM_PS_CCBS_INVOKE_REJECT, NULL);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_DOWN, KEY_EVENT_UP);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * IgnoreDTMFStringAndGoBackHistory
- * DESCRIPTION
- * cancels sending dtmf string
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IgnoreDTMFStringAndGoBackHistory(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("IgnoreDTMFStringAndGoBackHistoryn"));
- SetNoSave();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ConfirmDTMFString
- * DESCRIPTION
- * Send confirm dtmf notification to ps
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ConfirmDTMFString(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetNoSave();
- MakePsSendDTMFString(gDTMFConfirmBuf);
- StartTimer(CM_NOTIFYDURATION_TIMER, 1, GoBackfromNotifyScr);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeysForPOPUp
- * DESCRIPTION
- * Sets Group Handler for all Keys on Popup
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeysForPOPUp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetGroupKeyHandler((FuncPtr) POPUPHandler, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_DOWN);
- SetKeyHandler(HangupAllCalls, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * POPUPHandler
- * DESCRIPTION
- * Group Key Handler for all Keys on CM Popups
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void POPUPHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(CM_NOTIFYDURATION_TIMER);
- GoBackfromNotifyScr();
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessHeadsetKeyPress
- * DESCRIPTION
- * HeadSet Key Handling Depending on various conditions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern void mmi_frm_sms_abort_sms(void);
- extern U16 GetCurrScreenID(void);
- void ProcessHeadsetKeyPress(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((GetCurrScreenID() == SCR_ID_MSG_SENDING) && isInCall())
- {
- mmi_frm_sms_abort_sms();
- }
- else if (GetCurrentState() == CM_INCOMING_STATE)
- {
- if (GetTotalActiveCallCount() >= 1 && GetTotalHoldCallCount() >= 1)
- {
- SwapCall();
- }
- else if (GetTotalCallCount() > 1)
- {
- /* more than 1 call, auto answer can't work */
- if ((gAttempToReject == FALSE) && (gAttempToAnswer == FALSE))
- {
- KbCBackCallIncomingAccepted();
- }
- }
- else
- {
- if ((gAttempToReject == FALSE) && (gAttempToAnswer == FALSE) && (GetAutoAnswerFlag() == 0))
- {
- KbCBackCallIncomingAccepted();
- }
- }
- }
- else if (GetCurrentState() == CM_OUTGOING_STATE)
- {
- if (1 == GetTotalCallCount())
- {
- DropRequest();
- }
- else
- {
- HangupAll();
- }
- }
- else if ((GetCurrentState() == CM_ACTIVE_STATE) || (GetCurrentState() == CM_HOLD_STATE))
- {
- HangupAll();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessIncomingEvents
- * DESCRIPTION
- * This function is the entry into the Call Management State
- * Machine.
- *
- * This function controls the Incoming Call management applicaion
- * as per keyboard event and protocol event
- * PARAMETERS
- * event [IN]
- * info [?]
- * Incoming(?) [IN] Event Type, Any information associated with the event
- * RETURNS
- * void
- *****************************************************************************/
- void ProcessIncomingEvents(CM_EVENT_TYPES event, void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- ACTION_RESULT result;
- /* Start by Julia: Drop call refinement */
- CM_CALL_HANDLE handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* End by Julia */
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessIncomingEvents));
- switch (event)
- {
- /******************* indications *********************/
- case CM_PS_CALL_INCOMING:
- /* incoming call */
- #ifdef __MMI_VOIP__
- if (mmi_voip_get_outgoing_call_id() != -1)
- {
- mmi_voip_entry_abort_call();
- }
- if (mmi_voip_get_incoming_call_id() != -1)
- {
- /* do not clear key handler in case voip registered key handler is useless */
- SetClearKeyFlag(FALSE);
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_REJECT, info);
- }
- else if (mmi_voip_app_total_call() != 0)
- {
- ProcessIncomingEvents(CM_PS_CALL_WAIT, info);
- }
- else
- #endif
- {
- result = ProcessIncomingCallEvent(info);
- }
- if (result != CM_CALL_SUCCESS)
- {
- if (result == CM_NO_INCOMING)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** Cannot Accept anymore incoming calls>>n", __FILE__, __LINE__));
- }
- else
- {
- PRINT_INFORMATION(("CM_TEST File: [%s] Line: [%d] <<Error Processing Incoming Call Event>>n",
- __FILE__, __LINE__));
- }
- }
- break;
- case CM_PS_CALL_WAIT:
- /* waiting call */
- // Start by Julia: Drop call refinement
- // automatically release all disconnecting call before incoming call comes in
- SetAutoReleaseFlag(TRUE);
- ReleaseCall();
- /* End by Julia */
- result = ProcessCallWait(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** Error processing waiting call>>n", __FILE__,
- __LINE__));
- }
- break;
- case CM_PS_CCBS_ACTIVATE:
- /* CCBS available ind */
- EntryScrCcbsActivate();
- break;
- case CM_PS_CCBS_INVOKE:
- /* CCBS invoke */
- result = ProcessInvokedCcbs(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("CM_TEST File: [%s] Line: [%d] <<Error Processing CCBS Invoke Event>>n", __FILE__,
- __LINE__));
- }
- break;
- case CM_PS_INCOMING_CALL_DROPPED:
- /* MT drop */
- SetIncomingCallDroppedFlag(TRUE);
- result = ProcessIncomingCallRejected(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** Could Not drop incoming call>>n",
- __FILE__, __LINE__));
- }
- break;
- case CM_PS_NWK_CALL_DROP:
- /* call drop */
- result = ProcessEndCallIdAndGoBack(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("CM_TEST File: [%s] Line: [%d] <<Error Processing Network Drop Event>>n", __FILE__,
- __LINE__));
- }
- break;
- case CM_PS_SS_EVENT:
- ProcessShowSSEventNotification(info);
- break;
- case CM_PS_SPEECH_IND:
- ReverseSpeechIndication(info);
- break;
- case CM_PS_AOC_INDICATION:
- result = ProcessAocIndication(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** Error In processing AOC >>n",
- __FILE__, __LINE__));
- }
- break;
- case CM_PS_CONFIRM_DTMF_STRING:
- /* DTMF confirm ind */
- StartTimer(CM_AUTO_DTMF_CONFIRM_TIMER, CM_NOTIFY_TIMEOUT, EntryScrConfirmDTMFString);
- break;
- /****************** request/responses ***********************/
- case CM_KB_INCOMING_CALL_ACCEPT:
- /* SEND key in MT call */
- ProcessStateCheckIncomingCall();
- break;
- case CM_PS_INCOMING_CALL_CONNECTED:
- /* SEND key rsp */
- result = ProcessAcceptIncomingCall(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** COuld Not accept incoming call>>n",
- __FILE__, __LINE__));
- }
- break;
- case CM_PS_ACTIVE_CALL_HELD:
- result = ProcessCallsHeld(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** Could Not hold active call>>n",
- __FILE__, __LINE__));
- }
- break;
- case CM_KB_INCOMING_CALL_REJECT:
- handle = GetIncomingCallHandle();
- /* END key in MT call */
- if (GetTotalCallCount() > 1)
- {
- /* Start by Julia: Drop call refinement */
- SetCallState(handle, CM_DISCONNECTING_STATE, TRUE);
- // End by Julia
- MakePsSendUDUB((void*)PsCBackIncomingCallRejected); /* special case for ending waitng call */
- }
- else
- {
- /* Start by Julia: Drop call refinement */
- SetCallState(handle, CM_DISCONNECTING_STATE, TRUE);
- // End by Julia
- MakePsAthRequest((void*)PsCBackIncomingCallRejected);
- }
- break;
- case CM_PS_INCOMING_CALL_REJECTED:
- /* 0 send / END key rsp */
- result = ProcessIncomingCallRejected(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** Could Not drop incoming call>>n",
- __FILE__, __LINE__));
- }
- break;
- case CM_KB_END_ACTIVE_ACCEPT_INCOMING:
- /* 1 send */
- /* Start by Julia: Drop call refinement */
- SetAllActiveCallState(CM_DISCONNECTING_STATE);
- //EntryScr1002ActiveCall();
- // End by Julia
- gAttempToAnswer = TRUE;
- MakePsHangupallActiveAcceptOtherRequest((void*)PsCBackselectedCallEnded);
- SetProtocolEventHandler(PsCBackCheckChldIncomingCallAccepted, PRT_END_CHLD_RSP);
- break;
- case CM_PS_ACTIVE_CALL_DISCONNECTED:
- /* 1 send / Menu End Single release ind */
- OutgoingProcessCMEvent(CM_PS_HANGUPSUC, info);
- break;
- case CM_KB_END_ALL_ACTIVE_RETRIEVE_HELD:
- /* 1 send */
- /* Start by Julia: Drop call refinement */
- SetAllActiveCallState(CM_DISCONNECTING_STATE);
- //EntryScr1002ActiveCall();
- // End by Julia
- MakePsHangupallActiveAcceptOtherRequest((void*)PsCBackActiveCallEndedHeldRetrieved);
- break;
- case CM_PS_ALL_ACTIVE_CALL_DISCONNECTED:
- /* 1 send release ind */
- result = ProcessEndAllActiveCall(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** Could Not end all active calls>>n",
- __FILE__, __LINE__));
- }
- break;
- case CM_PS_HELD_CALL_ACTIVE:
- /* 1 send rsp */
- result = ProcessHold2Active(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** State Machine ** Could Not make hold call active>>n",
- __FILE__, __LINE__));
- }
- break;
- case CM_PS_CCBS_INVOKE_DIAL:
- /* SEND key in CCBS invoke, change to KB */
- result = ProcessCCBSDialRequest(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** Error processing Dial CCBS>>n", __FILE__, __LINE__));
- }
- break;
- case CM_PS_ACTIVATED_CCBS:
- /* 5 send rsp */
- EntryScrNotifyCCBSSuccess();
- break;
- case CM_PS_CCBS_INVOKE_REJECT:
- /* END key in CCBS invoke */
- result = ProcessCCBSRejectRequest(info);
- if (result != CM_CALL_SUCCESS)
- {
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<** Error processing Dial CCBS>>n", __FILE__, __LINE__));
- }
- break;
- case CM_KB_HANG_ALL_CALLS:
- /* END key in MMI, move to outgoingcallmanagement */
- /* Start by Julia: Drop call refinement */
- /*
- * #ifdef __MMI_CLAMSHELL__
- * if (IsClamClose() == FALSE)
- * #endif
- */
- SetAllCallState(CM_DISCONNECTING_STATE);
- //EntryScr1002ActiveCall();
- // End by Julia
- if (-1 != GetIncomingCallHandle())
- {
- StopIncomingCallIndication();
- }
- MakePsHangupallCallsRequest((void*)HangupallReqSucess);
- break;
- default:
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<Not Valid State Machine event>>n", __FILE__, __LINE__));
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessIncomingCallEvent
- * DESCRIPTION
- * This function is called by the state machine function
- * hold Process an incoming call
- * PARAMETERS
- * info [?]
- * any(?) [IN] Information associated with incoming call
- * result(?) [OUT] Of execution of function which may be success or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessIncomingCallEvent(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- IncomingCall myIncmg;
- U8 TempNumber[MAX_NUMBER];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessIncomingCallEvent));
- gAttempToAnswer = FALSE;
- DeriveCallInfo(info, &myIncmg);
- SetAnswerMode(NULL);
- SetCallWaitFlag(FALSE);
- AnsiiToUnicodeString((PS8) TempNumber, (PS8) myIncmg.Number);
- pfnUnicodeStrcpy((PS8) myIncmg.Number, (PS8) TempNumber);
- AlmDisableExpiryHandler();
- switch (GetCurrentState())
- {
- case CM_IDLE_STATE:
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessIncomingCallEvent1));
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_INCOMING_STATE);
- #if defined(__MMI_BT_PROFILE__) && defined(__BT_INBAND_RING__ )
- mmi_profiles_bt_call_start_callback();
- #endif
- AddNewCallInfo(
- myIncmg.Number,
- GetCurrentState(),
- GetPreviousState(),
- CM_CALL_MT,
- (CM_CALL_HANDLE) myIncmg.callHandle,
- myIncmg.callType);
- /* Start by Julia */
- #ifdef __MMI_CM_BLACK_LIST__
- if (BlockedHandle((CM_CALL_HANDLE) myIncmg.callHandle) == TRUE)
- {
- SetBlackIncomingFlag(TRUE);
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_REJECT, info);
- return CM_CALL_SUCCESS;
- }
- #endif /* __MMI_CM_BLACK_LIST__ */
- /* End by Julia */
- if (GetPriorityCall() == TRUE)
- {
- return CM_CALL_SUCCESS;
- }
- SetAnswerMode(GetAnsweringMode());
- if (((MMI_ANSWERING_MODE*) GetAnswerMode())->automatic == TRUE)
- {
- SetAutoAnswerFlag(TRUE);
- StartTimer(
- CM_AUTOANSWER_NOTIFYDURATION_TIMER,
- CM_AUTOANSWER_NOTIFY_TIMEOUT,
- KbCBackCallIncomingAccepted);
- }
- #ifdef __J2ME__
- {
- extern void jvm_enter_incoming_call_notify(void);
- jvm_enter_incoming_call_notify();
- }
- #endif /* __J2ME__ */
- EntryScrIncomingCallEvent();
- if (!GetRingingFlag())
- {
- ShowIncomingCallIndication();
- }
- AddMarkerToHistory();
- return CM_CALL_SUCCESS;
- case CM_OUTGOING_STATE:
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessIncomingCallEvent2));
- if (cm_p->redial_info.RedialTimer == TRUE)
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_INCOMING_STATE);
- AddNewCallInfo(
- myIncmg.Number,
- GetCurrentState(),
- GetPreviousState(),
- CM_CALL_MT,
- (CM_CALL_HANDLE) myIncmg.callHandle,
- myIncmg.callType);
- /* Start by Julia */
- #ifdef __MMI_CM_BLACK_LIST__
- if (BlockedHandle((CM_CALL_HANDLE) myIncmg.callHandle) == TRUE)
- {
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_REJECT, info);
- return CM_CALL_SUCCESS;
- }
- #endif /* __MMI_CM_BLACK_LIST__ */
- /* End by Julia */
- if (GetPriorityCall() == TRUE)
- {
- return CM_CALL_SUCCESS;
- }
- ResetRedialAttempts();
- EntryScrIncomingCallEvent();
- ShowIncomingCallIndication();
- if (!IsScreenPresent(CM_SCR_MARKER))
- {
- AddMarkerToHistory();
- }
- return CM_CALL_SUCCESS;
- }
- /* amanda add 0326, MO MT collision */
- else
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_INCOMING_STATE);
- AddNewCallInfo(
- myIncmg.Number,
- GetCurrentState(),
- GetPreviousState(),
- CM_CALL_MT,
- (CM_CALL_HANDLE) myIncmg.callHandle,
- myIncmg.callType);
- /* Start by Julia */
- #ifdef __MMI_CM_BLACK_LIST__
- if (BlockedHandle((CM_CALL_HANDLE) myIncmg.callHandle) == TRUE)
- {
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_REJECT, info);
- return CM_CALL_SUCCESS;
- }
- #endif /* __MMI_CM_BLACK_LIST__ */
- /* End by Julia */
- if (GetPriorityCall() == TRUE)
- {
- return CM_CALL_SUCCESS;
- }
- EntryScrIncomingCallEvent();
- ShowIncomingCallIndication();
- DeleteUptoScrID(CM_SCR_MARKER);
- if (!IsScreenPresent(CM_SCR_MARKER))
- {
- AddMarkerToHistory();
- }
- return CM_CALL_SUCCESS;
- }
- }
- return CM_CALL_FAILURE;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessCallWait
- * DESCRIPTION
- * This function is called by the state machine function
- * hold Process an incoming call
- * PARAMETERS
- * info [?]
- * any(?) [IN] Information associated with incoming call
- * result(?) [OUT] Of execution of function which may be success or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessCallWait(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- IncomingCall myIncmg;
- U8 TempNumber[MAX_NUMBER];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessCallWait));
- gAttempToAnswer = FALSE;
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_INCOMING_STATE);
- SetCallWaitFlag(TRUE);
- DeriveCallInfoFromWait(info, &myIncmg);
- AnsiiToUnicodeString((PS8) TempNumber, (PS8) myIncmg.Number);
- pfnUnicodeStrcpy((PS8) myIncmg.Number, (PS8) TempNumber);
- AddNewCallInfo(
- myIncmg.Number,
- GetCurrentState(),
- GetPreviousState(),
- CM_CALL_MT,
- (CM_CALL_HANDLE) myIncmg.callHandle,
- myIncmg.callType);
- /* Start by Julia */
- #ifdef __MMI_CM_BLACK_LIST__
- if (BlockedHandle((CM_CALL_HANDLE) myIncmg.callHandle) == TRUE)
- {
- ProcessIncomingEvents(CM_KB_INCOMING_CALL_REJECT, info);
- return CM_CALL_SUCCESS;
- }
- #endif /* __MMI_CM_BLACK_LIST__ */
- /* End by Julia */
- #ifdef __J2ME__
- {
- extern void jvm_enter_incoming_call_notify(void);
- jvm_enter_incoming_call_notify();
- }
- #endif /* __J2ME__ */
- EntryScrIncomingCallEvent();
- StartRingTone(TONE_CALL_WAITING);
- if (!IsScreenPresent(CM_SCR_MARKER))
- {
- AddMarkerToHistory();
- }
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessInvokedCcbs
- * DESCRIPTION
- * This function is called when CCBS
- * invoked notification is there
- * PARAMETERS
- * info [?]
- * result(?) [OUT] Of execution of function which may be success or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessInvokedCcbs(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- IncomingCall myIncmg;
- U8 TempNumber[MAX_NUMBER];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessInvokedCcbs));
- DeriveCcbsCallInfo(info, &myIncmg);
- AnsiiToUnicodeString((PS8) TempNumber, (PS8) myIncmg.Number);
- pfnUnicodeStrcpy((PS8) myIncmg.Number, (PS8) TempNumber);
- if (GetCurrentState() != CM_INCOMING_STATE)
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessInvokedCcbs));
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_INCOMING_STATE);
- AddNewCallInfo(
- myIncmg.Number,
- GetCurrentState(),
- GetPreviousState(),
- CM_CALL_MT,
- (CM_CALL_HANDLE) myIncmg.callHandle,
- CSMCC_VOICE_CALL);
- EntryScrCCBSInvokeEvent();
- if (!IsScreenPresent(CM_SCR_MARKER))
- {
- AddMarkerToHistory();
- }
- return CM_CALL_SUCCESS;
- }
- return CM_CALL_FAILURE;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessIncomingCallRejected
- * DESCRIPTION
- * This function is called by the state machine function reject
- * incoming call
- * PARAMETERS
- * info [?]
- * any(?) [IN] Information associated with incoming call
- * Success(?) [OUT] Or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessIncomingCallRejected(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 flag = 0; /* Set if previous state is outgoing */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessIncomingCallRejected));
- if ((GetTotalCallCount() > 1) && (GetIncomingCallHandle() != ((MMI_RELEASE_IND*) info)->call_id))
- {
- /* use chld to reject */
- /* dropped is not MT call, use default drop call handler */
- PsCBackNetworkCallDropped(info);
- #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;
- }
- else if ((GetTotalCallCount() == 1 && GetCurrentState() != CM_INCOMING_STATE) || (GetIncomingCallHandle() == -1))
- {
- /* use ath to reject or call already dropped when ath rsp comes */
- CM_CALL_HANDLE handle;
- PRINT_INFORMATION(("ProcessIncomingCallRejected: not incoming state"));
- handle = GetHungUpHandle();
- if (handle != -1)
- {
- OutgoingProcessCMEvent(CM_PS_HANGUPSUC, (void*)&handle);
- }
- #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;
- }
- gAttempToReject = FALSE;
- ResetCallflag(GetIncomingCallHandle(), CM_HANGUP_REQUESTED, TRUE);
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- switch (GetPreviousState())
- {
- case CM_IDLE_STATE:
- SetPreviousState(CM_INCOMING_STATE);
- SetCurrentState(CM_IDLE_STATE);
- break;
- case CM_HOLD_STATE:
- if (GetTotalHoldCallCount() > 0)
- {
- SetCurrentState(CM_HOLD_STATE);
- SetPreviousState(CM_INCOMING_STATE);
- }
- else
- {
- SetCurrentState(CM_IDLE_STATE);
- SetPreviousState(CM_IDLE_STATE);
- }
- break;
- case CM_ACTIVE_STATE:
- if (GetTotalActiveCallCount() > 0)
- {
- SetCurrentState(CM_ACTIVE_STATE);
- SetPreviousState(CM_INCOMING_STATE);
- }
- else
- {
- SetCurrentState(CM_IDLE_STATE);
- SetPreviousState(CM_IDLE_STATE);
- }
- break;
- case CM_INCOMING_STATE:
- if (GetCurrentState() == CM_OUTGOING_STATE)
- {
- }
- else if (GetCurrentState() == CM_INCOMING_STATE)
- {
- }
- else if (GetTotalActiveCallCount() > 0)
- {
- SetCurrentState(CM_ACTIVE_STATE);
- }
- else if (GetTotalHoldCallCount() > 0)
- {
- SetCurrentState(CM_HOLD_STATE);
- }
- else
- {
- SetCurrentState(CM_IDLE_STATE);
- }
- break;
- case CM_OUTGOING_STATE:
- flag = 1;
- break;
- default:
- PRINT_INFORMATION(("Previous State is Unknown this should not happenn"));
- #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;
- }
- if (GetIncomingCallDroppedFlag())
- {
- SetIncomingCallDroppedFlag(FALSE);
- StopIncomingCallIndication();
- }
- /* if(GetMissedCallFlag()==FALSE) */
- DeleteScreenIfPresent(ITEMSCR_INCOMING_CALL);
- DeleteIncomingCallOptionScreen();
- if (GetCCBSFlag() == TRUE)
- {
- /* don't log CCBS call */
- PurgeIncomingCallStructure();
- GoBackfromNotifyScr();
- SetCCBSFlag(FALSE);
- }
- else
- {
- LogCallInfoForCallHistory(GetIncomingCallHandle());
- PurgeIncomingCallStructure();
- }
- if (1 == flag)
- {
- UpdateStateMachine();
- }
- #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
- * ProcessEndCallIdAndGoBack
- * DESCRIPTION
- * This function is called by the state machine function in
- * to make call to protocol stack to get call list to sync with MMI
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessEndCallIdAndGoBack(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE handle;
- CALL_STATE state;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessEndCallIdAndGoBack));
- handle = DeriveCallHandle(info);
- state = GetCurrentState();
- if (GetMMIStructIndexof(handle) == -1)
- {
- PRINT_INFORMATION(("ncall already dropped in ProcessEndCallIdAndGoBackn"));
- return CM_CALL_SUCCESS;
- }
- SetCallEndCause((U16) ((MMI_RELEASE_IND*) info)->cause);
- if (GetCallDirFlag(handle) == CM_CALL_MO_STK)
- {
- if (state == CM_OUTGOING_STATE)
- {
- SATCallExitCause(SAT_CALL_DISCONNECT_BEFORE_CONNECT);
- }
- else if (state == CM_ACTIVE_STATE || state == CM_HOLD_STATE)
- {
- SATCallExitCause(SAT_CALL_DISCONNECT_AFTER_CONNECT);
- }
- }
- state = GetCallState(handle);
- /* when there's pending req on the dropped call, sync all call state with PS */
- if (GetCallflag(handle, TRUE) & (~CM_HANGUP_REQUESTED) != 0)
- {
- SyncCallList();
- }
- switch (state)
- {
- case CM_INCOMING_STATE:
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessEndCallIdAndGoBack1));
- SetCallEndCause(0);
- ProcessIncomingEvents(CM_PS_INCOMING_CALL_DROPPED, info);
- return CM_CALL_SUCCESS;
- case CM_OUTGOING_STATE:
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessEndCallIdAndGoBack2));
- LogCallInfoForCallHistory(GetOutgoingCallHandle());
- GetEndTimeAndLogUnconnectedMOCall();
- if (IsRedialSet())
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessEndCallIdAndGoBack3));
- SetRedialNumber();
- OutgoingProcessCMFailureEvent(CM_PS_CALLCONNECTED, GetCallEndCause());
- /* SetCallEndCause(0); */
- SetCallEndedBeforeConnFlag(FALSE);
- return CM_CALL_SUCCESS;
- }
- SetCallState(handle, CM_IDLE_STATE, TRUE);
- UpdateStateMachine();
- if (GetCurrentState() == CM_OUTGOING_STATE)
- {
- SetCurrentState(GetPreviousState());
- SetPreviousState(CM_OUTGOING_STATE);
- }
- EntryScr1004NotifyEndCallDuration();
- return CM_CALL_SUCCESS;
- case CM_HOLD_STATE:
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessEndCallIdAndGoBack4));
- if (GetCurrentState() == CM_OUTGOING_STATE)
- {
- LogCallInfoForCallHistory(handle);
- GetEndTimeAndNotifyEndCallDuration(handle);
- SetCallState(handle, CM_IDLE_STATE, TRUE);
- if (GetTotalHoldCallCount() == GetTotalCallCount())
- {
- SetPreviousState(CM_OUTGOING_STATE);
- SetCurrentState(CM_HOLD_STATE);
- }
- return CM_CALL_SUCCESS;
- }
- SetCallflag(handle, CM_HANGUP_REQUESTED, TRUE);
- OutgoingProcessCMEvent(CM_PS_HANGUPSUC, (void*)&handle);
- return CM_CALL_SUCCESS;
- case CM_ACTIVE_STATE:
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessEndCallIdAndGoBack5));
- SetCallflag(handle, CM_HANGUP_REQUESTED, TRUE);
- OutgoingProcessCMEvent(CM_PS_HANGUPSUC, (void*)&handle);
- return CM_CALL_SUCCESS;
- default:
- PRINT_INFORMATION(("<<** State Machine ** Not valid call state for handle>>n"));
- return CM_CALL_FAILURE;
- }
- return CM_CALL_FAILURE;
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessShowSSEventNotification
- * DESCRIPTION
- * This function derives SS information from PS and calls necessary
- * entry function to show string
- * PARAMETERS
- * info [?]
- * data(?) [IN] From PS
- * RETURNS
- * void
- *****************************************************************************/
- void ProcessShowSSEventNotification(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeriveSSEvent(info);
- EntryScrShowSSEvent();
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessAocIndication
- * DESCRIPTION
- * This function is called by the state machine function in
- * to make call to protocol stack to get call list to sync with MMI
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessAocIndication(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 acmIndValue;
- U8 temp[8];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessAocIndication));
- SetShowAOC(TRUE);
- memset(cashSign, 0, sizeof(cashSign));
- cashSign[0] = '$';
- acmIndValue = DeriveCcmValue(info);
- gSumACMValue += acmIndValue;
- memset((S8*) temp, 0, sizeof(temp));
- sprintf((S8*) temp, "%d", (U32) gSumACMValue);
- AnsiiToUnicodeString((S8*) AocBuffer, (S8*) temp);
- switch (GetCurrentState())
- {
- case CM_OUTGOING_STATE:
- case CM_HOLD_STATE:
- case CM_ACTIVE_STATE:
- show_call_cost_UI(cashSign, (PU8) AocBuffer);
- return CM_CALL_SUCCESS;
- default:
- PRINT_INFORMATION(("<<** Cannot Process AOC indication in this state>>n"));
- return CM_CALL_FAILURE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ReverseSpeechIndication
- * DESCRIPTION
- * This function is called reverse the speech
- * PARAMETERS
- * info [?]
- * Info(?) [IN] From the PS
- * RETURNS
- * void
- *****************************************************************************/
- void ReverseSpeechIndication(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- pBOOL status;
- U8 type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- status = CheckStatusOfSpeech(info, &type);
- if (GetCurrentState() == CM_OUTGOING_STATE && status == TRUE)
- {
- SetSpeechFlag(TRUE);
- if (GetExitScrnID() == SCR1001_CM_OUTGOINGCALLSCREEN)
- {
- SetGroupKeyHandler(
- EnterScreenAndHandleDigit,
- (PU16) CMIdleScreenDigits,
- MAX_CM_SCREEN_DIGITS - 1,
- KEY_EVENT_DOWN);
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__) && !(defined __MMI_TOUCH_IDLESCREEN_SHORTCUTS__)) /* PMT MANISH 20050623 */
- EnableCenterSoftkey(0, IMG_CSK_DIAL_ICON);
- SetCenterSoftkeyFunction(EnterScreenAndHandleDigit, KEY_EVENT_UP);
- redraw_center_softkey();
- #endif
- }
- }
- #ifdef __CTM_SUPPORT__
- /* close ctm before turn off speech */
- if (status == FALSE && ctm_p->state >= MMI_CTM_STATE_OPENED)
- {
- mmi_ctm_send_close_req();
- mmi_ctm_set_state(MMI_CTM_STATE_CLOSING);
- }
- #endif /* __CTM_SUPPORT__ */
- MakePsReverseSpeechStatus(status, type);
- #ifdef __CTM_SUPPORT__
- /* open ctm after turn on speech */
- if (status == TRUE && ctm_p->status == TRUE &&
- (ctm_p->state == MMI_CTM_STATE_IDLE ||
- ctm_p->state == MMI_CTM_STATE_CLOSING))
- {
- S8 mode = 0xff;
- if (ctm_p->tty_status == TRUE)
- {
- /* with TTY, open as TTY */
- switch (ctm_p->mode_setting)
- {
- case MMI_CTM_SETTING_HCO:
- mode = CTM_HCO_MODE;
- break;
- case MMI_CTM_SETTING_VCO:
- mode = CTM_VCO_MODE;
- break;
- case MMI_CTM_SETTING_BAUDOT:
- mode = CTM_BAUDOT_MODE;
- break;
- default:
- /* CTM ON, earphone in, direct mode => no CTM function, take it as earphone */
- mode = CTM_DIRECT_MODE;
- break;
- }
- }
- else
- {
- switch (ctm_p->mode_setting)
- {
- case MMI_CTM_SETTING_AUTO_DIRECT:
- case MMI_CTM_SETTING_MANUAL_DIRECT:
- /* no TTY, open as direct */
- mode = CTM_DIRECT_MODE;
- break;
- default:
- break;
- }
- }
- if (mode != 0xff)
- {
- mmi_ctm_send_open_req(mode);
- mmi_ctm_set_state(MMI_CTM_STATE_OPENING);
- }
- }
- #endif /* __CTM_SUPPORT__ */
- }
- /*****************************************************************************
- * FUNCTION
- * IsAttemptToAnswer
- * DESCRIPTION
- *
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL IsAttemptToAnswer(void)
- {
- return gAttempToAnswer;
- }
- #ifdef __MMI_VOIP__
- /**************************************************************
- * FUNCTION
- * mmi_voip_entry_ans_to_disconn_gsm
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- **************************************************************/
- void mmi_voip_entry_ans_to_disconn_gsm(void)
- {
- HangupAllCalls();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_ans_to_conn_gsm
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_ans_to_conn_gsm(void)
- {
- if (GetTotalActiveCallCount() > 0)
- {
- gAcceptIncoming = TRUE;
- SetHoldFlag();
- MakePsActiveHold((void*)PsCBackActiveCallsHeld);
- }
- else
- {
- MakePsCallAcceptIncoming((void*)PsCBackIncomingCallAccepted);
- }
- }
- #endif /* __MMI_VOIP__ */
- /*****************************************************************************
- * FUNCTION
- * ProcessStateCheckIncomingCall
- * DESCRIPTION
- * This function is called by the state machine function to
- * decide what to do before accepting an incoming call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ProcessStateCheckIncomingCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessStateCheckIncomingCall));
- gAttempToAnswer = TRUE;
- #ifdef __MMI_VOIP__
- /* release all voip calls before answering gsm call */
- if (mmi_voip_app_total_call())
- {
- mmi_voip_app_set_conn_flag(MMI_VOIP_CALL_CONN_GSM);
- mmi_voip_entry_ans_to_disconn_voip();
- }
- else
- #endif /* __MMI_VOIP__ */
- {
- if (GetTotalActiveCallCount() > 0)
- {
- gAcceptIncoming = TRUE;
- SetHoldFlag();
- MakePsActiveHold((void*)PsCBackActiveCallsHeld);
- }
- else
- {
- MakePsCallAcceptIncoming((void*)PsCBackIncomingCallAccepted);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackIncomingCallAccepted
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * Incoming Call is accepted
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackIncomingCallAccepted(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gAttempToAnswer = FALSE;
- if (CheckAtaSuccess(info, &result))
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackIncomingCallAccepted1));
- ProcessIncomingEvents(CM_PS_INCOMING_CALL_CONNECTED, info);
- }
- else if (GetIncomingCallHandle() != -1)
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackIncomingCallAccepted2));
- /* accept fail doesn't imply call is disconnected */
- ProcessIncomingFailureEvents(CM_PS_INCOMING_CALL_CONNECTED, result);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackCheckChldIncomingCallAccepted
- * DESCRIPTION
- * This function is required to check the chld response and call
- * necessary function
- *
- * This call back is registered in case it is required to
- * accept incoming call via a chld request.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackCheckChldIncomingCallAccepted(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 cause;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetChldReqSent(CM_ACTION_NONE);
- if (CheckChldRequestSuccess(info, &cause))
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackCheckChldIncomingCallAccepted1));
- ProcessIncomingEvents(CM_PS_INCOMING_CALL_CONNECTED, info);
- }
- else
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackCheckChldIncomingCallAccepted2));
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- ProcessIncomingFailureEvents(CM_PS_INCOMING_CALL_CONNECTED, cause);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackActiveCallsHeld
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * Active call is held
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackActiveCallsHeld(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackActiveCallsHeld));
- if (CheckChldRequestSuccess(info, &result))
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackActiveCallsHeld1));
- ProcessIncomingEvents(CM_PS_ACTIVE_CALL_HELD, info);
- }
- else
- {
- ResetHoldFlag();
- gAttempToAnswer = FALSE;
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_PsCBackActiveCallsHeld2, result));
- ProcessIncomingFailureEvents(CM_PS_ACTIVE_CALL_HELD, result);
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessCallsHeld
- * DESCRIPTION
- * This function is called by the state machine function
- * hold a call
- * PARAMETERS
- * info [?]
- * any(?) [IN] Information associated with held call
- * result(?) [OUT] Of execution of function which may be success or failure
- * RETURNS