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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2.  * FUNCTION
  3.  *  ProcessKBRetrieveReqEvent
  4.  * DESCRIPTION
  5.  *  This is the function to process Keyboard(Request) Event CM_KB_RETRIEVEREQ.
  6.  *  
  7.  *  This Sets the flag CM_RETRIEVE_REQUESTED to all the held call
  8.  *  Invoke the protocol function irrespective of the state.
  9.  *  The chances of this being invoked in Idle or Active state is very less.
  10.  * PARAMETERS
  11.  *  MsgStruct               [?]         
  12.  *  ACTION_RESULT(?)        [OUT]       
  13.  *  this(?)                 [IN]        Points to NULL as the Retrieve is request on all held calls)
  14.  * RETURNS
  15.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  16.  *****************************************************************************/
  17. ACTION_RESULT ProcessKBRetrieveReqEvent(void *MsgStruct)
  18. {
  19.     /*----------------------------------------------------------------*/
  20.     /* Local Variables                                                */
  21.     /*----------------------------------------------------------------*/
  22. U8 flag;
  23.     /*----------------------------------------------------------------*/
  24.     /* Code Body                                                      */
  25.     /*----------------------------------------------------------------*/
  26.     if (GetChldReqSent() != CM_ACTION_NONE)
  27.     {
  28.         return CM_CALL_FAILURE;
  29.     }
  30.     flag = GetAllCallFlags();
  31.     if (((flag & CM_SWAP_REQUESTED) != 0) || 
  32.      ((flag & CM_CONF_REQUESTED) != 0) ||
  33.      ((flag & CM_ECT_REQUESTED) != 0))
  34.     {
  35.         return CM_CALL_FAILURE;
  36.     }
  37.     switch (GetCurrentState())
  38.     {
  39.         case CM_IDLE_STATE:
  40.             PRINT_INFORMATION(("n KBRetrieveReqEvent CM_IDLE_STATE not handled still n"));
  41.             break;
  42.         case CM_OUTGOING_STATE:
  43.             PRINT_INFORMATION(("n KBRetrieveReqEvent CM_OUTGOING_STATE not handled still n"));
  44.             break;
  45.         case CM_INCOMING_STATE:
  46.         case CM_ACTIVE_STATE:
  47.         case CM_HOLD_STATE:
  48.             SetRetrieveFlag();
  49.             MakePsActiveHold((void*)RetrieveReqSucess);
  50.             break;
  51.         default:
  52.             PRINT_INFORMATION(("n KBRetrieveReqEvent CM State m/c Corrupted n"));
  53.             return CM_CALL_FAILURE;
  54.     }
  55.     return CM_CALL_SUCCESS;
  56. }
  57. /*****************************************************************************
  58.  * FUNCTION
  59.  *  ProcessPSRetrieveSucEvent
  60.  * DESCRIPTION
  61.  *  This is the function to process Protocol(Response) Event CM_PS_RETRIEVESUC.
  62.  *  
  63.  *  This resets the CM_RETRIEVE_REQUESTED flag & change the state of the call from
  64.  *  HOLD to ACTIVE if necessary it also changes the state of the State m/c.
  65.  * PARAMETERS
  66.  *  MsgStruct               [?]         
  67.  *  ACTION_RESULT(?)        [OUT]       
  68.  *  this(?)                 [IN]        Is Null as the request CM_KB_RETRIEVEREQ is on all Held/Hold calls)
  69.  * RETURNS
  70.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  71.  *****************************************************************************/
  72. ACTION_RESULT ProcessPSRetrieveSucEvent(void *MsgStruct)
  73. {
  74.     /*----------------------------------------------------------------*/
  75.     /* Local Variables                                                */
  76.     /*----------------------------------------------------------------*/
  77.     /*----------------------------------------------------------------*/
  78.     /* Code Body                                                      */
  79.     /*----------------------------------------------------------------*/
  80.     switch (GetCurrentState())
  81.     {
  82.         case CM_IDLE_STATE:
  83.             PRINT_INFORMATION(("n PSRetrieveSucEvent CM_IDLE_STATE not handled still n"));
  84.             break;
  85.         case CM_OUTGOING_STATE:
  86.             PRINT_INFORMATION(("n PSRetrieveSucEvent CM_OUTGOING_STATE not handled still n"));
  87.             break;
  88.         case CM_INCOMING_STATE:
  89.             PRINT_INFORMATION(("n PSRetrieveSucEvent CM_INCOMING_STATE n"));
  90.             MakeRetrieve();
  91.             EntryScr1006NotifyRetrieveSucess();
  92.             SetPreviousState(CM_ACTIVE_STATE);
  93.             break;
  94.         case CM_HOLD_STATE:
  95.         case CM_ACTIVE_STATE:
  96.             MakeRetrieve();
  97.             EntryScr1006NotifyRetrieveSucess();
  98.             if ((GetTotalCallCount() == GetTotalActiveCallCount()) && (GetTotalHoldCallCount() == 0))
  99.             {
  100.                 SetPreviousState(GetCurrentState());
  101.                 SetCurrentState(CM_ACTIVE_STATE);
  102.             }
  103.             break;
  104.         default:
  105.             PRINT_INFORMATION(("n PSRetrieveSucEvent CM State m/c Corrupted n"));
  106.             return CM_CALL_FAILURE;
  107.     }
  108.     return CM_CALL_SUCCESS;
  109. }
  110. /*****************************************************************************
  111.  * FUNCTION
  112.  *  ProcessKBSwapReqEvent
  113.  * DESCRIPTION
  114.  *  This is the function to process Keyboard(Request) Event CM_KB_SWAPREQ.
  115.  *  
  116.  *  This Sets the flag CM_SWAP_REQUESTED to all the calls
  117.  *  Invoke the protocol function irrespective of the state.
  118.  *  This is always Invoked in Active state.
  119.  * PARAMETERS
  120.  *  MsgStruct               [?]         
  121.  *  ACTION_RESULT(?)        [OUT]       
  122.  *  this(?)                 [IN]        Points to NULL as the Swap is requested on all calls)
  123.  * RETURNS
  124.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  125.  *****************************************************************************/
  126. ACTION_RESULT ProcessKBSwapReqEvent(void *MsgStruct)
  127. {
  128.     /*----------------------------------------------------------------*/
  129.     /* Local Variables                                                */
  130.     /*----------------------------------------------------------------*/
  131.     U8 flag;
  132.     /*----------------------------------------------------------------*/
  133.     /* Code Body                                                      */
  134.     /*----------------------------------------------------------------*/
  135.     flag = GetAllCallFlags();
  136.     if (GetChldReqSent() != CM_ACTION_NONE ||     
  137.      ((flag & CM_SWAP_REQUESTED) != 0) || 
  138.      ((flag & CM_CONF_REQUESTED) != 0) ||
  139.      ((flag & CM_ECT_REQUESTED) != 0))
  140.     {
  141.         return CM_CALL_FAILURE;
  142.     }
  143.     switch (GetCurrentState())
  144.     {
  145.         case CM_IDLE_STATE:
  146.             PRINT_INFORMATION(("n KBSwapReqEvent CM_IDLE_STATE not handled still n"));
  147.             break;
  148.         case CM_OUTGOING_STATE:
  149.             PRINT_INFORMATION(("n KBSwapReqEvent CM_OUTGOING_STATE not handled still n"));
  150.             break;
  151.         case CM_HOLD_STATE:
  152.         case CM_INCOMING_STATE:
  153.         case CM_ACTIVE_STATE:
  154.             SetSwapFlag();
  155.             MakePsSwapCallRequest((void*)SwapReqSucess);
  156.             break;
  157.         default:
  158.             PRINT_INFORMATION(("n KBSwapReqEvent CM State m/c Corrupted n"));
  159.             return CM_CALL_FAILURE;
  160.     }
  161.     return CM_CALL_SUCCESS;
  162. }
  163. /*****************************************************************************
  164.  * FUNCTION
  165.  *  ProcessPSSwapSucEvent
  166.  * DESCRIPTION
  167.  *  This is the function to process Protocol(Response) Event CM_PS_SWAPSUC.
  168.  *  
  169.  *  This resets the CM_SWAP_REQUESTED flag & change the state of the call from
  170.  *  HOLD to ACTIVE & viceversa.
  171.  * PARAMETERS
  172.  *  MsgStruct               [?]         
  173.  *  ACTION_RESULT(?)        [OUT]       
  174.  *  this(?)                 [IN]        Is Null as the request CM_KB_SWAPREQ is on all calls)
  175.  * RETURNS
  176.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  177.  *****************************************************************************/
  178. ACTION_RESULT ProcessPSSwapSucEvent(void *MsgStruct)
  179. {
  180.     /*----------------------------------------------------------------*/
  181.     /* Local Variables                                                */
  182.     /*----------------------------------------------------------------*/
  183.     /*----------------------------------------------------------------*/
  184.     /* Code Body                                                      */
  185.     /*----------------------------------------------------------------*/
  186.     if (GetTotalCallCount() > 0)
  187.     {
  188.         SyncCallList();
  189.     }
  190.     switch (GetCurrentState())
  191.     {
  192.         case CM_IDLE_STATE:
  193.             PRINT_INFORMATION(("n PSSwapSucEvent CM_IDLE_STATE not handled still n"));
  194.             break;
  195.         case CM_OUTGOING_STATE:
  196.             PRINT_INFORMATION(("n PSSwapSucEvent CM_OUTGOING_STATE not handled still n"));
  197.             break;
  198.         case CM_INCOMING_STATE:
  199.             MakeSwap();
  200.             // if (GetTotalActiveCallCount() + GetTotalHoldCallCount() ==  1)
  201.             // {
  202.             // DeleteScreenIfPresent(ITEMSCR_INCOMING_CALL);
  203.             // SetIncomingCallStateActive();
  204.             // SetPreviousState (GetCurrentState());
  205.             // SetCurrentState(CM_ACTIVE_STATE);
  206.             // }
  207.             EntryScr1007NotifySwapSucess();
  208.             break;
  209.         case CM_HOLD_STATE:
  210.             MakeSwap();
  211.             EntryScr1007NotifySwapSucess();
  212.             break;
  213.         case CM_ACTIVE_STATE:
  214.             MakeSwap();
  215.             EntryScr1007NotifySwapSucess();
  216.             break;
  217.         default:
  218.             PRINT_INFORMATION(("n PSSwapSucEvent CM State m/c Corrupted n"));
  219.             return CM_CALL_FAILURE;
  220.     }
  221.     return CM_CALL_SUCCESS;
  222. }
  223. /*****************************************************************************
  224.  * FUNCTION
  225.  *  ProcessKBConfReqEvent
  226.  * DESCRIPTION
  227.  *  This is the function to process Keyboard(Request) Event CM_KB_CONFREQ.
  228.  *  
  229.  *  This Sets the flag CM_CONF_REQUESTED to all the calls
  230.  *  Invoke the protocol function irrespective of the state.
  231.  *  This is always Invoked in Active state.
  232.  * PARAMETERS
  233.  *  MsgStruct               [?]         
  234.  *  ACTION_RESULT(?)        [OUT]       
  235.  *  this(?)                 [IN]        Points to NULL as the Conference is requested on all calls)
  236.  * RETURNS
  237.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  238.  *****************************************************************************/
  239. ACTION_RESULT ProcessKBConfReqEvent(void *MsgStruct)
  240. {
  241.     /*----------------------------------------------------------------*/
  242.     /* Local Variables                                                */
  243.     /*----------------------------------------------------------------*/
  244. U8 flag;
  245.     /*----------------------------------------------------------------*/
  246.     /* Code Body                                                      */
  247.     /*----------------------------------------------------------------*/
  248.     flag = GetAllCallFlags();
  249.     if (((flag & CM_SWAP_REQUESTED) != 0) || 
  250.      ((flag & CM_CONF_REQUESTED) != 0) ||
  251.      ((flag & CM_ECT_REQUESTED) != 0))
  252.     {
  253.         return CM_CALL_FAILURE;
  254.     }
  255.     switch (GetCurrentState())
  256.     {
  257.         case CM_IDLE_STATE:
  258.             PRINT_INFORMATION(("n KBConfReqEvent CM_IDLE_STATE not handled still n"));
  259.             break;
  260.         case CM_OUTGOING_STATE:
  261.             PRINT_INFORMATION(("n KBConfReqEvent CM_OUTGOING_STATE not handled still n"));
  262.             break;
  263.         case CM_INCOMING_STATE:
  264.         case CM_ACTIVE_STATE:
  265.             SetConfFlag();
  266.             MakePsConfCallRequest();
  267.             break;
  268.         case CM_HOLD_STATE:
  269.             PRINT_INFORMATION(("n KBConfReqEvent CM_HOLD_STATE not handled still n"));
  270.             break;
  271.         default:
  272.             PRINT_INFORMATION(("n KBConfReqEvent CM State m/c Corrupted n"));
  273.             return CM_CALL_FAILURE;
  274.     }
  275.     return CM_CALL_SUCCESS;
  276. }
  277. /*****************************************************************************
  278.  * FUNCTION
  279.  *  ProcessPSConfSucEvent
  280.  * DESCRIPTION
  281.  *  This is the function to process Protocol(Response) Event CM_PS_CONFSUC.
  282.  *  
  283.  *  This resets the CM_CONF_REQUESTED flag & change the state of the all calls
  284.  *  to ACTIVE.
  285.  * PARAMETERS
  286.  *  MsgStruct               [?]         
  287.  *  ACTION_RESULT(?)        [OUT]       
  288.  *  this(?)                 [IN]        Is Null as the request CM_KB_CONFREQ is on all calls)
  289.  * RETURNS
  290.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  291.  *****************************************************************************/
  292. ACTION_RESULT ProcessPSConfSucEvent(void *MsgStruct)
  293. {
  294.     /*----------------------------------------------------------------*/
  295.     /* Local Variables                                                */
  296.     /*----------------------------------------------------------------*/
  297.     /*----------------------------------------------------------------*/
  298.     /* Code Body                                                      */
  299.     /*----------------------------------------------------------------*/
  300.     switch (GetCurrentState())
  301.     {
  302.         case CM_IDLE_STATE:
  303.             PRINT_INFORMATION(("n PSConfSucEvent CM_IDLE_STATE not handled still n"));
  304.             break;
  305.         case CM_OUTGOING_STATE:
  306.             PRINT_INFORMATION(("n PSConfSucEvent CM_OUTGOING_STATE not handled still n"));
  307.             break;
  308.         case CM_INCOMING_STATE:
  309.         case CM_ACTIVE_STATE:
  310.             MakeConf();
  311.             EntryScr1008NotifyConfSucess();
  312.             break;
  313.         case CM_HOLD_STATE:
  314.             PRINT_INFORMATION(("n PSConfSucEvent CM_HOLD_STATE not handled still n"));
  315.             break;
  316.         default:
  317.             PRINT_INFORMATION(("n PSConfSucEvent CM State m/c Corrupted n"));
  318.             return CM_CALL_FAILURE;
  319.     }
  320.     return CM_CALL_SUCCESS;
  321. }
  322. /*****************************************************************************
  323.  * FUNCTION
  324.  *  ProcessKBSplitReqEvent
  325.  * DESCRIPTION
  326.  *  This is the function to process Keyboard(Request) Event CM_KB_SPLITREQ.
  327.  *  
  328.  *  This Sets the flag CM_SPLIT_REQUESTED to the particular call selected
  329.  *  from the group of active calls.
  330.  *  Invoke the protocol function irrespective of the state.
  331.  *  This is always Invoked in Active state.
  332.  * PARAMETERS
  333.  *  MsgStruct               [?]         
  334.  *  ACTION_RESULT(?)        [OUT]       
  335.  *  this(?)                 [IN]        Points to CM_CALL_HANDLE of the call to be splitted in the conference)
  336.  * RETURNS
  337.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  338.  *****************************************************************************/
  339. ACTION_RESULT ProcessKBSplitReqEvent(void *MsgStruct)
  340. {
  341.     /*----------------------------------------------------------------*/
  342.     /* Local Variables                                                */
  343.     /*----------------------------------------------------------------*/
  344.     CM_CALL_HANDLE callIndex;
  345.     /*----------------------------------------------------------------*/
  346.     /* Code Body                                                      */
  347.     /*----------------------------------------------------------------*/
  348.     memcpy((void*)&callIndex, MsgStruct, sizeof(CM_CALL_HANDLE));
  349.     switch (GetCurrentState())
  350.     {
  351.         case CM_IDLE_STATE:
  352.             PRINT_INFORMATION(("n KBSplitReqEvent CM_IDLE_STATE not handled still n"));
  353.             break;
  354.         case CM_OUTGOING_STATE:
  355.             PRINT_INFORMATION(("n KBSplitReqEvent CM_OUTGOING_STATE not handled still n"));
  356.             break;
  357.         case CM_INCOMING_STATE:
  358.             if (GetTotalActiveCallCount() >= 2)
  359.             {
  360.                 SetCallflag(callIndex, CM_SPLIT_REQUESTED, TRUE);
  361.                 MakePsSplitRequest(callIndex);
  362.             }
  363.             else
  364.             {
  365.                 PRINT_INFORMATION(("n Not enuf calls to make a split request n"));
  366.             }
  367.             break;
  368.         case CM_ACTIVE_STATE:
  369.             if (GetTotalActiveCallCount() >= 2)
  370.             {
  371.                 SetCallflag(callIndex, CM_SPLIT_REQUESTED, TRUE);
  372.                 MakePsSplitRequest(callIndex);
  373.             }
  374.             else
  375.             {
  376.                 PRINT_INFORMATION(("n Not enuf calls to make a split request n"));
  377.             }
  378.             break;
  379.         case CM_HOLD_STATE:
  380.             PRINT_INFORMATION(("n KBSplitReqEvent CM_HOLD_STATE not handled still n"));
  381.             break;
  382.         default:
  383.             PRINT_INFORMATION(("n KBSplitReqEvent CM State m/c Corrupted n"));
  384.             return CM_CALL_FAILURE;
  385.     }
  386.     return CM_CALL_SUCCESS;
  387. }
  388. /*****************************************************************************
  389.  * FUNCTION
  390.  *  ProcessPSSplitSucEvent
  391.  * DESCRIPTION
  392.  *  This is the function to process Protocol(Response) Event CM_PS_SPLITSUC.
  393.  *  
  394.  *  This resets the CM_SPLIT_REQUESTED flag & change the state of that particular call to active
  395.  *  other calls states are changed to HOLD.
  396.  * PARAMETERS
  397.  *  MsgStruct               [?]         
  398.  *  ACTION_RESULT(?)        [OUT]       
  399.  *  this(?)                 [IN]        Points to CM_CALL_HANDLE of the call that requested CM_KB_SPLITREQ)
  400.  * RETURNS
  401.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  402.  *****************************************************************************/
  403. ACTION_RESULT ProcessPSSplitSucEvent(void *MsgStruct)
  404. {
  405.     /*----------------------------------------------------------------*/
  406.     /* Local Variables                                                */
  407.     /*----------------------------------------------------------------*/
  408.     /*----------------------------------------------------------------*/
  409.     /* Code Body                                                      */
  410.     /*----------------------------------------------------------------*/
  411.     switch (GetCurrentState())
  412.     {
  413.         case CM_IDLE_STATE:
  414.             PRINT_INFORMATION(("n PSSplitSucEvent CM_IDLE_STATE not handled still n"));
  415.             break;
  416.         case CM_OUTGOING_STATE:
  417.             PRINT_INFORMATION(("n PSSplitSucEvent CM_OUTGOING_STATE not handled still n"));
  418.             break;
  419.         case CM_INCOMING_STATE:
  420.         case CM_ACTIVE_STATE:
  421.             MakeSplitSucess();
  422.             EntryScr1010NotifySplitSucess();
  423.             break;
  424.         case CM_HOLD_STATE:
  425.             PRINT_INFORMATION(("n PSSplitSucEvent CM_HOLD_STATE not handled still n"));
  426.             break;
  427.         default:
  428.             PRINT_INFORMATION(("n PSSplitSucEvent CM State m/c Corrupted n"));
  429.             return CM_CALL_FAILURE;
  430.     }
  431.     return CM_CALL_SUCCESS;
  432. }
  433. /*****************************************************************************
  434.  * FUNCTION
  435.  *  ProcessKBEctReqEvent
  436.  * DESCRIPTION
  437.  *  This is the function to process Keyboard(Request) Event CM_KB_HANGUPREQ.
  438.  *  
  439.  *  This Sets the flag CM_HANGUP_REQUESTED and invoke the protocol function irrespective of the state.
  440.  *  The chances of this being invoked in idle state is very less.
  441.  * PARAMETERS
  442.  *  MsgStruct               [?]         
  443.  *  ACTION_RESULT(?)        [OUT]       
  444.  *  this(?)                 [IN]        Points to CM_CALL_HANDLE of the call to get dropped)
  445.  * RETURNS
  446.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  447.  *****************************************************************************/
  448. ACTION_RESULT ProcessKBEctReqEvent(void *MsgStruct)
  449. {
  450.     /*----------------------------------------------------------------*/
  451.     /* Local Variables                                                */
  452.     /*----------------------------------------------------------------*/
  453.     U8 flag;
  454.     /*----------------------------------------------------------------*/
  455.     /* Code Body                                                      */
  456.     /*----------------------------------------------------------------*/
  457.     flag = GetAllCallFlags();
  458.     if (((flag & CM_SWAP_REQUESTED) != 0) || 
  459.      ((flag & CM_CONF_REQUESTED) != 0) ||
  460.      ((flag & CM_ECT_REQUESTED) != 0))
  461.     {
  462.         return CM_CALL_FAILURE;
  463.     }
  464.     switch (GetCurrentState())
  465.     {
  466.         case CM_OUTGOING_STATE:
  467.             if (GetTotalActiveCallCount() == 1 || GetTotalHoldCallCount() == 1)
  468.             {
  469.                 S16 index;
  470.                 index = GetOutgoingCallIndex();
  471.                 if (index == -1)
  472.                 {
  473.                     break;
  474.                 }
  475.                 SetCallflag(index, CM_ECT_REQUESTED, FALSE);
  476.                 MakePsEctRequest();
  477.             }
  478.             else
  479.             {
  480.                 PRINT_INFORMATION(("n Not Enuf Calls to make transfer n"));
  481.             }
  482.             break;
  483.         case CM_INCOMING_STATE:
  484.         case CM_ACTIVE_STATE:
  485.         case CM_HOLD_STATE:
  486.             if (GetTotalActiveCallCount() == 1 && GetTotalHoldCallCount() == 1)
  487.             {
  488.                 S16 index;
  489.                 index = GetActiveCallIndex();
  490.                 if (index == -1)
  491.                 {
  492.                     break;
  493.                 }
  494.                 SetCallflag(index, CM_ECT_REQUESTED, FALSE);
  495.                 MakePsEctRequest();
  496.             }
  497.             else
  498.             {
  499.                 PRINT_INFORMATION(("n Not Enuf Calls to make transfer n"));
  500.             }
  501.             break;
  502.         default:
  503.             PRINT_INFORMATION(("n ECT Default does not exit n"));
  504.             return CM_CALL_FAILURE;
  505.     }
  506.     return CM_CALL_SUCCESS;
  507. }
  508. /*****************************************************************************
  509.  * FUNCTION
  510.  *  ProcessPSEctSuccessful
  511.  * DESCRIPTION
  512.  *  This is the function to process Protocol(Response) Event CM_PS_ECT_SUCCESS.
  513.  * PARAMETERS
  514.  *  MsgStruct               [?]         
  515.  *  ACTION_RESULT(?)        [OUT]       
  516.  * RETURNS
  517.  *  This returns CM_CALL_SUCCESS if success or CM_CALL_FAILURE if failure.
  518.  *****************************************************************************/
  519. ACTION_RESULT ProcessPSEctSuccessful(void *MsgStruct)
  520. {
  521.     /*----------------------------------------------------------------*/
  522.     /* Local Variables                                                */
  523.     /*----------------------------------------------------------------*/
  524.     U16 count;
  525.     /*----------------------------------------------------------------*/
  526.     /* Code Body                                                      */
  527.     /*----------------------------------------------------------------*/
  528.     PRINT_INFORMATION(("XXX - In ProcessPSEctSuccessful XXXn"));
  529.     /* only active mpty can be split */
  530.     for (count = 0; count < MAX_CALLS; count++)
  531.     {
  532.         if (cm_p->state_info.AllCalls[count].status_flag & CM_ECT_REQUESTED)
  533.         {
  534.             ResetCallflag(count, CM_ECT_REQUESTED, FALSE);
  535.         }
  536.     }
  537.     return CM_CALL_SUCCESS;
  538. }
  539. /*****************************************************************************
  540.  * FUNCTION
  541.  *  PsCBackCallDeflected
  542.  * DESCRIPTION
  543.  *  This function is called back by the protocol stack when the
  544.  *  Incoming Call is deflected
  545.  * PARAMETERS
  546.  *  info        [?]     
  547.  * RETURNS
  548.  *  void
  549.  *****************************************************************************/
  550. void PsCBackCallDeflected(void *info)
  551. {
  552.     /*----------------------------------------------------------------*/
  553.     /* Local Variables                                                */
  554.     /*----------------------------------------------------------------*/
  555.     U16 result;
  556.     /*----------------------------------------------------------------*/
  557.     /* Code Body                                                      */
  558.     /*----------------------------------------------------------------*/
  559.     if (CheckCallDeflectSuccess(info, &result))
  560.     {
  561.         PRINT_INFORMATION(("XXX - In PsCBackCallDeflected XXXn"));
  562.         OutgoingProcessCMEvent(CM_PS_INCOMING_CALL_DEFLECT, info);
  563.         /* ProcessIncomingEvents (CM_PS_INCOMING_CALL_DEFLECT, info); */
  564.     }
  565.     else
  566.     {
  567.         PRINT_INFORMATION(("XXX - FAILED FAILED FAILED In PsCBackCallDeflected XXXn"));
  568.         ProcessIncomingFailureEvents(CM_PS_INCOMING_CALL_DEFLECT, result);
  569.         DeleteUptoScrID(ITEMSCR_INCOMING_CALL);
  570.     }
  571. }
  572. /*****************************************************************************
  573.  * FUNCTION
  574.  *  EndSingleAndGoBack
  575.  * DESCRIPTION
  576.  *  This function display the list of active and held calls
  577.  *  to choose the call that needs to be ended.
  578.  * PARAMETERS
  579.  *  void
  580.  * RETURNS
  581.  *  void
  582.  *****************************************************************************/
  583. void EndSingleAndGoBack(void)
  584. {
  585.     /*----------------------------------------------------------------*/
  586.     /* Local Variables                                                */
  587.     /*----------------------------------------------------------------*/
  588.     S16 dummy;
  589.     /*----------------------------------------------------------------*/
  590.     /* Code Body                                                      */
  591.     /*----------------------------------------------------------------*/
  592.     gcallListlen = GetAllDispNameorNum(gcallList, gcallListImage, NULL, &dummy);
  593.     if (gcallListlen != GetTotalActiveCallCount() + GetTotalHoldCallCount())
  594.     {
  595.         PRINT_INFORMATION(("nFatal Error in CM Call Structure 4n"));
  596.     }
  597.     gListOperation = 1;
  598.     EntryScr1009CallListScreen();
  599. }
  600. /*****************************************************************************
  601.  * FUNCTION
  602.  *  EndSingleActiveAndGoBack
  603.  * DESCRIPTION
  604.  *  
  605.  * PARAMETERS
  606.  *  void
  607.  * RETURNS
  608.  *  void
  609.  *****************************************************************************/
  610. void EndSingleActiveAndGoBack(void)
  611. {
  612.     /*----------------------------------------------------------------*/
  613.     /* Local Variables                                                */
  614.     /*----------------------------------------------------------------*/
  615.     /*----------------------------------------------------------------*/
  616.     /* Code Body                                                      */
  617.     /*----------------------------------------------------------------*/
  618.     gcallListlen = GetAllActDispNameorNum(gcallList);
  619.     gListOperation = 1;
  620.     EntryScr1009CallListScreen();
  621. }
  622. /*****************************************************************************
  623.  * FUNCTION
  624.  *  SplitAndGoBack
  625.  * DESCRIPTION
  626.  *  This function display the list of active call
  627.  *  to choose the call that needs to be splitted.
  628.  * PARAMETERS
  629.  *  void
  630.  * RETURNS
  631.  *  void
  632.  *****************************************************************************/
  633. void SplitAndGoBack(void)
  634. {
  635.     /*----------------------------------------------------------------*/
  636.     /* Local Variables                                                */
  637.     /*----------------------------------------------------------------*/
  638.     /*----------------------------------------------------------------*/
  639.     /* Code Body                                                      */
  640.     /*----------------------------------------------------------------*/
  641.     gcallListlen = GetAllActDispNameorNum(gcallList);
  642.     if (gcallListlen != GetTotalActiveCallCount())
  643.     {
  644.         PRINT_INFORMATION(("nFatal Error in CM Call Structure 4n"));
  645.     }
  646.     gListOperation = 2;
  647.     EntryScr1009CallListScreen();
  648. }
  649. /*****************************************************************************
  650.  * FUNCTION
  651.  *  SetCurrHiliteCall
  652.  * DESCRIPTION
  653.  *  This is the hilite handler for the gcallList listview displayed.
  654.  *  
  655.  *  gHilitedCall will be updated by this function
  656.  * PARAMETERS
  657.  *  hiliteIndex     [IN]        
  658.  * RETURNS
  659.  *  void
  660.  *****************************************************************************/
  661. void SetCurrHiliteCall(S32 hiliteIndex)
  662. {
  663.     /*----------------------------------------------------------------*/
  664.     /* Local Variables                                                */
  665.     /*----------------------------------------------------------------*/
  666. CM_CALL_HANDLE temp;
  667.     S16 index;
  668.     /*----------------------------------------------------------------*/
  669.     /* Code Body                                                      */
  670.     /*----------------------------------------------------------------*/
  671.     gHilitedCall = (U16) hiliteIndex;
  672.     temp = GetCallHandle(gcallList[gHilitedCall]);
  673.     if (temp > 0)
  674.     {
  675. Cat19UpdateDuration(GetCallStartTime (temp));
  676.     }
  677. }
  678. /*****************************************************************************
  679.  * FUNCTION
  680.  *  GetCurrStartCallTime
  681.  * DESCRIPTION
  682.  *  
  683.  * PARAMETERS
  684.  *  void
  685.  * RETURNS
  686.  *  
  687.  *****************************************************************************/
  688. MYTIME *GetCurrStartCallTime(void)
  689. {
  690.     /*----------------------------------------------------------------*/
  691.     /* Local Variables                                                */
  692.     /*----------------------------------------------------------------*/
  693. CM_CALL_HANDLE temp;
  694.     
  695.     /*----------------------------------------------------------------*/
  696.     /* Code Body                                                      */
  697.     /*----------------------------------------------------------------*/
  698.     temp = GetCallHandle(gcallList[gHilitedCall]);
  699.     if (temp > 0)
  700.     {
  701. return GetCallStartTime (temp);
  702. }
  703.     return NULL;
  704. }
  705. /*****************************************************************************
  706.  * FUNCTION
  707.  *  HangupHilited
  708.  * DESCRIPTION
  709.  *  Hangup the selected or hilted call
  710.  *  
  711.  *  this function converts the index to callhandle
  712.  *  and invoke the hangup
  713.  * PARAMETERS
  714.  *  void
  715.  * RETURNS
  716.  *  void
  717.  *****************************************************************************/
  718. void HangupHilited(void)
  719. {
  720.     /*----------------------------------------------------------------*/
  721.     /* Local Variables                                                */
  722.     /*----------------------------------------------------------------*/
  723.     CM_CALL_HANDLE temp;
  724.     /*----------------------------------------------------------------*/
  725.     /* Code Body                                                      */
  726.     /*----------------------------------------------------------------*/
  727.     temp = GetCallHandle(gcallList[gHilitedCall]);
  728.     HangupCall(temp);
  729. }
  730. /*****************************************************************************
  731.  * FUNCTION
  732.  *  SplitHilited
  733.  * DESCRIPTION
  734.  *  Split the selected or hilted call
  735.  *  
  736.  *  this function converts the index to callhandle
  737.  *  and invoke the Splitcall
  738.  * PARAMETERS
  739.  *  void
  740.  * RETURNS
  741.  *  void
  742.  *****************************************************************************/
  743. void SplitHilited(void)
  744. {
  745.     /*----------------------------------------------------------------*/
  746.     /* Local Variables                                                */
  747.     /*----------------------------------------------------------------*/
  748.     CM_CALL_HANDLE temp;
  749.     /*----------------------------------------------------------------*/
  750.     /* Code Body                                                      */
  751.     /*----------------------------------------------------------------*/
  752.     temp = GetCallHandle(gcallList[gHilitedCall]);
  753.     SplitCall(temp);
  754. }
  755. /*****************************************************************************
  756.  * FUNCTION
  757.  *  EntryScr1009CallListScreen
  758.  * DESCRIPTION
  759.  *  display the list of strings stored by gcallList
  760.  *  
  761.  *  The gcallList can contain the list of active or held calls
  762.  *  depending on the scenario the LSK operation is also depending on
  763.  *  gListOperation.If gListOperation==1 then operation is HANGUP request.
  764.  *  If gListOperation==2 then the operation is SPLIT.
  765.  * PARAMETERS
  766.  *  void
  767.  *  gListOperation(?)       [IN]        GcallList,gcallListlen global variables filled by other function
  768.  * RETURNS
  769.  *  void
  770.  *****************************************************************************/
  771. void EntryScr1009CallListScreen(void)
  772. {
  773.     /*----------------------------------------------------------------*/
  774.     /* Local Variables                                                */
  775.     /*----------------------------------------------------------------*/
  776.     U8 *guiBuffer;
  777.     /*----------------------------------------------------------------*/
  778.     /* Code Body                                                      */
  779.     /*----------------------------------------------------------------*/
  780.     EntryNewScreen(SCR1009_CM_CALLLISTSCREEN, NULL, EntryScr1009CallListScreen, NULL);
  781.     guiBuffer = GetCurrGuiBuffer(SCR1009_CM_CALLLISTSCREEN);
  782.     SetParentHandler(0);
  783.     RegisterHighlightHandler(SetCurrHiliteCall);
  784.     ShowCategory6Screen(
  785.         STR_SCR1009_CAPTION,
  786.         IMG_SCR1009_CAPTION,
  787.         STR_GLOBAL_OK,
  788.         IMG_GLOBAL_OK,
  789.         STR_GLOBAL_BACK,
  790.         IMG_GLOBAL_BACK,
  791.         gcallListlen,
  792.         gcallList,
  793.         NULL,
  794.         0,
  795.         guiBuffer);
  796.     if (gListOperation == 1)
  797.     {
  798.         SetLeftSoftkeyFunction(HangupHilited, KEY_EVENT_UP);
  799.     }
  800.     else if (gListOperation == 2)
  801.     {
  802.         SetLeftSoftkeyFunction(SplitHilited, KEY_EVENT_UP);
  803.     }
  804.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  805.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  806. }
  807. /*****************************************************************************
  808.  * FUNCTION
  809.  *  EntryScr1001OutgoingCall
  810.  * DESCRIPTION
  811.  *  Shows the outgoing call screen
  812.  *  
  813.  *  This is invoked whenever the User requests for a outgoing call.
  814.  * PARAMETERS
  815.  *  void
  816.  * RETURNS
  817.  *  void
  818.  *****************************************************************************/
  819. void EntryScr1001OutgoingCall(void)
  820. {
  821.     /*----------------------------------------------------------------*/
  822.     /* Local Variables                                                */
  823.     /*----------------------------------------------------------------*/
  824.     PU8 dispname;
  825.     /* PU8 guiBuffer; */
  826.     S8 *imgPath = NULL;
  827.     U8 *IPNum = NULL;
  828.     U16 nOutGoingImgId = 0;
  829.     PHB_CM_INTERFACE *PhoneNumberStruct;
  830.     /*----------------------------------------------------------------*/
  831.     /* Code Body                                                      */
  832.     /*----------------------------------------------------------------*/
  833.     PRINT_INFORMATION(("*** In EntryScr1001OutgoingCall n"));
  834.     TurnOnBacklight(1);
  835.     SetCbackAfterSS(NULL);
  836.     SetAbortCallRequestedFlag(FALSE);
  837.     SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
  838.     SetCMScrnFlag(TRUE);
  839.     dispname = GetDispNameorNum();
  840.     EntryNewScreen(SCR1001_CM_OUTGOINGCALLSCREEN, ExitScr1001OutgoingCall, NULL, NULL);
  841.     /* guiBuffer = GetCurrGuiBuffer(SCR1001_CM_OUTGOINGCALLSCREEN); */
  842.     PhoneNumberStruct = GetCMPhoneBookStruct();
  843.     nOutGoingImgId = PhoneNumberStruct->pictureId;
  844.     if (nOutGoingImgId == IMG_PHB_DEFAULT)
  845.     {
  846.         nOutGoingImgId = IMG_CM_STATE_OUTGOING;
  847.     }
  848.     UnicodeToAnsii((PS8) subMenuDataPtrs[0], (PS8) PhoneNumberStruct->name);
  849.     UnicodeToAnsii((PS8) subMenuDataPtrs[1], (PS8) PhoneNumberStruct->number);
  850.     UnicodeToAnsii((PS8) subMenuDataPtrs[2], (PS8) dispname);
  851.     PRINT_INFORMATION(("*** In EntryScr1001OutgoingCall, name=%s, number=%sn", subMenuDataPtrs[0],
  852.                        subMenuDataPtrs[1]));
  853.     PRINT_INFORMATION(("*** In EntryScr1001OutgoingCall, display name=%sn", subMenuDataPtrs[2]));
  854. #if defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__)
  855.     if (nOutGoingImgId == 1)
  856.     {
  857.         /* use file image */
  858.         imgPath = mmi_phb_image_get_path_from_id(PhoneNumberStruct->record_index);
  859.         if (imgPath == NULL)
  860.         {
  861.             nOutGoingImgId = IMG_CM_STATE_OUTGOING;
  862.         }
  863.     }
  864. #endif /* defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__) */ 
  865.     /* if(nOutGoingImgId==IMG_PHB_DEFAULT || ((nOutGoingImgId == 1) && imgPath == NULL))
  866.        nOutGoingImgId=GetImgIdofState(CM_OUTGOING_STATE); //needs to be changed later. */
  867.     /* Start by Julia: Drop call refinement */
  868.     /* if (GetDisconnectingCallHandle() != -1)
  869.        nOutGoingImgId=GetImgIdofState(CM_DISCONNECTING_STATE); */
  870.     /* End by Julia */
  871. #ifdef __IP_NUMBER__
  872.     if (GetTempUseIPNumber() == TRUE)
  873.     {
  874.         IPNum = (U8*) GetCurrIPNumberUCS2();
  875.     }
  876. #endif /* __IP_NUMBER__ */ 
  877.     if (GetTotalCallCount() > 1)
  878.     {
  879.         /* more than one call */
  880.         /* Start by Julia: Drop call refinement */
  881.         if (GetDisconnectingCallHandle() != -1)
  882.         {
  883.             if (nOutGoingImgId == 1)
  884.             {
  885.                 ShowCategory18Screen(
  886.                     0,
  887.                     0,
  888.                     0,
  889.                     0,
  890.                     0,
  891.                     STR_SCR1001_RUNNING,
  892.                     dispname,
  893.                     IPNum,
  894. 0,
  895.                     IMG_CM_STATE_OUTGOING,
  896.                     imgPath,
  897.                     TRUE,
  898.                     NULL);
  899.             }
  900.             else
  901.             {
  902.                 ShowCategory18Screen(
  903.                     0,
  904.                     0,
  905.                     0,
  906.                     0,
  907.                     0,
  908.                     STR_SCR1001_RUNNING,
  909.                     dispname,
  910.                     IPNum,
  911. 0,
  912.                     nOutGoingImgId,
  913.                     NULL,
  914.                     TRUE,
  915.                     NULL);
  916.             }
  917.         }
  918.         else
  919.             /* End by Julia */
  920.         {
  921.             if (nOutGoingImgId == 1)
  922.             {
  923.                 ShowCategory18Screen(
  924.                     0,
  925.                     STR_GLOBAL_OPTIONS,
  926.                     IMG_SCR1001_LSK,
  927.                     STR_GLOBAL_ABORT,
  928.                     IMG_SCR1001_RSK,
  929.                     STR_SCR1001_RUNNING,
  930.                     dispname,
  931.                     IPNum,
  932. 0,
  933.                     IMG_CM_STATE_OUTGOING,
  934.                     imgPath,
  935.                     FALSE,
  936.                     NULL);
  937.             }
  938.             else
  939.             {
  940.                 ShowCategory18Screen(
  941.                     0,
  942.                     STR_GLOBAL_OPTIONS,
  943.                     IMG_SCR1001_LSK,
  944.                     STR_GLOBAL_ABORT,
  945.                     IMG_SCR1001_RSK,
  946.                     STR_SCR1001_RUNNING,
  947.                     dispname,
  948.                     IPNum,
  949. 0,
  950.                     nOutGoingImgId,
  951.                     NULL,
  952.                     FALSE,
  953.                     NULL);
  954.             }
  955.         }
  956.         /* Start by Julia: Drop call refinement */
  957.         if (GetDisconnectingCallHandle() != -1)
  958.         {
  959.             SetKeyHandler(ReleaseCall, KEY_END, KEY_EVENT_DOWN);
  960.             return;
  961.         }
  962.         else
  963.             /* End by Julia */
  964.         {
  965.             SetLeftSoftkeyFunction(EntryScrOutgoingMultipleOptions, KEY_EVENT_UP);
  966.             SetRightSoftkeyFunction(DropRequest, KEY_EVENT_UP);
  967.             SetKeyHandler(HangupAll, KEY_END, KEY_EVENT_DOWN);
  968.         }
  969.         if (!EmergencyCallPresent())
  970.         {
  971.             SetGroupKeyHandler(
  972.                 EnterScreenAndHandleDigit,
  973.                 (PU16) CMIdleScreenDigits,
  974.                 MAX_CM_SCREEN_DIGITS - 1,
  975.                 KEY_EVENT_DOWN);
  976.         }
  977.     }
  978.     else
  979.     {
  980.         /* only one call */
  981.         /* Start by Julia: Drop call refinement */
  982.         if (GetDisconnectingCallHandle() != -1)
  983.         {
  984.             if (nOutGoingImgId == 1)
  985.             {
  986.                 ShowCategory18Screen(
  987.                     0,
  988.                     0,
  989.                     0,
  990.                     0,
  991.                     0,
  992.                     STR_SCR1001_RUNNING,
  993.                     dispname,
  994.                     IPNum,
  995. 0,
  996.                     IMG_CM_STATE_OUTGOING,
  997.                     imgPath,
  998.                     TRUE,
  999.                     NULL);
  1000.             }
  1001.             else
  1002.             {
  1003.                 ShowCategory18Screen(
  1004.                     0,
  1005.                     0,
  1006.                     0,
  1007.                     0,
  1008.                     0,
  1009.                     STR_SCR1001_RUNNING,
  1010.                     dispname,
  1011.                     IPNum,
  1012. 0,
  1013.                     nOutGoingImgId,
  1014.                     NULL,
  1015.                     TRUE,
  1016.                     NULL);
  1017.             }
  1018.         }
  1019.         else
  1020.         {
  1021.             /* End by Julia */
  1022.             if (nOutGoingImgId == 1)
  1023.             {
  1024.                 ShowCategory18Screen(
  1025.                     0,
  1026.                     0,
  1027.                     0,
  1028.                     STR_GLOBAL_ABORT,
  1029.                     IMG_SCR1001_RSK,
  1030.                     STR_SCR1001_RUNNING,
  1031.                     dispname,
  1032.                     IPNum,
  1033. 0,
  1034.                     IMG_CM_STATE_OUTGOING,
  1035.                     imgPath,
  1036.                     FALSE,
  1037.                     NULL);
  1038.             }
  1039.             else
  1040.             {
  1041.                 ShowCategory18Screen(
  1042.                     0,
  1043.                     0,
  1044.                     0,
  1045.                     STR_GLOBAL_ABORT,
  1046.                     IMG_SCR1001_RSK,
  1047.                     STR_SCR1001_RUNNING,
  1048.                     dispname,
  1049.                     IPNum,
  1050. 0,
  1051.                     nOutGoingImgId,
  1052.                     NULL,
  1053.                     FALSE,
  1054.                     NULL);
  1055.             }
  1056.         }
  1057.         /* Start by Julia: Drop call refinement */
  1058.         if (GetDisconnectingCallHandle() != -1)
  1059.         {
  1060.             SetKeyHandler(ReleaseCall, KEY_END, KEY_EVENT_DOWN);
  1061.             return;
  1062.         }
  1063.         else
  1064.             /* End by Julia */
  1065.         {
  1066.             SetRightSoftkeyFunction(DropRequest, KEY_EVENT_UP);
  1067.             SetKeyHandler(DropRequest, KEY_END, KEY_EVENT_DOWN);
  1068.         }
  1069.         if (GetSpeechFlag())
  1070.         {
  1071.             SetGroupKeyHandler(
  1072.                 EnterScreenAndHandleDigit,
  1073.                 (PU16) CMIdleScreenDigits,
  1074.                 MAX_CM_SCREEN_DIGITS - 1,
  1075.                 KEY_EVENT_DOWN);
  1076. #if ( (defined  __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__) && !(defined __MMI_TOUCH_IDLESCREEN_SHORTCUTS__))    /* PMT MANISH   20050623 */
  1077.      EnableCenterSoftkey(0, IMG_CSK_DIAL_ICON);
  1078.             SetCenterSoftkeyFunction(EnterScreenAndHandleDigit, KEY_EVENT_UP);
  1079.      redraw_center_softkey();    
  1080. #endif
  1081.         }
  1082.     }
  1083.     gdispnameForSubLCD = dispname;
  1084.     ShowSubLCDScreen(EntrySubLcdScr1001OutgoingCall);
  1085. }
  1086. /*****************************************************************************
  1087.  * FUNCTION
  1088.  *  ExitScr1001OutgoingCall
  1089.  * DESCRIPTION
  1090.  *  Typical exit screen to add the history variable of the screen.
  1091.  *  
  1092.  *  Updates the history variables of the screen.
  1093.  * PARAMETERS
  1094.  *  void
  1095.  * RETURNS
  1096.  *  void
  1097.  *****************************************************************************/
  1098. void ExitScr1001OutgoingCall(void)
  1099. {
  1100.     /*----------------------------------------------------------------*/
  1101.     /* Local Variables                                                */
  1102.     /*----------------------------------------------------------------*/
  1103.     /*----------------------------------------------------------------*/
  1104.     /* Code Body                                                      */
  1105.     /*----------------------------------------------------------------*/
  1106.     if (GetCurrentState() == CM_OUTGOING_STATE)
  1107.     {
  1108.         history Scr1001;
  1109.         S16 nHistory = 0;
  1110.         Scr1001.scrnID = SCR1001_CM_OUTGOINGCALLSCREEN;
  1111.         Scr1001.entryFuncPtr = EntryScr1001OutgoingCall;
  1112.         pfnUnicodeStrcpy((S8*) Scr1001.inputBuffer, (S8*) & nHistory);
  1113.         GetCategoryHistory(Scr1001.guiBuffer);
  1114.         AddHistory(Scr1001);
  1115.     }
  1116. #if ( (defined  __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__) && !(defined __MMI_TOUCH_IDLESCREEN_SHORTCUTS__))    /* PMT MANISH   20050623 */
  1117. ResetCenterSoftkey();
  1118. #endif
  1119. }
  1120. /*****************************************************************************
  1121.  * FUNCTION
  1122.  *  EntrySubLcdScr1001OutgoingCall
  1123.  * DESCRIPTION
  1124.  *  Entry screen for Sub Lcd OutGoing Call
  1125.  * PARAMETERS
  1126.  *  void
  1127.  * RETURNS
  1128.  *  void
  1129.  *****************************************************************************/
  1130. void EntrySubLcdScr1001OutgoingCall(void)
  1131. {
  1132.     /*----------------------------------------------------------------*/
  1133.     /* Local Variables                                                */
  1134.     /*----------------------------------------------------------------*/
  1135.     /*----------------------------------------------------------------*/
  1136.     /* Code Body                                                      */
  1137.     /*----------------------------------------------------------------*/
  1138.     ExecSubLCDCurrExitHandler();
  1139.     ShowCategory311Screen(gdispnameForSubLCD, IMG_CM_SUBLCD_CALLING, NULL);
  1140.     SetSubLCDExitHandler(ExitSubLcdScr1001OutgoingCall);
  1141. }
  1142. /*****************************************************************************
  1143.  * FUNCTION
  1144.  *  ExitSubLcdScr1001OutgoingCall
  1145.  * DESCRIPTION
  1146.  *  Exit Handler for Sub Lcd OutGoing Call Screen
  1147.  * PARAMETERS
  1148.  *  void
  1149.  * RETURNS
  1150.  *  void
  1151.  *****************************************************************************/
  1152. void ExitSubLcdScr1001OutgoingCall(void)
  1153. {
  1154.     /*----------------------------------------------------------------*/
  1155.     /* Local Variables                                                */
  1156.     /*----------------------------------------------------------------*/
  1157.     /*----------------------------------------------------------------*/
  1158.     /* Code Body                                                      */
  1159.     /*----------------------------------------------------------------*/
  1160.     if (GetCurrentState() == CM_OUTGOING_STATE && !IsSubLCDScreenPresent(SUB_LCD_SCR1001_CM_OUTGOINGCALLSCREEN))
  1161.     {
  1162.         SubLCDHistoryNode SubLCDHistory;
  1163.         SubLCDHistory.entryFuncPtr = EntrySubLcdScr1001OutgoingCall;
  1164.         AddSubLCDHistoryWithScrID(&SubLCDHistory, SUB_LCD_SCR1001_CM_OUTGOINGCALLSCREEN);
  1165.     }
  1166. }
  1167. /*****************************************************************************
  1168.  * FUNCTION
  1169.  *  EntryScrOutgoingMultipleOptions
  1170.  * DESCRIPTION
  1171.  *  This function is the entry screen for the outgoing call
  1172.  *  option menu when there are more than one calls
  1173.  * PARAMETERS
  1174.  *  void
  1175.  * RETURNS
  1176.  *  void
  1177.  *****************************************************************************/
  1178. void EntryScrOutgoingMultipleOptions(void)
  1179. {
  1180.     /*----------------------------------------------------------------*/
  1181.     /* Local Variables                                                */
  1182.     /*----------------------------------------------------------------*/
  1183.     U8 *guiBuffer;
  1184.     static U8 *PopUpList[10];
  1185.     U16 nNumofItem;         /* Stores no of children in the submenu */
  1186.     U16 nStrItemList[10];   /* Stores the strings id of submenus returned */
  1187.     U16 menuId;
  1188.     S16 nActiveCall;
  1189.     U16 nHeldCall;
  1190.     /*----------------------------------------------------------------*/
  1191.     /* Code Body                                                      */
  1192.     /*----------------------------------------------------------------*/
  1193.     nActiveCall = GetTotalActiveCallCount();
  1194.     nHeldCall = GetTotalHoldCallCount();
  1195.     if (GetIncomingCallHandle() == -1)
  1196.     {
  1197.         /* no waiting call */
  1198.         if (nActiveCall == 1 && nHeldCall == 0)
  1199.         {
  1200.             menuId = MITEM2008_CM_WAIT_ACT_LSKOPTIONS;
  1201.         }
  1202.         else if (nActiveCall == 0 && nHeldCall == 1)
  1203.         {
  1204.             menuId = MITEM2008_CM_WAIT_S_HOLD_LSKOPTIONS;
  1205.         }
  1206.         else if (nActiveCall > 1 && nHeldCall == 0)
  1207.         {
  1208.             menuId = MITEM2008_CM_WAIT_MACT_LSKOPTIONS;
  1209.         }
  1210.         else if (nActiveCall == 0 && nHeldCall > 1)
  1211.         {
  1212.             menuId = MITEM2008_CM_WAIT_M_HOLD_LSKOPTIONS;
  1213.         }
  1214.         else
  1215.         {
  1216.             return;
  1217.         }
  1218.     }
  1219.     else
  1220.     {
  1221.         /* waiting call present */
  1222.         if (nActiveCall == 1 && nHeldCall == 0)
  1223.         {
  1224.             menuId = MITEM2008_CM_INC_ACT_LSKOPTIONS;
  1225.         }
  1226.         else if (nActiveCall == 0 && nHeldCall == 1)
  1227.         {
  1228.             menuId = MITEM2008_CM_INC_S_HOLD_LSKOPTIONS;
  1229.         }
  1230.         else if (nActiveCall > 1 && nHeldCall == 0)
  1231.         {
  1232.             menuId = MITEM2008_CM_INC_MACT_LSKOPTIONS;
  1233.         }
  1234.         else if (nActiveCall == 0 && nHeldCall > 1)
  1235.         {
  1236.             menuId = MITEM2008_CM_INC_M_HOLD_LSKOPTIONS;
  1237.         }
  1238.         else
  1239.         {
  1240.          /* 1 MO + 1 waiting */
  1241.          menuId = MITEM2008_CM_INC_LSKOPTIONS;
  1242.         }
  1243.     }
  1244.     EntryNewScreen(ITEM_SCR_OUT_WAIT_HOLD_OPN, NULL, EntryScrOutgoingMultipleOptions, NULL);
  1245.     SetCMScrnFlag(TRUE);
  1246.     guiBuffer = GetCurrGuiBuffer(ITEM_SCR_OUT_WAIT_HOLD_OPN);
  1247.     SetParentHandler(menuId);
  1248.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1249.     nNumofItem = GetNumOfChild(menuId);
  1250.     GetSequenceStringIds(menuId, nStrItemList);
  1251.     ConstructHintsList(menuId, PopUpList);
  1252.     ShowCategory55Screen(
  1253.         STR_SCR1002_CAPTION,
  1254.         IMG_SCR1002_CAPTION,
  1255.         STR_GLOBAL_OK,
  1256.         IMG_GLOBAL_OK,
  1257.         STR_GLOBAL_BACK,
  1258.         IMG_GLOBAL_BACK,
  1259.         nNumofItem,
  1260.         nStrItemList,
  1261.         (U8 **) PopUpList,
  1262.         0,
  1263.         guiBuffer);
  1264.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1265.     SetKeyHandler(HangupAll, KEY_END, KEY_EVENT_DOWN);
  1266.     SetSideVolumeKeysForCM();
  1267.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1268. }
  1269. /*****************************************************************************
  1270.  * FUNCTION
  1271.  *  EntryScr1002ActiveCall
  1272.  * DESCRIPTION
  1273.  *  This displays the list of active/Held calls or the single active/held call.
  1274.  *  
  1275.  *  This is the sort of base screen after processing the response events.
  1276.  * PARAMETERS
  1277.  *  void
  1278.  * RETURNS
  1279.  *  void
  1280.  *****************************************************************************/
  1281. void EntryScr1002ActiveCall(void)
  1282. {
  1283.     /*----------------------------------------------------------------*/
  1284.     /* Local Variables                                                */
  1285.     /*----------------------------------------------------------------*/
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Code Body                                                      */
  1288.     /*----------------------------------------------------------------*/
  1289.     SetCbackAfterSS(NULL);
  1290.     if (GetNotifySSFlag())
  1291.     {
  1292.         PRINT_INFORMATION((" XXX EntryScr1002ActiveCall: Notify Flag Set XXXn"));
  1293.         /* between call connected (MO or MT) and get time rsp to show active call screen, 
  1294.            if the call is dropped, we stilll need to log the call as connected. */
  1295.         if (GetCallHandleForStartTimeUpdate())
  1296.         {
  1297.             MYTIME t;
  1298.             DTGetRTCTime(&t);
  1299.             UpdateCallStartTimeAndLogCall(GetCallHandleForStartTimeUpdate(), &t);
  1300.             SetCallHandleForStartTimeUpdate(0);
  1301.         }
  1302.         SetCbackAfterSS((FuncPtr) EntryScr1002ActiveCall);
  1303.         return;
  1304.     }
  1305. #ifdef __CTM_SUPPORT__
  1306.     if (ctm_p->state == MMI_CTM_STATE_CONNECTED)
  1307.     {
  1308.         entry_ctm_talking();
  1309.         return;
  1310.     }
  1311. #endif /* __CTM_SUPPORT__ */ 
  1312.     if (GetExitScrnID() != SCR_CM_ACTIVECALLSCREEN)
  1313.     {
  1314.         EntryNewScreen(SCR_CM_ACTIVECALLSCREEN, NULL, NULL, NULL);
  1315.         ShowCategoryDummyScreen();
  1316.     }
  1317.     ReplaceNewScreenHandler(SCR_CM_ACTIVECALLSCREEN, NULL, EntryScr1002ActiveCall);
  1318.     SetTransitionToActiveFlag(TRUE);
  1319. #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
  1320.     if (is_redrawing_old_screens())
  1321.     {
  1322.         MYTIME curtime;
  1323.         DTGetRTCTime(&curtime);
  1324.         DummyScr1002ActiveCall(&curtime);
  1325.     }
  1326.     else
  1327. #endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */ 
  1328.         CMGetExactTime(DummyScr1002ActiveCall);
  1329. }
  1330. //jerson add begin 20070622
  1331. #ifdef  __MMI_ONEKEY_SNDREC_SUPPORT__
  1332. extern void DummyEntrySoundRecorderInCall(void);
  1333. #endif
  1334. //jerson add end 20070622
  1335. /*****************************************************************************
  1336.  * FUNCTION
  1337.  *  DummyScr1002ActiveCall
  1338.  * DESCRIPTION
  1339.  *  This is a dummy function for EntryScr1002ActiveCall()
  1340.  *  this is made because of asynchronous CMGetExactTime
  1341.  *  
  1342.  *  This is the sort of base screen after processing the
  1343.  *  response events.
  1344.  * PARAMETERS
  1345.  *  t       [?]     
  1346.  * RETURNS
  1347.  *  void
  1348.  *****************************************************************************/
  1349. void DummyScr1002ActiveCall(MYTIME *t)
  1350. {
  1351.     /*----------------------------------------------------------------*/
  1352.     /* Local Variables                                                */
  1353.     /*----------------------------------------------------------------*/
  1354.     TIMEANDINDEX timeStruct;
  1355.     U8 *guiBuffer;
  1356.     PU8 strDispnames[MAX_CALLS];
  1357.     U16 nImgIds[MAX_CALLS];
  1358.     U16 nIconIds[MAX_CALLS];
  1359.     U16 nRskStringId = 0, nLskStringId = 0;
  1360.     U16 nRskImgId = 0;
  1361.     S16 firstActiveCallIndex;
  1362.     S16 nActiveCall = 0;
  1363.     U16 nHoldCall = 0;
  1364.     U8 type = 255;
  1365.     U8 nAllcall;
  1366. #ifdef __GPRS_MODE__
  1367.     S16 dummy;
  1368. #endif 
  1369.     /*----------------------------------------------------------------*/
  1370.     /* Code Body                                                      */
  1371.     /*----------------------------------------------------------------*/
  1372.     PRINT_INFORMATION(("*** In EntryScr1002ActiveCalln"));
  1373.     SetTransitionToActiveFlag(FALSE);
  1374.     /* Start by Julia: Drop call refinement */
  1375.     /* CMScrnFlag will be FALSE if CM screen is covered with other application. 
  1376.        If it is the case, don't set back to TRUE for disconnecting process. */
  1377.     //SetCMScrnFlag(TRUE);
  1378.     // End by Julia
  1379.     /* between call connected (MO or MT) and get time rsp to show active call screen, 
  1380.        if the call is dropped, we stilll need to log the call as connected. */
  1381.     if (GetCallHandleForStartTimeUpdate())
  1382.     {
  1383.         UpdateCallStartTimeAndLogCall(GetCallHandleForStartTimeUpdate(), t);
  1384.         SetCallHandleForStartTimeUpdate(0);
  1385.     }
  1386.     nActiveCall = GetTotalActiveCallCount();
  1387.     nHoldCall = GetTotalHoldCallCount();
  1388.     if (nActiveCall + nHoldCall == 0)
  1389.     {
  1390.         GetOutOfCMApplication();
  1391.         return;
  1392.     }
  1393.     if (GetCurrentState() == CM_INCOMING_STATE)
  1394.     {
  1395.         return;
  1396.     }
  1397.     if (GetExitScrnID() != SCR_CM_ACTIVECALLSCREEN)
  1398.     {
  1399.         EntryNewScreen(SCR_CM_ACTIVECALLSCREEN, NULL, EntryScr1002ActiveCall, NULL);
  1400.     }
  1401.     else
  1402.     {
  1403.         ExitCategoryFunction();
  1404.     }
  1405.     ShowSubLCDScreen(EntrySubLcdScr1002ActiveCall);
  1406.     /* SS presnt, don't show active call, restore SS screen */
  1407.     if (EmergencyCallPresent())
  1408.     {
  1409. DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
  1410.     }
  1411.     else if (IsScreenPresent(ITEM_SCR_USSN_MSG) || IsScreenPresent(SCR_CM_REQUESTINGUSSD))
  1412.     {
  1413.         ResumeSSScrInCall();
  1414.         SetCMScrnFlag(FALSE);
  1415.         return;
  1416.     }
  1417.     SetCMScrnFlag(TRUE);
  1418.     SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
  1419.     guiBuffer = GetCurrGuiBuffer(SCR_CM_ACTIVECALLSCREEN);
  1420.     RegisterHighlightHandler(SetCurrHiliteCall);
  1421. memset (nIconIds, 0, sizeof (nIconIds));
  1422. #ifdef __GPRS_MODE__
  1423.     gcallListlen = GetAllDispNameorNum(gcallList, gcallListImage, nIconIds, &dummy);
  1424. #endif /* __GPRS_MODE__ */ 
  1425.     nAllcall = GetAllDispNameorNum(strDispnames, nImgIds, nIconIds, &firstActiveCallIndex);
  1426.     if (nAllcall != nActiveCall + nHoldCall)
  1427.     {
  1428.         PRINT_INFORMATION(("nFatal Error in CM Call Structure 1n"));
  1429.     }
  1430.     PRINT_INFORMATION(("n Active Calls = %d Hold calls = %d GetTotalCallCount = %d", nActiveCall, nHoldCall,
  1431.                        GetTotalCallCount()));
  1432.     /* Start by Julia: Drop call refinement */
  1433.     if (GetDisconnectingCallHandle() == -1)
  1434.     {
  1435.         /* no call in disconnecting state */
  1436.         if ((mmi_bootup_is_sim_valid() == MMI_TRUE && EmergencyCallPresent() == FALSE) &&
  1437.             mmi_bootup_is_in_power_on_period() == MMI_FALSE)
  1438.         {
  1439.             nLskStringId = STR_GLOBAL_OPTIONS;
  1440.         }
  1441.         else
  1442.         {
  1443.             nLskStringId = 0;
  1444.         }
  1445.         if (GetLSpkNowOff())
  1446.         {
  1447.             SetLSpkNowOff(FALSE);
  1448.             StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT - 1000, EntryScrLoudSpNotifyScreen);
  1449.         }
  1450.         if (GetTotalActiveCallCount() > 0)
  1451.         {
  1452.             if (LoudSpeaker() != FALSE) /* Loud Speaker is ON, to show H-Held */
  1453.             {
  1454.                 SetHFreeHeld(TRUE);
  1455.             }
  1456.             else
  1457.             {
  1458.                 SetHFreeHeld(FALSE);
  1459.             }
  1460. //KP Jerry modify on 2007-4-9 start
  1461. #ifndef __MMI_HAND_FREE_FUNC_DISABLE__
  1462.         #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
  1463.             if ( /* mmi_bt_is_aud2hf() != MMI_TRUE */ mmi_bt_is_incall_aud_swap2bt() != MMI_TRUE)
  1464.         #endif 
  1465.             {
  1466.                 nRskImgId = IMG_SCR1002_LOUDSP_RSK;
  1467.                 nRskStringId = GetHFreeHeld()? STR_SCR1002_LOUDSP_H_HELD_RSK : STR_SCR1002_LOUDSP_H_FREE_RSK;
  1468.             }
  1469. #else/*__MMI_HAND_FREE_FUNC_DISABLE__*/
  1470. nRskStringId=STR_MITEM_INC_ACT_OPT_END_ACT;
  1471. #endif/*__MMI_HAND_FREE_FUNC_DISABLE__*/
  1472. //KP Jerry modify on 2007-4-9 end
  1473.         }
  1474.     }
  1475.     /* End by Julia */
  1476.     InitializeTimeStructure(&timeStruct, t);
  1477. #ifndef DISABLE_CM_MACROS
  1478.     PRINT_INFORMATION(("Time 2 category is - "));
  1479.     PRINT_INFORMATION(("%d yearn", timeStruct.time.nYear));
  1480.     PRINT_INFORMATION(("%d monthn", timeStruct.time.nMonth));
  1481.     PRINT_INFORMATION(("%d dayn", timeStruct.time.nDay));
  1482.     PRINT_INFORMATION(("%d hourn", timeStruct.time.nHour));
  1483.     PRINT_INFORMATION(("%d minuten", timeStruct.time.nMin));
  1484.     PRINT_INFORMATION(("%d secondn", timeStruct.time.nSec));
  1485. #endif /* DISABLE_CM_MACROS */ 
  1486.     SetParentHandler(0);
  1487.     if ((nActiveCall + nHoldCall) > 1)
  1488.     {
  1489.         /* Start by Julia: Drop call refinement */
  1490.         /* some call is in disconnecting state */
  1491.         if (GetDisconnectingCallHandle() != -1)
  1492.         {
  1493.             ShowCategory19Screen(
  1494.                 0,
  1495.                 0,
  1496.                 0,
  1497.                 0,
  1498.                 nAllcall,
  1499.                 strDispnames,
  1500. nIconIds,
  1501.                 nImgIds,
  1502.                 (UI_time*) & timeStruct.time,
  1503.                 firstActiveCallIndex,
  1504.                 guiBuffer);
  1505.         }
  1506.         else    /* no call in disconnecting state */
  1507.             /* End by Julia */
  1508.         {
  1509.             ShowCategory19Screen(
  1510.                 nLskStringId,
  1511.                 IMG_SCR1002_LSK,
  1512.                 nRskStringId,
  1513.                 nRskImgId,
  1514.                 nAllcall,
  1515.                 strDispnames,
  1516. nIconIds,
  1517.                 nImgIds,
  1518.                 (UI_time*) & timeStruct.time,
  1519.                 firstActiveCallIndex,
  1520.                 guiBuffer);
  1521.         }
  1522.     }
  1523.     else
  1524.     {
  1525.         /* only 1 call */
  1526.         type = GetActiveCallType();
  1527.         if (type == CSMCC_FAX_CALL)
  1528.         {
  1529.             nImgIds[0] = IMG_FAX_CALL_CONNECT;
  1530.         }
  1531.         else if (type == CSMCC_DATA_CALL)
  1532.         {
  1533.             nImgIds[0] = IMG_DATA_CALL_CONNECT;
  1534.         }
  1535.         else
  1536.         {
  1537.             if (nImgIds[0] == IMG_CM_STATE_ACTIVE)
  1538.             {
  1539.                 nImgIds[0] = IMG_CM_STATE_SINGLE_ACTIVE;
  1540.             }
  1541.             else if (nImgIds[0] == IMG_CM_STATE_HOLD)
  1542.             {
  1543.                 nImgIds[0] = IMG_CM_STATE_SINGLE_HOLD;
  1544.             }
  1545.             /* Start by Julia: Drop call refinement */
  1546.             /* else if (nImgIds[0] == IMG_CM_STATE_DISCONNECTING)
  1547.                nImgIds[0] = IMG_CM_STATE_SINGLE_DISCONNECTING; */
  1548.         }
  1549.         if (GetDisconnectingCallHandle() != -1)
  1550.         {
  1551.             ShowCategory20Screen(
  1552.                 0,
  1553.                 0,
  1554.                 0,
  1555.                 0,
  1556.                 strDispnames[0],
  1557.                 (UI_time*) & timeStruct.time,
  1558. nIconIds[0],
  1559.                 nImgIds[0],
  1560.                 MMI_TRUE,
  1561.                 guiBuffer);
  1562.         }
  1563.         else
  1564.             /* End by Julia */
  1565.         {
  1566.             ShowCategory20Screen(
  1567.                 nLskStringId,
  1568.                 IMG_SCR1002_LSK,
  1569.                 nRskStringId,
  1570.                 nRskImgId,
  1571.                 strDispnames[0],
  1572.                 (UI_time*) & timeStruct.time,
  1573. nIconIds[0],
  1574.                 nImgIds[0],
  1575.                 MMI_FALSE,
  1576.                 guiBuffer);
  1577.         }
  1578.     }
  1579.     /* Start by Julia: Drop call refinement */
  1580.     if (GetDisconnectingCallHandle() != -1)
  1581.     {
  1582.         SetKeyHandler(ReleaseCall, KEY_END, KEY_EVENT_DOWN);
  1583.     }
  1584.     else
  1585.     {
  1586.         /* End by Julia */
  1587.         SetLeftSoftkeyFunction(EntryScr1003CMActiveCallOptions, KEY_EVENT_UP);
  1588. //jerson add begin 20070622
  1589. #ifdef  __MMI_ONEKEY_SNDREC_SUPPORT__
  1590. SetKeyHandler(DummyEntrySoundRecorderInCall,KEY_ENTER,KEY_EVENT_UP);
  1591. #endif
  1592. //jerson add end 20070622
  1593. //KP Jerry modify on 2007-4-9 start
  1594. #ifndef __MMI_HAND_FREE_FUNC_DISABLE__
  1595.     #if !defined(__MMI_BT_HP_SUPPORT__) && !defined(__MMI_BT_SUPPORT__)
  1596.         SetRightSoftkeyFunction(LoudSpeakerFunction, KEY_EVENT_UP);
  1597.     #else /* !defined(__MMI_BT_HP_SUPPORT__) && !defined(__MMI_BT_SUPPORT__) */ 
  1598.         /* Bluetooth Support */
  1599.         if (mmi_bt_is_incall_aud_swap2bt() != MMI_TRUE)
  1600.         {
  1601.             SetRightSoftkeyFunction(LoudSpeakerFunction, KEY_EVENT_UP);
  1602.         }
  1603.     #endif /* !defined(__MMI_BT_HP_SUPPORT__) && !defined(__MMI_BT_SUPPORT__) */ 
  1604. #else/*__MMI_HAND_FREE_FUNC_DISABLE__*/
  1605. SetRightSoftkeyFunction(HangupAll,KEY_EVENT_UP);
  1606. #endif/*__MMI_HAND_FREE_FUNC_DISABLE__*/
  1607. //KP Jerry modify on 2007-4-9 end
  1608.         if (nActiveCall > 0 && nHoldCall > 0)
  1609.         {
  1610.             SetKeyHandler(SwapCall, KEY_SEND, KEY_EVENT_DOWN);
  1611.         }
  1612.         else if (nActiveCall == 0)
  1613.         {
  1614.             SetKeyHandler(RetrieveHeldCall, KEY_SEND, KEY_EVENT_DOWN);
  1615.         }
  1616.         else
  1617.         {
  1618.             SetKeyHandler(MakeActiveCallHold, KEY_SEND, KEY_EVENT_DOWN);
  1619.         }
  1620.         SetKeyHandler(HangupAll, KEY_END, KEY_EVENT_DOWN);
  1621.         if (nLskStringId != 0)
  1622.         {
  1623.         #ifdef __MMI_CM_ARROW_KEY_TO_PHB__
  1624.             SetKeyHandler(mmi_phb_list_enter_last_from_active_call, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  1625.             SetKeyHandler(mmi_phb_list_enter_first_from_active_call, KEY_UP_ARROW, KEY_EVENT_DOWN);
  1626.         #endif /* __MMI_CM_ARROW_KEY_TO_PHB__ */ 
  1627.         }
  1628.         SetGroupKeyHandler(
  1629.             EnterScreenAndHandleDigit,
  1630.             (PU16) CMIdleScreenDigits,
  1631.             MAX_CM_SCREEN_DIGITS - 1,
  1632.             KEY_EVENT_DOWN);
  1633.     #if ( (defined  __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__) )
  1634.         SetCenterSoftkeyFunction(EnterScreenAndHandleDigit, KEY_EVENT_UP);
  1635.     #endif 
  1636.         /* Handled crash for NULL= type changes by Kuldeep for Network Simulator 2.0 */
  1637.         type = GetActiveCallType();
  1638.         /* Handled crash for NULL= type changes by Kuldeep */
  1639.         if (type != CSMCC_FAX_CALL && type != CSMCC_DATA_CALL)
  1640.         {
  1641.             SetSideVolumeKeysForCM();
  1642.         }
  1643.     }
  1644. }
  1645. /*****************************************************************************
  1646.  * FUNCTION
  1647.  *  EntrySubLcdScr1002ActiveCall
  1648.  * DESCRIPTION
  1649.  *  Entry screen for Sub Lcd Active Call
  1650.  * PARAMETERS
  1651.  *  void
  1652.  * RETURNS
  1653.  *  void
  1654.  *****************************************************************************/
  1655. void EntrySubLcdScr1002ActiveCall(void)
  1656. {
  1657.     /*----------------------------------------------------------------*/
  1658.     /* Local Variables                                                */
  1659.     /*----------------------------------------------------------------*/
  1660.     /*----------------------------------------------------------------*/
  1661.     /* Code Body                                                      */
  1662.     /*----------------------------------------------------------------*/
  1663.     ExecSubLCDCurrExitHandler();
  1664.     ShowCategory304Screen(IMG_CM_STATE_CONNECTED, NULL);
  1665.     SetSubLCDExitHandler(ExitSubLcdScr1002ActiveCall);
  1666. }
  1667. /*****************************************************************************
  1668.  * FUNCTION
  1669.  *  ExitSubLcdScr1002ActiveCall
  1670.  * DESCRIPTION
  1671.  *  Exit Handler for Sub Lcd Active Call Screen
  1672.  * PARAMETERS
  1673.  *  void
  1674.  * RETURNS
  1675.  *  void
  1676.  *****************************************************************************/
  1677. void ExitSubLcdScr1002ActiveCall(void)
  1678. {
  1679.     /*----------------------------------------------------------------*/
  1680.     /* Local Variables                                                */
  1681.     /*----------------------------------------------------------------*/
  1682.     /*----------------------------------------------------------------*/
  1683.     /* Code Body                                                      */
  1684.     /*----------------------------------------------------------------*/
  1685.     if (!IsSubLCDScreenPresent(SUB_LCD_SCR_CM_ACTIVECALLSCREEN))
  1686.     {
  1687.         SubLCDHistoryNode SubLCDHistory;
  1688.         SubLCDHistory.entryFuncPtr = EntrySubLcdScr1002ActiveCall;
  1689.         AddSubLCDHistoryWithScrID(&SubLCDHistory, SUB_LCD_SCR_CM_ACTIVECALLSCREEN);
  1690.     }
  1691. }
  1692. /*****************************************************************************
  1693.  * FUNCTION
  1694.  *  EntryScr1003CMActiveCallOptions
  1695.  * DESCRIPTION
  1696.  *  This handles the LSK functionality for the active screen.
  1697.  *  Displays options depending on the scenario.
  1698.  *  
  1699.  *  This handles all the scenario depending on the menuitem defined.
  1700.  * PARAMETERS
  1701.  *  void
  1702.  * RETURNS
  1703.  *  void
  1704.  *****************************************************************************/
  1705. void EntryScr1003CMActiveCallOptions(void)
  1706. {
  1707.     /*----------------------------------------------------------------*/
  1708.     /* Local Variables                                                */
  1709.     /*----------------------------------------------------------------*/
  1710.     U16 parentId;
  1711.     U8 *guiBuffer;
  1712.     U8 *inputBuffer;
  1713.     static U8 *PopUpList[40];
  1714.     U16 nNumofItem;
  1715.     U16 nStrItemList[20];
  1716.     S16 nActiveCall = 0;
  1717.     U16 nHoldCall = 0;
  1718.     /*----------------------------------------------------------------*/
  1719.     /* Code Body                                                      */
  1720.     /*----------------------------------------------------------------*/
  1721.     /* Added For CPHS */
  1722.     /* U16 isConfPresent=0;
  1723.        U16 isHoldPresent=0;
  1724.        S32 maskingByte=-1; */
  1725.     nActiveCall = GetTotalActiveCallCount();
  1726.     nHoldCall = GetTotalHoldCallCount();
  1727.     PRINT_INFORMATION(("n active option: active:%d, held:%dn", nActiveCall, nHoldCall));
  1728.     if (nActiveCall + nHoldCall == 0)
  1729.     {
  1730.         return;
  1731.     }
  1732.     if ((nActiveCall == 1) && (nHoldCall == 0))
  1733.     {
  1734.         U8 type;
  1735.         type = GetActiveCallType();
  1736.         if (type == CSMCC_DATA_CALL || type == CSMCC_FAX_CALL)
  1737.         {
  1738.             parentId = MITEM2001_CM_SINGLE_DATA_LSKOPTIONS;
  1739.         }
  1740.         else
  1741.         {
  1742.             parentId = MITEM2001_CM_SINGLE_ACTIVE_LSKOPTIONS;
  1743.             // isHoldPresent=1; /* Added For CPHS */
  1744.         }
  1745.     }
  1746.     else if ((nActiveCall == 0) && (nHoldCall == 1))
  1747.     {
  1748.         parentId = MITEM2002_CM_SINGLE_HOLD_LSKOPTIONS;
  1749.     }
  1750.     else if ((nActiveCall == 1) && (nHoldCall == 1))
  1751.     {
  1752.         parentId = MITEM2003_CM_S_ACTIVE_S_HOLD_LSKOPTIONS;
  1753.         // isConfPresent=1; /* Added For CPHS */
  1754.     }
  1755.     else if ((nActiveCall > 1) && (nHoldCall == 0))
  1756.     {
  1757.         parentId = MITEM2004_CM_M_ACTIVE_LSKOPTIONS;
  1758.     }
  1759.     else if ((nActiveCall == 0) && (nHoldCall > 1))
  1760.     {
  1761.         parentId = MITEM2005_CM_M_HOLD_LSKOPTIONS;
  1762.     }
  1763.     else if ((nActiveCall > 1) && (nHoldCall == 1))
  1764.     {
  1765.         parentId = MITEM2006_CM_M_ACTIVE_S_HOLD_LSKOPTIONS;
  1766.         // isConfPresent=1; /* Added For CPHS */
  1767.     }
  1768.     else if ((nActiveCall == 1) && (nHoldCall > 1))
  1769.     {
  1770.         parentId = MITEM2007_CM_S_ACTIVE_M_HOLD_LSKOPTIONS;
  1771.         // isConfPresent=1; /* Added For CPHS */
  1772.     }
  1773.     else
  1774.     {
  1775.         return;
  1776.     }
  1777.     PRINT_INFORMATION(("n parent:%dn", parentId));
  1778.     EntryNewScreen(SCR1003_CM_ACTIVECALLOPTIONS, ExitScr1003CMActiveCallOptions, NULL, NULL);
  1779.     SetCMScrnFlag(TRUE);
  1780.     guiBuffer = GetCurrGuiBuffer(SCR1003_CM_ACTIVECALLOPTIONS);
  1781.     if (IsScreenPresent(SCR1003_CM_ACTIVECALLOPTIONS))
  1782.     {
  1783.         inputBuffer = GetCurrInputBuffer(SCR1003_CM_ACTIVECALLOPTIONS);
  1784.         if (inputBuffer[0] != (nActiveCall + nHoldCall))
  1785.         {
  1786.             /* call count changed, always highlight the first item */
  1787.             guiBuffer = NULL;
  1788.         }
  1789.     }
  1790.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1791.     SetParentHandler(parentId);
  1792. #ifdef __CTM_SUPPORT__
  1793.     if (!((GetTotalActiveCallCount() > 0) &&
  1794.           (ctm_p->state == MMI_CTM_STATE_OPENED) && (ctm_p->mode_activated == CTM_DIRECT_MODE)))
  1795.     {
  1796.         /* only opened and unconnected case need to show connect ctm option */
  1797.         mmi_frm_hide_menu_item(MITEM2027_CM_CTM);
  1798.     }
  1799.     if (ctm_p->status == TRUE)
  1800.     {
  1801.         mmi_frm_hide_menu_item(MITEM2026_CM_SOUND_RECORDER);
  1802.     }
  1803. #endif /* __CTM_SUPPORT__ */ 
  1804. #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
  1805.    /*************************************************/
  1806.    /** Notice!!! */
  1807.    /** 1. The voice transfer menu item should be the last one in the option menu */
  1808.    /** 2. The voice transfer menu item is only added in XXX_CM_XXX_ACTIVE_XXX parentId. */
  1809.    /**   So this screen has to removed this menu item while BT headset connected */
  1810.    /*************************************************/
  1811.     if (mmi_bt_is_hs_connected() != MMI_TRUE)
  1812.     {
  1813.         switch (parentId)
  1814.         {
  1815.             case MITEM2001_CM_SINGLE_DATA_LSKOPTIONS:
  1816.             case MITEM2002_CM_SINGLE_HOLD_LSKOPTIONS:
  1817.             case MITEM2005_CM_M_HOLD_LSKOPTIONS:
  1818.                 break;
  1819.             default:
  1820.                 mmi_frm_hide_menu_item(MITEM_CM_BT_SETPATH);
  1821.                 break;
  1822.         }
  1823.     }
  1824.     /* Add by Elvis*/
  1825.     #ifdef __BT_INBAND_RING__
  1826.     mmi_frm_hide_menu_item(MITEM_CM_BT_SETPATH);
  1827.     #endif
  1828.     /* End of Elvis */
  1829. #endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */ 
  1830.     /* diamond, 2005/07/01 add _Ext to menu item functions */
  1831.     nNumofItem = GetNumOfChild_Ext(parentId);
  1832.     GetSequenceStringIds_Ext(parentId, nStrItemList);
  1833.     ConstructHintsList(parentId, PopUpList);
  1834.     PRINT_INFORMATION(("n active option: %dn", nNumofItem));
  1835.     ShowCategory55Screen(
  1836.         STR_SCR1002_CAPTION,
  1837.         IMG_SCR1002_CAPTION,
  1838.         STR_GLOBAL_OK,
  1839.         IMG_SCR1003_LSK,
  1840.         STR_GLOBAL_BACK,
  1841.         IMG_SCR1003_RSK,
  1842.         nNumofItem,
  1843.         nStrItemList,
  1844.         (U8 **) PopUpList,
  1845.         0,
  1846.         guiBuffer);
  1847.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1848.     SetKeyHandler(HangupAll, KEY_END, KEY_EVENT_DOWN);
  1849.     SetSideVolumeKeysForCM();
  1850.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1851. }
  1852. /*****************************************************************************
  1853.  * FUNCTION
  1854.  *  ExitScr1003CMActiveCallOptions
  1855.  * DESCRIPTION
  1856.  *  
  1857.  * PARAMETERS
  1858.  *  void
  1859.  * RETURNS
  1860.  *  void
  1861.  *****************************************************************************/
  1862. void ExitScr1003CMActiveCallOptions(void)
  1863. {
  1864.     /*----------------------------------------------------------------*/
  1865.     /* Local Variables                                                */
  1866.     /*----------------------------------------------------------------*/
  1867.     history Scr1001;
  1868.     /*----------------------------------------------------------------*/
  1869.     /* Code Body                                                      */
  1870.     /*----------------------------------------------------------------*/
  1871. #ifdef __CTM_SUPPORT__
  1872.     mmi_frm_unhide_menu_item(MITEM2027_CM_CTM);
  1873.     mmi_frm_unhide_menu_item(MITEM2026_CM_SOUND_RECORDER);
  1874. #endif /* __CTM_SUPPORT__ */ 
  1875. #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
  1876.     mmi_frm_unhide_menu_item(MITEM_CM_BT_SETPATH);
  1877. #endif 
  1878.     Scr1001.scrnID = SCR1003_CM_ACTIVECALLOPTIONS;
  1879.     Scr1001.entryFuncPtr = EntryScr1003CMActiveCallOptions;
  1880.     memset (Scr1001.inputBuffer, 0, sizeof (Scr1001.inputBuffer));
  1881.     Scr1001.inputBuffer[0] = (U8) GetTotalCallCount();
  1882.     GetCategoryHistory(Scr1001.guiBuffer);
  1883.     AddHistory(Scr1001);
  1884. }
  1885. /*****************************************************************************
  1886.  * FUNCTION
  1887.  *  EntryScr1004NotifyEndCallDuration
  1888.  * DESCRIPTION
  1889.  *  This is a notification which does not have history and used when the
  1890.  *  Hangup of a single call is success with a timeout of CM_NOTIFY_TIMEOUT.
  1891.  *  
  1892.  *  This has to display the time,we need to have the time display catefory function.
  1893.  * PARAMETERS
  1894.  *  void
  1895.  * RETURNS
  1896.  *  void
  1897.  *****************************************************************************/
  1898. void EntryScr1004NotifyEndCallDuration(void)
  1899. {
  1900.     /*----------------------------------------------------------------*/
  1901.     /* Local Variables                                                */
  1902.     /*----------------------------------------------------------------*/
  1903.     static S8 MessageString[SCR_TEXT_LEN];
  1904.     S8 TimeString[TEMP_NO * 2];
  1905.     S8 TempBuf[TEMP_NO];
  1906.     U16 img_id = IMG_ERROR_NOTIFY;
  1907.     U16 tone_id = CALL_DROP_TONE;
  1908.     /*----------------------------------------------------------------*/
  1909.     /* Code Body                                                      */
  1910.     /*----------------------------------------------------------------*/
  1911.     TurnOnBacklight(1);
  1912.     PRINT_INFORMATION((" XXX In EntryScr1004NotifyEndCallDurationXXXn"));
  1913.     SetCbackAfterSS(NULL);
  1914.     if (GetNotifySSFlag())
  1915.     {
  1916.         PRINT_INFORMATION((" XXX EntryScr1004NotifyEndCallDuration: Notify Flag Set XXXn"));
  1917.         if ((GetCurrentState() == CM_OUTGOING_STATE) && (-1 != GetOutgoingCallHandle()))
  1918.         {
  1919.             SetCbackAfterSS((FuncPtr) EntryScr1001OutgoingCall);
  1920.         }
  1921.         else if (   /* GetCurrentState() == CM_IDLE_STATE && */
  1922.                     GetPreviousState() == CM_OUTGOING_STATE || GetPreviousState() == CM_ACTIVE_STATE)
  1923.         {
  1924.             SetCbackAfterSS((FuncPtr) EntryScr1004NotifyEndCallDuration);
  1925.         }
  1926.         else
  1927.         {
  1928.             SetCbackAfterSS((FuncPtr) EntryScr1002ActiveCall);
  1929.         }
  1930.         return;
  1931.     }
  1932.     EntryNewScreen(SCR1004_CM_DISPENDCALLDURATION, ExitScr1004NotifyEndCallDuration, NULL, NULL);
  1933.     if (GetTotalCallCount() > 0)
  1934.     {
  1935.         tone_id = 0;
  1936.     }
  1937.     if (GetActivatedCcbsFlag() == TRUE)
  1938.     {
  1939.         StartTimer(CM_NOTIFYDURATION_TIMER, 1, GoBackfromNotifyScr);
  1940.         return;
  1941.     }
  1942.     AnsiiToUnicodeString(TempBuf, "n");
  1943.     if (GetDropRequestFlag() == TRUE && GetCurrentState() != CM_OUTGOING_STATE)
  1944.     {
  1945.         pfnUnicodeStrcpy((PS8) MessageString, (PS8) GetString(STR_CALL_ABORTED));
  1946.         SetDropRequestFlag(FALSE);
  1947.         SetCallEndedBeforeConnFlag(FALSE);
  1948.     }
  1949.     else
  1950.     {
  1951.         U16 error_code;
  1952.         switch (GetCallEndCause())
  1953.         {
  1954.             case ERR_UNASSIGNED_NUM:
  1955.             case ERR_INVALID_NUMBER_FORMAT:
  1956.                 error_code = ERROR_UNRECOGNIZED_NUMBER;
  1957.                 break;
  1958.             case ERR_CHANNEL_UN_ACCP:
  1959.             case ERR_NO_CIRCUIT_CHANNEL_AVAIL:
  1960.             case ERR_NETWORK_OUT_OF_ORDER:
  1961.             case ERR_QOS_UNAVAIL:
  1962.             case ERR_INVALID_TRANSIT_NW_SEL:
  1963.             case ERR_CSMCC_NO_RESPONSE_FROM_NW:
  1964.             case ERR_NETWORK_FAILURE:
  1965.             case ERR_CM_MM_RR_CONN_RELEASE:
  1966.                 error_code = ERROR_NETWORK_FAIL;
  1967.                 break;
  1968.             case ERR_REQUESTED_CKT_CHANEL_NOT_AVIL:
  1969.             case ERR_RESOURCE_UNAVAIL_UNSPECIFIED:
  1970.             case ERR_CM_MM_AUTH_FAILURE:
  1971.                 error_code = ERROR_NETWORK_NOT_AVAILABLE;
  1972.                 break;
  1973.             case ERR_OPR_DTR_BARRING:
  1974.             case ERR_CALL_BARRED:
  1975.             case ERR_IC_BAR_CUG:
  1976.             case ERR_BEARER_CAP_NOT_AVAIL:
  1977.             case ERR_CM_MM_ACCESS_BARRED:
  1978.                 error_code = ERROR_BARRED_CALL;
  1979.                 break;
  1980.             case ERR_NO_USER_RESPONDING:
  1981.                 error_code = ERROR_NOT_RESPONDING;
  1982.                 break;
  1983.             case ERR_NO_ANSWER_ON_ALERT:
  1984.                 error_code = ERROR_NO_ANSWER;
  1985.                 break;
  1986.             case ERR_REQ_FACILITY_UNAVAIL:
  1987.             case ERR_IE_NOT_IMPLEMENTED:
  1988.             case ERR_CONDITIONAL_MM_IE_ERROR:
  1989.             case ERR_CM_MM_ASSIGNMENT_REJECT:
  1990.                 error_code = ERROR_UNAVAILABLE;
  1991.                 break;
  1992.             case ERR_IMSI_UNKNOWN_IN_HLR:
  1993.             case ERR_IMSI_UNKNOWN_IN_VLR:
  1994.             case ERR_CM_MM_IMSI_DETACH:
  1995.                 error_code = ERROR_IMSI_UNKNOWN;
  1996.                 break;
  1997.             case ERR_IMEI_NOT_ACCEPTED:
  1998.                 error_code = ERROR_IMEI_ERROR;
  1999.                 break;
  2000.             case ERR_REQ_FAC_NOT_SUBS:
  2001.             case ERR_PLMN_NOT_ALLOWED:
  2002.             case ERR_LOCATION_AREA_NOT_ALLOWED:
  2003.             case ERR_ROAMING_AREA_NOT_ALLOWED:
  2004.             case ERR_GPRS_NOT_ALLOWED_IN_PLMN:
  2005.             case ERR_NO_SUITABLE_CELLS_IN_LA:
  2006.             case ERR_MSC_TEMP_NOT_REACHABLE:
  2007.             case ERR_CM_MM_ABORT_BY_NW:
  2008.             case ERR_CM_MM_STATE_NOT_ALLOWED_CM:
  2009.             case ERR_BEARER_CAP_NOT_AUTHORISED:
  2010.                 error_code = ERROR_NETWORK_NOT_ALLOWED;
  2011.                 break;
  2012.             case ERR_SERV_OPTION_NOT_SUPPORTED:
  2013.             case ERR_REQ_SERV_OPTION_NOT_SUBSCRIBED:
  2014.             case ERR_SERV_OPTION_TEMP_OUT_OF_ORDER:
  2015.             case ERR_CALL_CANNOT_BE_IDENTIFIED:
  2016.                 error_code = ERROR_COMMAND_NOT_SUPPORTED;
  2017.                 break;
  2018.             case ERR_ACM_EXCEEDED:
  2019.                 error_code = ERROR_ACM_EXCEEDED;
  2020.                 break;
  2021.             case ERR_USER_BUSY:
  2022.                 error_code = ERROR_USER_BUSY;
  2023.                 tone_id = TONE_BUSY_CALL_GSM;
  2024.                 break;
  2025.             default:
  2026.                 error_code = STR_CALL_ENDED;
  2027.                 img_id = IMG_CM_STATE_ENDED;
  2028.                 break;
  2029.         }
  2030.         pfnUnicodeStrcpy(MessageString, (PS8) GetString(error_code));
  2031.         pfnUnicodeStrcat((PS8) MessageString, TempBuf);
  2032.         SetErrorToneFlag(tone_id);
  2033.         if (tone_id == TONE_BUSY_CALL_GSM)
  2034.         {
  2035.          AudioPlayReq(TONE_BUSY_CALL_GSM, DEVICE_AUDIO_PLAY_INFINITE);
  2036.         }
  2037.         else if (tone_id > 0)
  2038.         {
  2039.         playRequestedTone(tone_id);
  2040.         }
  2041.         SetCallEndCause(0);
  2042.         if (TRUE == GetCallEndedBeforeConnFlag())
  2043.         {
  2044.             PRINT_INFORMATION((" XXX In EntryScr1004NotifyEndCallDurationXXX -- No timen"));
  2045.             SetCallEndedBeforeConnFlag(FALSE);
  2046.         }
  2047.         else
  2048.         {
  2049.             PRINT_INFORMATION((" XXX In EntryScr1004NotifyEndCallDurationXXX -- print timen"));
  2050.             duration_string(
  2051.                 (UI_time*) & gTimeStructForCallDuration,
  2052.                 (UI_string_type) TimeString,
  2053.                 DT_ACTIVE_CALL_SCREEN);
  2054.             pfnUnicodeStrcat((PS8) MessageString, TimeString);
  2055.         }
  2056.     }
  2057.     ShowCategory63Screen((U8*) MessageString, img_id, NULL);
  2058.     ClearInputEventHandler(MMI_DEVICE_ALL);
  2059.     SetKeyHandler((FuncPtr) GoBackfromNotifyScr, KEY_END, KEY_EVENT_DOWN);
  2060.     SetPOPUpFlag(TRUE);
  2061.     StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
  2062. }
  2063. /*****************************************************************************
  2064.  * FUNCTION
  2065.  *  ExitScr1004NotifyEndCallDuration
  2066.  * DESCRIPTION
  2067.  *  This just stops timer which was started in the entry function.
  2068.  *  
  2069.  *  History might be added if required not
  2070.  *  added as the notification does not need history.
  2071.  * PARAMETERS
  2072.  *  void
  2073.  * RETURNS
  2074.  *  void
  2075.  *****************************************************************************/
  2076. void ExitScr1004NotifyEndCallDuration(void)
  2077. {
  2078.     /*----------------------------------------------------------------*/
  2079.     /* Local Variables                                                */
  2080.     /*----------------------------------------------------------------*/
  2081.     /*----------------------------------------------------------------*/
  2082.     /* Code Body                                                      */
  2083.     /*----------------------------------------------------------------*/
  2084.     StopTimer(CM_NOTIFYDURATION_TIMER);
  2085.     if (GetErrorToneFlag() == TONE_BUSY_CALL_GSM)
  2086.     {
  2087.         AudioStopReq(TONE_BUSY_CALL_GSM);
  2088.     }
  2089.     else if (GetErrorToneFlag() > 0)
  2090.     {
  2091.         stopRequestedTone(GetErrorToneFlag());
  2092.     }
  2093.         SetErrorToneFlag(0);
  2094.     if (GetPOPUpFlag())
  2095.     {
  2096.         SetPOPUpFlag(FALSE);
  2097.         AdjustHistoryForCM();
  2098.     }
  2099.     if (CMAllowInterrupt())
  2100.     {
  2101.         MMIProcessActionMsg();
  2102.     }
  2103. }
  2104. /*****************************************************************************
  2105.  * FUNCTION
  2106.  *  EntryScrNotifyCallAborted
  2107.  * DESCRIPTION
  2108.  *  This is a notification which does not have history and used when the
  2109.  *  Hangup of a single call is success with a timeout of CM_NOTIFY_TIMEOUT.
  2110.  *  
  2111.  *  This has to display the time,we need to have the time display catefory function.
  2112.  * PARAMETERS
  2113.  *  void
  2114.  * RETURNS
  2115.  *  void
  2116.  *****************************************************************************/
  2117. void EntryScrNotifyCallAborted(void)
  2118. {
  2119.     /*----------------------------------------------------------------*/
  2120.     /* Local Variables                                                */
  2121.     /*----------------------------------------------------------------*/
  2122.     static U8 MessageString[TEMP_NO * 3];
  2123.     /*----------------------------------------------------------------*/
  2124.     /* Code Body                                                      */
  2125.     /*----------------------------------------------------------------*/
  2126.     EntryNewScreen(SCR_CM_NOTIFYCALLABORTED, ExitScrNotifyCMPopUp, NULL, NULL);
  2127.     PRINT_INFORMATION((" XXX In EntryScrNotifyCallAbortedn"));
  2128.     if (GetDropRequestFlag() == TRUE)
  2129.     {
  2130.         pfnUnicodeStrcpy((PS8) MessageString, (PS8) GetString(STR_CALL_ABORTED));
  2131.         SetDropRequestFlag(FALSE);
  2132.     }
  2133.     else
  2134.     {
  2135.         pfnUnicodeStrcpy((PS8) MessageString, (PS8) GetString(STR_CALL_ENDED));
  2136.     }
  2137.     SetCallEndedBeforeConnFlag(FALSE);
  2138.     ShowCategory63Screen(MessageString, IMG_CM_STATE_ENDED, NULL);
  2139.     ClearInputEventHandler(MMI_DEVICE_ALL);
  2140.     SetPOPUpFlag(TRUE);
  2141.     StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
  2142. }
  2143. /*****************************************************************************
  2144.  * FUNCTION
  2145.  *  EntryScr1005NotifyHoldSucess
  2146.  * DESCRIPTION
  2147.  *  This is a notification which does not have history and used when the
  2148.  *  Hold request is success with a timeout of CM_NOTIFY_TIMEOUT.
  2149.  * PARAMETERS
  2150.  *  void
  2151.  * RETURNS
  2152.  *  void
  2153.  *****************************************************************************/
  2154. void EntryScr1005NotifyHoldSucess(void)
  2155. {
  2156.     /*----------------------------------------------------------------*/
  2157.     /* Local Variables                                                */
  2158.     /*----------------------------------------------------------------*/
  2159.     /*----------------------------------------------------------------*/
  2160.     /* Code Body                                                      */
  2161.     /*----------------------------------------------------------------*/
  2162.     PRINT_INFORMATION(("n EntryScr1005NotifyHoldSucess n"));
  2163.     EntryScrNotifyCHLDSucess(STR_NFY_CALL_HLD, TRUE);
  2164. }
  2165. /*****************************************************************************
  2166.  * FUNCTION
  2167.  *  EntryScr1006NotifyRetrieveSucess
  2168.  * DESCRIPTION
  2169.  *  This is a notification which does not have history and used when the
  2170.  *  Retrieve request is success with a timeout of CM_NOTIFY_TIMEOUT.
  2171.  * PARAMETERS
  2172.  *  void
  2173.  * RETURNS
  2174.  *  void
  2175.  *****************************************************************************/
  2176. void EntryScr1006NotifyRetrieveSucess(void)
  2177. {
  2178.     /*----------------------------------------------------------------*/
  2179.     /* Local Variables                                                */
  2180.     /*----------------------------------------------------------------*/
  2181.     /*----------------------------------------------------------------*/
  2182.     /* Code Body                                                      */
  2183.     /*----------------------------------------------------------------*/
  2184.     EntryScrNotifyCHLDSucess(STR_NFY_CALL_RTVD, FALSE);
  2185. }
  2186. /*****************************************************************************
  2187.  * FUNCTION
  2188.  *  EntryScr1007NotifySwapSucess
  2189.  * DESCRIPTION
  2190.  *  This is a notification which does not have history and used when the
  2191.  *  Swap request is success with a timeout of CM_NOTIFY_TIMEOUT.
  2192.  * PARAMETERS
  2193.  *  void
  2194.  * RETURNS
  2195.  *  void
  2196.  *****************************************************************************/
  2197. void EntryScr1007NotifySwapSucess(void)
  2198. {
  2199.     /*----------------------------------------------------------------*/
  2200.     /* Local Variables                                                */
  2201.     /*----------------------------------------------------------------*/
  2202.     /*----------------------------------------------------------------*/
  2203.     /* Code Body                                                      */
  2204.     /*----------------------------------------------------------------*/
  2205.     if (GetTotalActiveCallCount() > 0 && GetTotalHoldCallCount() > 0)
  2206.     {
  2207.         EntryScrNotifyCHLDSucess(STR_NFY_CALL_SWAP, FALSE);
  2208.     }
  2209.     else if (GetTotalActiveCallCount() > 0)
  2210.     {
  2211.         EntryScrNotifyCHLDSucess(STR_NFY_CALL_RTVD, FALSE);
  2212.     }
  2213.     else if (GetTotalHoldCallCount() > 0)
  2214.     {
  2215.         EntryScrNotifyCHLDSucess(STR_NFY_CALL_HLD, TRUE);
  2216.     }
  2217. }
  2218. /*****************************************************************************
  2219.  * FUNCTION
  2220.  *  EntryScr1008NotifyConfSucess
  2221.  * DESCRIPTION
  2222.  *  This is a notification which does not have history and used when the
  2223.  *  Conference request is success with a timeout of CM_NOTIFY_TIMEOUT.
  2224.  * PARAMETERS
  2225.  *  void
  2226.  * RETURNS
  2227.  *  void
  2228.  *****************************************************************************/
  2229. void EntryScr1008NotifyConfSucess(void)
  2230. {
  2231.     /*----------------------------------------------------------------*/
  2232.     /* Local Variables                                                */
  2233.     /*----------------------------------------------------------------*/
  2234.     /*----------------------------------------------------------------*/
  2235.     /* Code Body                                                      */
  2236.     /*----------------------------------------------------------------*/
  2237.     EntryScrNotifyCHLDSucess(STR_NFY_CALL_CONF, FALSE);
  2238. }
  2239. /*****************************************************************************
  2240.  * FUNCTION
  2241.  *  EntryScr1010NotifySplitSucess
  2242.  * DESCRIPTION
  2243.  *  This is a notification which does not have history and used when the
  2244.  *  Split request is success with a timeout of CM_NOTIFY_TIMEOUT.
  2245.  * PARAMETERS
  2246.  *  void
  2247.  * RETURNS
  2248.  *  void
  2249.  *****************************************************************************/
  2250. void EntryScr1010NotifySplitSucess(void)
  2251. {
  2252.     /*----------------------------------------------------------------*/
  2253.     /* Local Variables                                                */
  2254.     /*----------------------------------------------------------------*/
  2255.     /*----------------------------------------------------------------*/
  2256.     /* Code Body                                                      */
  2257.     /*----------------------------------------------------------------*/
  2258.     EntryScrNotifyCHLDSucess(STR_NFY_CALL_SPLIT, FALSE);
  2259. }
  2260. /*****************************************************************************
  2261.  * FUNCTION
  2262.  *  EntryScrNotifyCHLDSucess
  2263.  * DESCRIPTION
  2264.  *  This is a notification which does not have history and used when the
  2265.  *  Split request is success with a timeout of CM_NOTIFY_TIMEOUT.
  2266.  * PARAMETERS
  2267.  *  notify_string       [IN]        
  2268.  *  play_tone           [IN]        
  2269.  * RETURNS
  2270.  *  void
  2271.  *****************************************************************************/
  2272. void EntryScrNotifyCHLDSucess(U16 notify_string, pBOOL play_tone)
  2273. {
  2274.     /*----------------------------------------------------------------*/
  2275.     /* Local Variables                                                */
  2276.     /*----------------------------------------------------------------*/
  2277.     /*----------------------------------------------------------------*/
  2278.     /* Code Body                                                      */
  2279.     /*----------------------------------------------------------------*/
  2280.     EntryNewScreen(SCR1010_CM_DISPSPLITCALLSUCESS, ExitScrNotifyCMPopUpTone, NULL, NULL);
  2281. #ifndef __MMI_CM_SHOW_CHLD_DONE__
  2282.     ShowCategory62Screen(notify_string, IMG_GLOBAL_ACTIVATED, NULL);
  2283. #else 
  2284.     ShowCategory62Screen(STR_ACTION_DONE, IMAGE_CCBS_ACTIVATED, NULL);
  2285. #endif 
  2286.     SetLeftSoftkeyFunction(GoBackfromNotifyScr, KEY_EVENT_UP);
  2287.     if (play_tone == TRUE && GetTotalCallCount() == 0)
  2288.     {
  2289.         playRequestedTone(SUCCESS_TONE_IN_CALL);
  2290.         SetErrorToneFlag(SUCCESS_TONE_IN_CALL);
  2291.     }
  2292.     SetKeysForPOPUp();
  2293.     SetPOPUpFlag(TRUE);
  2294.     StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
  2295. }
  2296. /*****************************************************************************
  2297.  * FUNCTION
  2298.  *  ExitScrNotifyCMPopUpTone
  2299.  * DESCRIPTION
  2300.  *  This just stops timer which was started in the entry function.
  2301.  *  
  2302.  *  History might be added if required not
  2303.  *  added as the notification does not need history.
  2304.  * PARAMETERS
  2305.  *  void
  2306.  * RETURNS
  2307.  *  void
  2308.  *****************************************************************************/
  2309. void ExitScrNotifyCMPopUpTone(void)
  2310. {
  2311.     /*----------------------------------------------------------------*/
  2312.     /* Local Variables                                                */
  2313.     /*----------------------------------------------------------------*/
  2314.     /*----------------------------------------------------------------*/
  2315.     /* Code Body                                                      */
  2316.     /*----------------------------------------------------------------*/
  2317.     if (GetErrorToneFlag() > 0)
  2318.     {
  2319.         stopRequestedTone(GetErrorToneFlag());
  2320.         SetErrorToneFlag(0);
  2321.     }
  2322.     StopTimer(CM_NOTIFYDURATION_TIMER);
  2323.     if (GetPOPUpFlag())
  2324.     {
  2325.         SetPOPUpFlag(FALSE);
  2326.         AdjustHistoryForCM();
  2327.     }
  2328. }
  2329. /*****************************************************************************
  2330.  * FUNCTION
  2331.  *  EntryScrLoudSpNotifyScreen
  2332.  * DESCRIPTION
  2333.  *  display the notification screen in case of lous speaker
  2334.  * PARAMETERS
  2335.  *  void
  2336.  *  gListOperation(?)       [IN]        GcallList,gcallListlen global variables filled by other function
  2337.  * RETURNS
  2338.  *  void
  2339.  *****************************************************************************/
  2340. void EntryScrLoudSpNotifyScreen(void)
  2341. {
  2342.     /*----------------------------------------------------------------*/
  2343.     /* Local Variables                                                */
  2344.     /*----------------------------------------------------------------*/
  2345.     /*----------------------------------------------------------------*/
  2346.     /* Code Body                                                      */
  2347.     /*----------------------------------------------------------------*/
  2348.     /* U8* guiBuffer; */
  2349.     PRINT_INFORMATION(("XXX EntryScrLoudSpNotifyScreenn"));
  2350.     EntryNewScreen(SCR_CM_NOTIFY_LOUDSPEAKER, ExitScrNotifyCMPopUp, NULL, NULL);
  2351.     /* guiBuffer = GetCurrGuiBuffer(SCR_CM_NOTIFY_LOUDSPEAKER); */
  2352.     if (LoudSpeaker() == TRUE)
  2353.     {
  2354.         ShowCategory62Screen(STR_NFY_LOUDSPEAKER_ON, 0, NULL);
  2355.     }
  2356.     else
  2357.     {
  2358.         ShowCategory62Screen(STR_NFY_LOUDSPEAKER_OFF, 0, NULL);
  2359.     }
  2360.     SetLeftSoftkeyFunction(GoBackfromNotifyScr, KEY_EVENT_UP);
  2361.     SetPOPUpFlag(TRUE);
  2362.     SetKeysForPOPUp();
  2363.     StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
  2364. }
  2365. /*****************************************************************************
  2366.  * FUNCTION
  2367.  *  ExitScrNotifyCMPopUp
  2368.  * DESCRIPTION
  2369.  *  This function is the exit screen for for displaying SS info to user
  2370.  * PARAMETERS
  2371.  *  void
  2372.  * RETURNS
  2373.  *  void
  2374.  *****************************************************************************/
  2375. void ExitScrNotifyCMPopUp(void)
  2376. {
  2377.     /*----------------------------------------------------------------*/
  2378.     /* Local Variables                                                */
  2379.     /*----------------------------------------------------------------*/
  2380.     /*----------------------------------------------------------------*/
  2381.     /* Code Body                                                      */
  2382.     /*----------------------------------------------------------------*/
  2383.     StopTimer(CM_NOTIFYDURATION_TIMER);
  2384.     if (GetPOPUpFlag())
  2385.     {
  2386.         SetPOPUpFlag(FALSE);
  2387.         AdjustHistoryForCM();
  2388.     }
  2389. }
  2390. /************************ CISS *************************************/
  2391. /*****************************************************************************
  2392.  * FUNCTION
  2393.  *  EntryScrUSSDReq
  2394.  * DESCRIPTION
  2395.  *  This function shows USSD screen
  2396.  * PARAMETERS
  2397.  *  void
  2398.  * RETURNS
  2399.  *  void
  2400.  *****************************************************************************/
  2401. void EntryScrUSSDReq(void)
  2402. {
  2403.     /*----------------------------------------------------------------*/
  2404.     /* Local Variables                                                */
  2405.     /*----------------------------------------------------------------*/
  2406.     /*----------------------------------------------------------------*/
  2407.     /* Code Body                                                      */
  2408.     /*----------------------------------------------------------------*/
  2409.     PRINT_INFORMATION(("*** In EntryScrUSSDReqn"));
  2410.     SetAbortCallRequestedFlag(FALSE);
  2411.     EntryNewScreen(SCR_CM_REQUESTINGUSSD, NULL, EntryScrUSSDReq, NULL);
  2412.     /* micha1115 */
  2413.     DeleteScreenIfPresent(SCR_ID_CALLSET_BARRING_OUT);
  2414.     DeleteScreenIfPresent(SCR_ID_CALLSET_BARRING_IN);
  2415.     DeleteScreenIfPresent(SCR_ID_CALLSET_BARRING_PASS);
  2416.     DeleteScreenIfPresent(SCR_ID_CALLSET_BARRING_OLD_PASS);
  2417.     DeleteScreenIfPresent(SCR_ID_CALLSET_BARRING_OPTION);
  2418.     DeleteScreenIfPresent(SCR_ID_CALLSET_BARRING_NEW_PASS);
  2419.     DeleteScreenIfPresent(SCR_ID_CALLSET_BARRING_CFRM_PASS);
  2420.     DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_OPTIONS);
  2421.     DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NUMBER);
  2422.     DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME);
  2423.     DeleteScreenIfPresent(SCR_ID_CALLSET_WAITING_MAIN);
  2424.     ShowCategory8Screen(
  2425.         STR_USSD_REQ_CAPTION,
  2426.         IMG_CM_USSD_REQUEST,
  2427.         0,
  2428.         0,
  2429.         STR_GLOBAL_ABORT,
  2430.         IMG_SCR_USSD_REQ_LSK,
  2431.         STR_USSD_REQ_DISP_SCR,
  2432.         IMG_CM_SS_OUTGOING,
  2433.         NULL);
  2434.     /* micha0915 */
  2435.     SetDelScrnIDCallbackHandler(SCR_CM_REQUESTINGUSSD, (HistoryDelCBPtr) SSReqHistoryDelHdlr);
  2436.     SetRightSoftkeyFunction(AbortUSSDRequest, KEY_EVENT_UP);
  2437.     SetKeyHandler(AbortUSSDRequestEND, KEY_END, KEY_EVENT_DOWN);
  2438. }
  2439. /* micha0915 */
  2440. /*****************************************************************************
  2441.  * FUNCTION
  2442.  *  SSReqHistoryDelHdlr
  2443.  * DESCRIPTION
  2444.  *  
  2445.  * PARAMETERS
  2446.  *  in_param        [?]     
  2447.  * RETURNS
  2448.  *  U8
  2449.  *****************************************************************************/
  2450. U8 SSReqHistoryDelHdlr(void *in_param)
  2451. {
  2452.     /*----------------------------------------------------------------*/
  2453.     /* Local Variables                                                */
  2454.     /*----------------------------------------------------------------*/
  2455.     /*----------------------------------------------------------------*/
  2456.     /* Code Body                                                      */
  2457.     /*----------------------------------------------------------------*/
  2458.     PRINT_INFORMATION(("*** SSReqHistoryDelHdlrn"));
  2459.     if (FALSE == GetAbortCallRequestedFlag())
  2460.     {
  2461.         SetAbortCallRequestedFlag(TRUE);
  2462.         MakePsDropUSSDReq(NULL);
  2463.     }
  2464.     else
  2465.     {
  2466.         PRINT_INFORMATION(("*** In  SSReqHistoryDelHdlr.. Not sending ATHn"));
  2467.     }
  2468.     return FALSE;
  2469. }
  2470. /*****************************************************************************
  2471.  * FUNCTION
  2472.  *  RemoveSSReqScr
  2473.  * DESCRIPTION
  2474.  *  
  2475.  * PARAMETERS
  2476.  *  void
  2477.  * RETURNS
  2478.  *  U8(?)
  2479.  *****************************************************************************/
  2480. void RemoveSSReqScr(void)
  2481. {
  2482.     /*----------------------------------------------------------------*/
  2483.     /* Local Variables                                                */
  2484.     /*----------------------------------------------------------------*/
  2485.     /*----------------------------------------------------------------*/
  2486.     /* Code Body                                                      */
  2487.     /*----------------------------------------------------------------*/
  2488.     SetDelScrnIDCallbackHandler(SCR_CM_REQUESTINGUSSD, (HistoryDelCBPtr) NULL);
  2489.     DeleteScreenIfPresent(SCR_CM_REQUESTINGUSSD);
  2490. }
  2491. /*****************************************************************************
  2492.  * FUNCTION
  2493.  *  AbortUSSDRequest
  2494.  * DESCRIPTION
  2495.  *  Invokes the helper function to hangup or disconnect the call
  2496.  *  which is yet to connect.
  2497.  *  
  2498.  *  This is invoked whenever the User press LSK in the UssdReq screen.
  2499.  * PARAMETERS
  2500.  *  void
  2501.  * RETURNS
  2502.  *  void
  2503.  *****************************************************************************/
  2504. void AbortUSSDRequest(void)
  2505. {
  2506.     /*----------------------------------------------------------------*/
  2507.     /* Local Variables                                                */
  2508.     /*----------------------------------------------------------------*/
  2509.     /*----------------------------------------------------------------*/
  2510.     /* Code Body                                                      */
  2511.     /*----------------------------------------------------------------*/
  2512.     PRINT_INFORMATION(("*** In AbortUSSDRequest Requestn"));
  2513.     if (FALSE == GetAbortCallRequestedFlag())
  2514.     {
  2515.         SetAbortCallRequestedFlag(TRUE);
  2516.         MakePsDropUSSDReq(CBackDropUSSDReq);
  2517.     }
  2518.     else
  2519.     {
  2520.         PRINT_INFORMATION(("*** In AbortUSSDRequest Request .. Not sending ATHn"));
  2521.     }
  2522. }
  2523. /*****************************************************************************
  2524.  * FUNCTION
  2525.  *  AbortUSSDRequestEND
  2526.  * DESCRIPTION
  2527.  *  This is called when end key is pressed
  2528.  *  on USSD screen
  2529.  * PARAMETERS
  2530.  *  void
  2531.  * RETURNS
  2532.  *  void
  2533.  *****************************************************************************/
  2534. void AbortUSSDRequestEND(void)
  2535. {
  2536.     /*----------------------------------------------------------------*/
  2537.     /* Local Variables                                                */
  2538.     /*----------------------------------------------------------------*/
  2539.     /*----------------------------------------------------------------*/
  2540.     /* Code Body                                                      */
  2541.     /*----------------------------------------------------------------*/
  2542.     PRINT_INFORMATION(("*** In AbortUSSDRequest Requestn"));
  2543.     if (FALSE == GetAbortCallRequestedFlag())
  2544.     {
  2545.         SetAbortCallRequestedFlag(TRUE);
  2546.         MakePsDropUSSDReq(CBackDropUSSDReqEND);
  2547.     }
  2548.     else
  2549.     {
  2550.         PRINT_INFORMATION(("*** In AbortUSSDRequest Request .. Not sending ATHn"));
  2551.     }
  2552. }
  2553. /*****************************************************************************
  2554.  * FUNCTION
  2555.  *  ProcessUSSDrecieved
  2556.  * DESCRIPTION
  2557.  *  This function is called by the state machine function in
  2558.  *  response to the USSD data recieved by the MS
  2559.  * PARAMETERS
  2560.  *  info        [?]     
  2561.  * RETURNS
  2562.  *  void
  2563.  *****************************************************************************/
  2564. void ProcessUSSDrecieved(void *info)
  2565. {
  2566.     /*----------------------------------------------------------------*/
  2567.     /* Local Variables                                                */
  2568.     /*----------------------------------------------------------------*/
  2569.     /*----------------------------------------------------------------*/
  2570.     /* Code Body                                                      */
  2571.     /*----------------------------------------------------------------*/
  2572. #ifdef __USSD_GOBACK_IDLE__
  2573.     if (((MMI_SS_USSD_RSP*) info)->op_code == SS_OP_UNSTRUCTUREDSS_REQUEST)
  2574.     {
  2575.         RemoveSSReqScr();
  2576.         SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
  2577.         SetDelScrnIDCallbackHandler(ITEM_SCR_USSR_EDIT, (HistoryDelCBPtr) NULL);
  2578.         DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
  2579.         DeleteScreenIfPresent(ITEM_SCR_USSR_EDIT);
  2580.         GoBackHistory();
  2581.         return;
  2582.     }
  2583. #endif    
  2584.     
  2585.     if (((MMI_SS_USSD_RSP*) info)->result.flag == L4C_OK)
  2586.     {
  2587.         DeriveUSSDbuf(info);
  2588.         if (IsScreenPresent(SCR_CM_REQUESTINGUSSD))
  2589.         {
  2590.             HistoryReplace(SCR_CM_REQUESTINGUSSD, ITEM_SCR_USSN_MSG, EntryScrDisplayUSSDRes);
  2591.         }
  2592.         else
  2593.         {
  2594.             EntryScrDisplayUSSDRes();
  2595. #ifdef __MMI_RECEIVE_USSD_TONE__
  2596.             playRequestedTone(WARNING_TONE);
  2597. #endif             
  2598.         }
  2599.     }
  2600.     else
  2601.     {
  2602.         if (((GetCurrentState() != CM_OUTGOING_STATE) && (GetCurrentState() != CM_INCOMING_STATE)) ||
  2603.             (GetActiveScreenId() == SCR_CM_REQUESTINGUSSD))
  2604.         {
  2605.         #ifdef __MMI_SS_SHOW_CAUSE__
  2606.             EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, NULL, NULL);
  2607.             RemoveSSReqScr();
  2608.             ShowCauseString(((MMI_SS_USSD_RSP*) info)->result.cause, temp_string);
  2609.             ShowCategory74Screen(
  2610.                 STR_TITLE_SCR_USSD_MSG,
  2611.                 0,
  2612.                 STR_GLOBAL_OK,
  2613.                 IMG_GLOBAL_OK,
  2614.                 0,
  2615.                 0,
  2616.                 (PU8) temp_string,
  2617.                 pfnUnicodeStrlen(temp_string),
  2618.                 NULL);
  2619.             SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2620.         #else /* __MMI_SS_SHOW_CAUSE__ */ 
  2621.             DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
  2622.             RemoveSSReqScr();
  2623.         #endif /* __MMI_SS_SHOW_CAUSE__ */ 
  2624.         }
  2625.         else
  2626.         {
  2627.             DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
  2628.             RemoveSSReqScr();
  2629.         }
  2630.     }
  2631.     SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
  2632.     SetDelScrnIDCallbackHandler(ITEM_SCR_USSR_EDIT, (HistoryDelCBPtr) NULL);
  2633.     DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
  2634.     DeleteScreenIfPresent(ITEM_SCR_USSR_EDIT);
  2635. }