CmErrorHandlers.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:23k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*******************************************************************************
  36.  *  Modification Notice:
  37.  *  --------------------------
  38.  *  This software is modified by MediaTek Inc. and the information contained
  39.  *  herein is confidential. The software may not be copied and the information
  40.  *  contained herein may not be used or disclosed except with the written
  41.  *  permission of MediaTek Inc. (C) 2001
  42.  *
  43.  *******************************************************************************/
  44.  /*******************************************************************************
  45.  * Filename:
  46.  * ---------
  47.  *   CmErrorHandlers.c
  48.  *
  49.  * Project:
  50.  * --------
  51.  *   Maui_Software
  52.  *
  53.  * Description:
  54.  * ------------
  55.  *  .......
  56.  *
  57.  * Author:
  58.  * -------
  59.  * -------
  60.  *
  61.  *------------------------------------------------------------------------------
  62.  * $Log$
  63.  *
  64.  * removed!
  65.  * removed!
  66.  * 
  67.  *
  68.  * removed!
  69.  * removed!
  70.  * 
  71.  *
  72.  * removed!
  73.  * removed!
  74.  * 
  75.  *
  76.  * removed!
  77.  * removed!
  78.  * 
  79.  *
  80.  * removed!
  81.  * removed!
  82.  * 
  83.  *
  84.  * removed!
  85.  * removed!
  86.  * 
  87.  *
  88.  * removed!
  89.  * removed!
  90.  * 
  91.  *
  92.  * removed!
  93.  * removed!
  94.  * 
  95.  *
  96.  * removed!
  97.  * removed!
  98.  * 
  99.  *
  100.  * removed!
  101.  * removed!
  102.  * 
  103.  *
  104.  *******************************************************************************/
  105. /**
  106.  * Copyright Notice
  107.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  108.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  109.  *  (It is illegal to remove this copyright notice from this software or any
  110.  *  portion of it)
  111.  */
  112. /**************************************************************
  113.    FILENAME : CmErrorHandlers.c
  114.    PURPOSE     : Call Management error handlers
  115.    REMARKS     : nil
  116.    AUTHOR      : Gupta Ashish
  117.    DATE     : Apr 07, 03
  118. **************************************************************/
  119. #include "stdC.h"
  120. #include "MMI_Features.h"
  121. #include "L4Dr.h"
  122. #include "L4Dr1.h"
  123. #include "PixtelDataTypes.h"
  124. #include "DebugInitDef.h"
  125. #include "MMI_trc.h"
  126. #include "TimerEvents.h"
  127. #include "HistoryGprot.h"
  128. #include "SubLCDHistoryGProt.h"
  129. #include "Wgui_categories_popup.h"
  130. #include "ProfileGprots.h"
  131. #include "CallManagementIdDef.h"
  132. #include "CmErrorTypes.h"
  133. #include "CallManagementStruct.h"
  134. #include "CallStructureManagementProt.h"
  135. #include "CommonStubsProt.h"
  136. #include "HistoryHelperProt.h"
  137. #include "RedialHelperGProt.h"
  138. #include "CallManagementGprot.h"
  139. #include "OutgoingCallManagementProt.h"
  140. #include "CmErrorHandlersProt.h"
  141. #include "CommonScreens.h"      /* for popup window timer. */
  142. /*****************************************************************************
  143.  * FUNCTION
  144.  *  ProcessIncomingFailureEvents
  145.  * DESCRIPTION
  146.  *  This function handles all the failure conditions in call management.
  147.  * PARAMETERS
  148.  *  event           [IN]        
  149.  *  cause           [IN]        
  150.  *  Incoming(?)     [IN]        Event Type, Any information associated with the event
  151.  * RETURNS
  152.  *  void
  153.  *****************************************************************************/
  154. void ProcessIncomingFailureEvents(CM_EVENT_TYPES event, U16 cause)
  155. {
  156.     /*----------------------------------------------------------------*/
  157.     /* Local Variables                                                */
  158.     /*----------------------------------------------------------------*/
  159.     /*----------------------------------------------------------------*/
  160.     /* Code Body                                                      */
  161.     /*----------------------------------------------------------------*/
  162.     MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessIncomingFailureEvents));
  163.     switch (event)
  164.     {
  165.         case CM_PS_HELD_CALL_ACTIVE:
  166.         case CM_PS_ACTIVE_CALL_HELD:
  167.         case CM_PS_INCOMING_CALL_CONNECTED:
  168.             /* fail to answer incoming call or waiting call */
  169.             //No need to modify state machine in case of ERROR
  170.             //ProcessIncomingFailureCallEvent(cause);
  171.             ShowCallManagementErrorMessage(cause);
  172.             break;
  173.         case CM_PS_INCOMING_CALL_DEFLECT:
  174.         case CM_PS_ACTIVATED_CCBS:
  175.         case CM_PS_CCBS_INVOKE_DIAL:
  176.             ShowCallManagementErrorMessage(cause);
  177.             break;
  178.         default:
  179.             ShowCallManagementErrorMessage(ERR_L4C_GEN_CAUSE);
  180.             PRINT_INFORMATION(("File: [%s]  Line: [%d] <<Not Valid State Machine event>>n", __FILE__, __LINE__));
  181.             break;
  182.     }
  183. }
  184. /*****************************************************************************
  185.  * FUNCTION
  186.  *  OutgoingProcessCMFailureEvent
  187.  * DESCRIPTION
  188.  *  This is the Entry function for all the Events while the Call-Management application
  189.  *  is Active.
  190.  *  
  191.  *  This function handles the events from both keyboard and protocol stack.
  192.  *  The keyboard events have KB in there defination and Protocol has PS.
  193.  * PARAMETERS
  194.  *  inEvenType      [IN]        
  195.  *  cause           [IN]        
  196.  *  void(?)         [IN]        *(pointer to the event's associated structure)
  197.  * RETURNS
  198.  *  void
  199.  *****************************************************************************/
  200. void OutgoingProcessCMFailureEvent(CM_EVENT_TYPES inEvenType, U16 cause)
  201. {
  202.     /*----------------------------------------------------------------*/
  203.     /* Local Variables                                                */
  204.     /*----------------------------------------------------------------*/
  205.     /*----------------------------------------------------------------*/
  206.     /* Code Body                                                      */
  207.     /*----------------------------------------------------------------*/
  208.     MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_OutgoingProcessCMFailureEvent));
  209.     switch (inEvenType)
  210.     {
  211.         case CM_PS_CALLCONNECTED:
  212.             /* fail in ss_parse_rsp, dial_ind, connect_ind or
  213.                got release_ind before connect */
  214.             ProcessPSCallConnectFailEvent(cause);
  215.             break;
  216.         case CM_PS_HOLDSUC:     /* hold fail */
  217.         case CM_PS_RETRIEVESUC: /* retreive fail */
  218.         case CM_PS_SWAPSUC:     /* swap fail */
  219.         case CM_PS_CONFSUC:     /* conference fail */
  220.         case CM_PS_SPLITSUC:    /* split fail */
  221.         case CM_PS_ECT_SUC:     /* ECT fail */
  222.             ShowCallManagementErrorMessage(cause);
  223.             break;
  224.         default:
  225.             PRINT_INFORMATION(("n CM Event Handler does not exist n"));
  226.             break;
  227.     }
  228. }
  229. /*****************************************************************************
  230.  * FUNCTION
  231.  *  ProcessPSCallConnectFailEvent
  232.  * DESCRIPTION
  233.  *  This is the function to process Protocol(Response) failure Event.
  234.  * PARAMETERS
  235.  *  cause       [IN]        
  236.  *  void(?)     [IN]        *(this points to CM_CALL_HANDLE of the call which requested CM_KB_OUTGOINGCALL)
  237.  * RETURNS
  238.  *  void
  239.  *****************************************************************************/
  240. void ProcessPSCallConnectFailEvent(U16 cause)
  241. {
  242.     /*----------------------------------------------------------------*/
  243.     /* Local Variables                                                */
  244.     /*----------------------------------------------------------------*/
  245.     CM_CALL_HANDLE callHandle;
  246.     U8 type;
  247.     /*----------------------------------------------------------------*/
  248.     /* Code Body                                                      */
  249.     /*----------------------------------------------------------------*/
  250.     if (GetCCFlag() == TRUE)
  251.     {
  252.         callHandle = GetOutgoingCallHandle();
  253.         if (callHandle == -1)
  254.         {
  255.             PRINT_INFORMATION(("n ProcessPSCallConnectFailEvent Getting the Connected Handle has -1 n"));
  256.             return;
  257.         }
  258.         switch (GetCurrentState())
  259.         {
  260.                 /* amanda add 0326, MO MT collision */
  261.             case CM_INCOMING_STATE:
  262.                 PurgeOutgoingCallsStructure();
  263.                 cause = 0;
  264.                 break;
  265.             case CM_OUTGOING_STATE:
  266.                 type = GetOutgoingCallType();
  267.                 PurgeOutgoingCallsStructure();
  268.                 SetCurrentState(GetPreviousState());
  269.                 SetPreviousState(CM_OUTGOING_STATE);
  270.                 if (GetTotalCallCount() == 0)
  271.                 {
  272.                     /* only voice call can redial */
  273.                     if ((type != CM_VOICE_CALL) || (IsRedialNeeded(cause) == FALSE))
  274.                     {
  275.                         /* no need to redial, just show error and get out of CM */
  276.                         ShowCallManagementErrorMessage(cause);
  277.                         GetOutOfCMforAdjustHistory();
  278.                         return;
  279.                     }
  280.                     else
  281.                     {
  282.                         /* need to redial, show error and redial */
  283.                         if (IsRedialSet())
  284.                         {
  285.                             SetCallEndedBeforeConnFlag(FALSE);
  286.                             CheckRedialOrShowError(cause);
  287.          /* abort SS if needed */
  288.                             DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
  289.                             return;
  290.                         }
  291.                     }
  292.                 }
  293.                 /* still have other call, can't redial, just show error */
  294.                 break;
  295.             default:
  296.                 PRINT_INFORMATION(("n ProcessPSCallConnectFailEvent CM State m/c Corrupted n"));
  297.                 break;
  298.         }
  299.     }
  300.     ShowCallManagementErrorMessage(cause);
  301. }
  302. /*****************************************************************************
  303.  * FUNCTION
  304.  *  ShowCallManagementErrorMessage
  305.  * DESCRIPTION
  306.  *  This function shows the failure in case of call management
  307.  *  
  308.  *  This is a part of other hardware application.
  309.  * PARAMETERS
  310.  *  cause       [IN]        
  311.  *  TRUE(?)     [OUT]       Or FALSE
  312.  * RETURNS
  313.  *  pBOOL(?)
  314.  *****************************************************************************/
  315. void ShowCallManagementErrorMessage(U16 cause)
  316. {
  317.     /*----------------------------------------------------------------*/
  318.     /* Local Variables                                                */
  319.     /*----------------------------------------------------------------*/
  320.     U16 error_code, img_id = IMG_ERROR_NOTIFY;
  321.     U16 tone_id = ERROR_TONE_IN_CALL;
  322.     /*----------------------------------------------------------------*/
  323.     /* Code Body                                                      */
  324.     /*----------------------------------------------------------------*/
  325.     MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ShowCallManagementErrorMessage));
  326.     if (GetCallEndCause() == 0)
  327.     {
  328.         SetCallEndCause(cause);
  329.     }
  330.     SetCbackAfterSS(NULL);
  331.     if (GetNotifySSFlag())
  332.     {
  333.         MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ShowErrorAfterNotifySS));
  334.         SetCbackAfterSS((FuncPtr) ShowCallManagementErrorMessage);
  335.         return;
  336.     }
  337.     EntryNewScreen(CM_SCR_ERR_MSG, ExitScrCMErrMsg, NULL, NULL);
  338.     switch (GetCallEndCause())
  339.     {
  340.         case ERR_UNASSIGNED_NUM:
  341.          tone_id = NUM_UNOBTAIN_TONE;
  342.         case ERR_INVALID_NUMBER_FORMAT:
  343.             error_code = ERROR_UNRECOGNIZED_NUMBER;
  344.             break;
  345.         case ERR_SWITCH_EQUIPMENT_CONGESTION:
  346. tone_id = CONGESTION_TONE;
  347.         case ERR_CALL_REJECTED:
  348. tone_id= AUTH_FAIL_TONE;
  349.         case ERR_NO_ROUTE_TO_DESTINATION:
  350.         case ERR_DEST_OUT_OF_ORDER:
  351.         case ERR_FACILITY_REJECT:
  352.         case ERR_TEMPORARY_FAILURE:
  353.         case ERR_SER_UNAVAILABLE:
  354.         case ERR_BEARER_SER_UNIMPL:
  355.         case ERR_INVALID_TI_VALUE:
  356.         case ERR_USER_NOT_IN_CUG:
  357.         case ERR_INCOMPATIBLE_DEST:
  358.         case ERR_SEMANTIC_ERR:
  359.         case ERR_INTER_WRK_UNSPECIFIED:
  360.         case ERR_CSMCC_ILLEGAL_CALL_ID:
  361.         case ERR_CSMCC_CALL_ALLOC_FAIL:
  362.         case ERR_CSMCC_BC_FILL_FAIL:
  363.         case ERR_CSMCC_ILLEGAL_BC:
  364.         case ERR_CSMCC_MODIFY_ACTUAL_MODE:
  365.         case ERR_CSMCC_DATA_ACT_FAIL:
  366.         case ERR_MAC_FAILURE:
  367.         case ERR_SYNC_FAILURE:
  368.         case ERR_CONGESTION:
  369.         case ERR_ILLEGAL_MS:
  370.         case ERR_ILLEGAL_ME:
  371.         case ERR_CM_MM_CM_ENQUEUE_FAIL:
  372.         case ERR_CM_MM_NOT_UPDATED:
  373.             error_code = ERROR_FAIL;
  374.             break;
  375.         case ERR_CHANNEL_UN_ACCP:
  376.         case ERR_NO_CIRCUIT_CHANNEL_AVAIL:
  377.         case ERR_NETWORK_OUT_OF_ORDER:
  378.         case ERR_QOS_UNAVAIL:
  379.         case ERR_INVALID_TRANSIT_NW_SEL:
  380.         case ERR_CSMCC_NO_RESPONSE_FROM_NW:
  381.         case ERR_NETWORK_FAILURE:
  382.         case ERR_CM_MM_RR_CONN_RELEASE:
  383.             error_code = ERROR_NETWORK_FAIL;
  384.             break;
  385.         case ERR_REQUESTED_CKT_CHANEL_NOT_AVIL:
  386.         case ERR_RESOURCE_UNAVAIL_UNSPECIFIED:
  387.         case ERR_CM_MM_AUTH_FAILURE:
  388.             error_code = ERROR_NETWORK_NOT_AVAILABLE;
  389.             break;
  390.         case ERR_OPR_DTR_BARRING:
  391.         case ERR_CALL_BARRED:
  392.         case ERR_IC_BAR_CUG:
  393.         case ERR_BEARER_CAP_NOT_AVAIL:
  394.         case ERR_CM_MM_ACCESS_BARRED:
  395.             error_code = INCOMING_DEFAULT_ERROR;
  396.             break;
  397.         case ERR_USER_BUSY:
  398.         {
  399.             /* voice call shows user busy, csd call shows network busy */
  400.             if (cm_p->state_info.CallStructureForCallLog.call_type == CM_VOICE_CALL)
  401.             {
  402.                 error_code = ERROR_USER_BUSY;
  403.             }
  404.             else
  405.             {
  406.                 error_code = ERROR_BUSY_NETWORK;
  407.             }
  408.         }
  409.             break;
  410.         case ERR_NO_USER_RESPONDING:
  411.             error_code = ERROR_NOT_RESPONDING;
  412.             break;
  413.         case ERR_NO_ANSWER_ON_ALERT:
  414.             error_code = ERROR_NO_ANSWER;
  415.             break;
  416.         case ERR_ACM_EXCEEDED:
  417.             error_code = ERROR_ACM_EXCEEDED;
  418.             break;
  419.         case ERR_REQ_FACILITY_UNAVAIL:
  420.         case ERR_IE_NOT_IMPLEMENTED:
  421.         case ERR_CONDITIONAL_MM_IE_ERROR:
  422.         case ERR_CM_MM_ASSIGNMENT_REJECT:
  423.             error_code = ERROR_UNAVAILABLE;
  424.             break;
  425.         case ERR_CSMCC_CMD_NOT_ALLOW:
  426.         case ERR_CSMCC_ILLEGAL_DTMF_TONE:
  427.         case ERR_CSMCC_CALL_ACCEPT_NOT_ALLOW:
  428.         case ERR_MS_ID_NOT_DERIVED_BY_NW:
  429.         case ERR_IMPLICIT_DETACH:
  430.         case ERR_MSG_NOT_COMPAT_WITH_PROTO_STATE:
  431.         case ERR_PROTO_ERROR_UNSPECIFIED:
  432.             error_code = ERROR_UNEXPECTED_ERROR;
  433.             break;
  434.         case ERR_IMSI_UNKNOWN_IN_HLR:
  435.         case ERR_IMSI_UNKNOWN_IN_VLR:
  436.         case ERR_CM_MM_IMSI_DETACH:
  437.             error_code = ERROR_IMSI_UNKNOWN;
  438.             break;
  439.         case ERR_IMEI_NOT_ACCEPTED:
  440.             error_code = ERROR_IMEI_ERROR;
  441.             break;
  442.         case ERR_GPRS_NOT_ALLOWED:
  443.         case ERR_GPRS_NON_GPRS_NOT_ALLOWED:
  444.             error_code = ERROR_GPRS_NOT_ALLOWED;
  445.             break;
  446.         case ERR_CM_MT_DATA_CALL:
  447.             error_code = ERROR_MT_DATA_CALL;
  448.             break;
  449.         case ERR_REQ_FAC_NOT_SUBS:
  450.         case ERR_PLMN_NOT_ALLOWED:
  451.         case ERR_LOCATION_AREA_NOT_ALLOWED:
  452.         case ERR_ROAMING_AREA_NOT_ALLOWED:
  453.         case ERR_GPRS_NOT_ALLOWED_IN_PLMN:
  454.         case ERR_NO_SUITABLE_CELLS_IN_LA:
  455.         case ERR_MSC_TEMP_NOT_REACHABLE:
  456.         case ERR_CM_MM_ABORT_BY_NW:
  457.             /* case ERR_CM_MM_STATE_NOT_ALLOWED_CM: */
  458.         case ERR_BEARER_CAP_NOT_AUTHORISED:
  459.             error_code = ERROR_NETWORK_NOT_ALLOWED;
  460.             break;
  461.         case ERR_SERV_OPTION_NOT_SUPPORTED:
  462.         case ERR_REQ_SERV_OPTION_NOT_SUBSCRIBED:
  463.         case ERR_SERV_OPTION_TEMP_OUT_OF_ORDER:
  464.         case ERR_CALL_CANNOT_BE_IDENTIFIED:
  465.             error_code = ERROR_COMMAND_NOT_SUPPORTED;
  466.             break;
  467.         case ERR_NO_PDP_CONTEXT_ACTIVATED:
  468.         case ERR_SEMANTICALLY_INCORRECT_MSG:
  469.         case ERR_INVALID_MM_MAND_INFO:
  470.             error_code = ERROR_DATA_ERROR;
  471.             break;
  472.         case ERR_MSG_TYPE_NON_EXISTENT:
  473.         case ERR_MSG_TYPE_INCOMPAT_WITH_PROTO_STATE:
  474.             error_code = ERROR_MESSAGE_TYPE_ERROR;
  475.             break;
  476.         case ERR_ACCESS_CLASS_BARRED:
  477.         case ERR_CM_MM_RANDOM_ACCES_FAILURE:
  478.             error_code = ERROR_ACCESS_FAIL;
  479.             break;
  480.         case ERR_CM_MM_CONN_TIMEOUT:
  481.             error_code = ERROR_TIMER_EXPIRED;
  482.             break;
  483.         case ERR_NORMAL_CALL_CLR:
  484.             error_code = STR_CALL_ENDED;
  485.             img_id = IMG_CM_STATE_ENDED;
  486.             break;
  487.         case ERR_NORMAL_UNSPECIFIED:
  488.             error_code = ERROR_BUSY_NETWORK;
  489.             break;
  490.         case ERR_L4C_USSD_ABORT:
  491.             error_code = ERROR_USSD_ABORTED;
  492.             break;
  493.         case ERR_CM_MM_RR_NO_SERVICE:
  494.         case ERR_CM_MM_NO_SERVICE:
  495.         case ERR_RESERVED:
  496.         case ERR_NUMBER_CHANGED:
  497.         case ERR_PRE_EMPTION:
  498.         case ERR_NON_SEL_USER_CLEAR:
  499.         case ERR_RES_STATUS_ENQ:
  500.         case ERR_ACCESS_INFO_DISCARDED:
  501.         case ERR_RESTR_DIGITAL_INFO:
  502.         case ERR_SER_OPT_UNIMPL:
  503.         case ERR_INVALID_MANDATORY_INF:
  504.         case ERR_MSG_TYPE_UNIMPL:
  505.         case ERR_MSG_TYPE_NOT_COMPATIBLE:
  506.         case ERR_IE_NON_EX:
  507.         case ERR_COND_IE_ERR:
  508.         case ERR_INCOMP_MESG_WITH_STATE:
  509.         case ERR_RECOVERY_ON_TIMER_EXPIRY:
  510.         case ERR_PROTOCOL_ERR_UNSPECIFIED:
  511.         case ERR_CSMCC_CALL_RE_EST:
  512.         case ERR_RETRY_UPON_ENTRY_INTO_NEWCELL_MIN:
  513.         case ERR_RETRY_UPON_ENTRY_INTO_NEWCELL_MAX:
  514.         case ERR_CM_MM_STATE_NOT_ALLOWED_CM:
  515.         case ERR_CM_MM_CAUSE_NONE:
  516.         case ERR_L4C_GEN_CAUSE:
  517.             error_code = INCOMING_DEFAULT_ERROR;
  518.             break;
  519.         case ERR_L4C_FDN_FAIL:
  520.             error_code = ERROR_FDN_FAIL;
  521.             break;
  522.         case NO_ACTIVE_CALL:
  523.             error_code = ERROR_INVALID_COMMAND;
  524.             break;
  525.         case ERR_CM_UNKNOWN:
  526.             error_code = INCOMING_UNKNOWN_ERROR;
  527.             break;
  528.         default:
  529.             error_code = INCOMING_DEFAULT_ERROR;
  530.             break;
  531.     }   /* End of Switch */
  532.     ShowCategory62Screen(error_code, img_id, NULL);
  533.     SetCallEndCause(0);
  534.     if (GetTotalActiveCallCount() == 0 && GetTotalHoldCallCount() == 0)
  535.     {
  536.         /* only play error tone when not in-call */
  537.         playRequestedTone(tone_id);
  538.         SetErrorToneFlag(tone_id);
  539.     }
  540.     if (cm_p->redial_info.RedialTimer == TRUE)
  541.     {
  542.         /* cannot press key before pop up disappear,
  543.            buy more time for call log writing */
  544.         DeleteSubLCDScreen(SUB_LCD_SCR1001_CM_OUTGOINGCALLSCREEN);
  545.         GoBackSubLCDHistory();
  546.         if (IsScreenPresent(CM_SCR_MARKER))
  547.         {
  548.             DeleteUptoCmScreen();
  549.         }
  550.         DeleteScreenIfPresent(CM_SCR_MARKER);
  551.         ClearInputEventHandler(MMI_DEVICE_ALL);
  552.         SetPOPUpFlag(TRUE);
  553.         SetKeyHandler(ResetRedialAndGoBack, KEY_END, KEY_EVENT_DOWN);
  554.         cm_p->redial_info.ErrRedialScreen = TRUE;
  555.         StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, ShowRedialScreen);
  556.     }
  557.     else
  558.     {
  559.         /* cannot press key before pop up disappear,
  560.            buy more time for call log writing */
  561.         ClearInputEventHandler(MMI_DEVICE_ALL);
  562.         SetKeyHandler((FuncPtr) GoBackfromNotifyScr, KEY_END, KEY_EVENT_DOWN);
  563.         SetPOPUpFlag(TRUE);
  564.         StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
  565.     }
  566. }
  567. /*****************************************************************************
  568.  * FUNCTION
  569.  *  ExitScrCMErrMsg
  570.  * DESCRIPTION
  571.  *  Exit handler for the error pop up screen
  572.  * PARAMETERS
  573.  *  void
  574.  * RETURNS
  575.  *  void
  576.  *****************************************************************************/
  577. void ExitScrCMErrMsg(void)
  578. {
  579.     /*----------------------------------------------------------------*/
  580.     /* Local Variables                                                */
  581.     /*----------------------------------------------------------------*/
  582.     /*----------------------------------------------------------------*/
  583.     /* Code Body                                                      */
  584.     /*----------------------------------------------------------------*/
  585.     MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ExitScrCMErrMsg));
  586.     if (GetErrorToneFlag() > 0)
  587.     {
  588.         stopRequestedTone(GetErrorToneFlag());
  589.         SetErrorToneFlag(0);
  590.     }
  591.     StopTimer(CM_NOTIFYDURATION_TIMER);
  592.     if (cm_p->redial_info.RedialTimer == TRUE)
  593.     {
  594.         /* in redial process */
  595.         if (cm_p->redial_info.ErrRedialScreen == TRUE)
  596.         {
  597.             /* error msg got interrupted */
  598.             history Scr1009;
  599.             S16 nHistory = 0;
  600.             MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ExitScrCMErrMsgRedial));
  601.             Scr1009.scrnID = CM_SCR_RDL_TIME;
  602.             Scr1009.entryFuncPtr = EntryScrShowUserTimeToRedial;
  603.             pfnUnicodeStrcpy((S8*) Scr1009.inputBuffer, (S8*) & nHistory);
  604.             GetCategoryHistory(Scr1009.guiBuffer);
  605.             AddHistory(Scr1009);
  606.             cm_p->redial_info.ErrRedialScreen = FALSE;
  607.             return;
  608.         }
  609.         else
  610.         {
  611.             /* error msg timer expire => going to Notify Redial Screen */
  612.             return;
  613.         }
  614.     }
  615.     /* SetRedialScreen(FALSE); */
  616.     if (GetPOPUpFlag())
  617.     {
  618.         SetPOPUpFlag(FALSE);
  619.         AdjustHistoryForCM();
  620.     }
  621. }