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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  *  VoIPCall.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *  MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *  Coding Template header file
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * removed!
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * removed!
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * removed!
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * removed!
  114.  *
  115.  * removed!
  116.  * removed!
  117.  * removed!
  118.  *
  119.  * removed!
  120.  * removed!
  121.  * removed!
  122.  *
  123.  * removed!
  124.  * removed!
  125.  * removed!
  126.  *
  127.  * removed!
  128.  * removed!
  129.  * removed!
  130.  *
  131.  * removed!
  132.  * removed!
  133.  * removed!
  134.  *
  135.  *------------------------------------------------------------------------------
  136.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  137.  *============================================================================
  138.  ****************************************************************************/
  139. #include "MMI_features.h"
  140. #ifdef __MMI_VOIP__
  141. #include "stdC.h"
  142. #include "L4Dr1.h"
  143. #include "DebugInitDef.h"
  144. #include "mmi_trc.h"    /* debug info */
  145. #include "GlobalMenuItems.h"
  146. #include "GlobalScrEnum.h"
  147. #include "CustMenuRes.h"
  148. #include "CustDataRes.h"
  149. #include "ProtocolEvents.h"
  150. #include "CommonScreens.h"
  151. #include "SettingProfile.h"
  152. #include "EventsGprot.h"
  153. #include "wgui_categories_popup.h"
  154. #include "wgui_categories_inputs.h"
  155. #include "wgui_categories_util.h"
  156. #include "NVRAMEnum.h"
  157. #include "NVRAMProt.h"
  158. #include "NVRAMType.h"
  159. #include "custom_nvram_editor_data_item.h"
  160. #include "custom_data_account.h"
  161. #ifdef __MMI_BT_HP_SUPPORT__
  162. #include "BTMMIHPGprots.h"
  163. #endif
  164. #ifdef __MMI_BT_SUPPORT__
  165. #include "BTMMIScrGprots.h"
  166. #endif
  167. #include "CallManagementGprot.h"
  168. #include "DateTimeGprot.h"
  169. #include "gpioInc.h"
  170. #include "KeyBrd.h"
  171. #include "ProfileGprots.h"
  172. #include "PhoneBookGprot.h"
  173. #include "TimerEvents.h"
  174. #include "wgui.h"
  175. #include "wgui_categories_CM.h"
  176. #include "wgui_status_icons.h"
  177. #include "VoIPDef.h"
  178. #include "VoIPGProt.h"
  179. #include "VoIPProt.h"
  180. /*****************************************************************************
  181.  * FUNCTION
  182.  *  mmi_voip_highlight_new_call
  183.  * DESCRIPTION
  184.  *  Highlight handler of VoIPNew Call
  185.  * PARAMETERS
  186.  *  void
  187.  * RETURNS
  188.  *  void
  189.  *****************************************************************************/
  190. void mmi_voip_highlight_new_call(void)
  191. {
  192.     /*----------------------------------------------------------------*/
  193.     /* Local Variables                                                */
  194.     /*----------------------------------------------------------------*/
  195.     /*----------------------------------------------------------------*/
  196.     /* Code Body                                                      */
  197.     /*----------------------------------------------------------------*/
  198.     memset(g_voip_cntx_p->call_misc_info.dispUri, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  199.     memset(g_voip_cntx_p->call_misc_info.inputUri, 0, VOIP_URI_LEN);
  200.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  201.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  202.     SetLeftSoftkeyFunction(mmi_voip_entry_new_call, KEY_EVENT_UP);
  203.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  204. }
  205. /*****************************************************************************
  206.  * FUNCTION
  207.  *  mmi_voip_highlight_dial
  208.  * DESCRIPTION
  209.  *  Highlight handler of VoIPNew CallOptionDial
  210.  * PARAMETERS
  211.  *  void
  212.  * RETURNS
  213.  *  void
  214.  *****************************************************************************/
  215. void mmi_voip_highlight_dial(void)
  216. {
  217.     /*----------------------------------------------------------------*/
  218.     /* Local Variables                                                */
  219.     /*----------------------------------------------------------------*/
  220.     /*----------------------------------------------------------------*/
  221.     /* Code Body                                                      */
  222.     /*----------------------------------------------------------------*/
  223.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  224.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  225.     SetLeftSoftkeyFunction(mmi_voip_pre_dial, KEY_EVENT_UP);
  226.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  227. }
  228. /*****************************************************************************
  229.  * FUNCTION
  230.  *  mmi_voip_highlight_save_phonebook
  231.  * DESCRIPTION
  232.  *  Highlight handler of VoIPNew CallOptionSave to Phonebook
  233.  * PARAMETERS
  234.  *  void
  235.  * RETURNS
  236.  *  void
  237.  *****************************************************************************/
  238. void mmi_voip_highlight_save_phonebook(void)
  239. {
  240.     /*----------------------------------------------------------------*/
  241.     /* Local Variables                                                */
  242.     /*----------------------------------------------------------------*/
  243.     /*----------------------------------------------------------------*/
  244.     /* Code Body                                                      */
  245.     /*----------------------------------------------------------------*/
  246.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  247.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  248.     SetLeftSoftkeyFunction(mmi_voip_entry_save_phonebook, KEY_EVENT_UP);
  249.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  250. }
  251. /*****************************************************************************
  252.  * FUNCTION
  253.  *  mmi_voip_highlight_input_method_in_call
  254.  * DESCRIPTION
  255.  *  Highlight handler of VoIPNew CallOptionInput Method
  256.  * PARAMETERS
  257.  *  void
  258.  * RETURNS
  259.  *  void
  260.  *****************************************************************************/
  261. void mmi_voip_highlight_input_method_in_call(void)
  262. {
  263.     /*----------------------------------------------------------------*/
  264.     /* Local Variables                                                */
  265.     /*----------------------------------------------------------------*/
  266.     /*----------------------------------------------------------------*/
  267.     /* Code Body                                                      */
  268.     /*----------------------------------------------------------------*/
  269.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  270.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  271.     SetLeftSoftkeyFunction(EntryAPRequiredInputMethodScreen, KEY_EVENT_UP);
  272.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  273.     RegisterInputMethodScreenCloseFunction(mmi_voip_go_back_2_history);
  274. }
  275. /*****************************************************************************
  276.  * FUNCTION
  277.  *  mmi_voip_highlight_sos
  278.  * DESCRIPTION
  279.  *  Highlight handler of VoIPNew CallOptionSOS
  280.  * PARAMETERS
  281.  *  void
  282.  * RETURNS
  283.  *  void
  284.  *****************************************************************************/
  285. void mmi_voip_highlight_sos(void)
  286. {
  287.     /*----------------------------------------------------------------*/
  288.     /* Local Variables                                                */
  289.     /*----------------------------------------------------------------*/
  290.     /*----------------------------------------------------------------*/
  291.     /* Code Body                                                      */
  292.     /*----------------------------------------------------------------*/
  293.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  294.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  295.     SetLeftSoftkeyFunction(mmi_voip_entry_sos, KEY_EVENT_UP);
  296.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  297. }
  298. /*****************************************************************************
  299.  * FUNCTION
  300.  *  mmi_voip_highlight_hold_single
  301.  * DESCRIPTION
  302.  *  Highlight handler of Call OptionHold Single
  303.  * PARAMETERS
  304.  *  void
  305.  * RETURNS
  306.  *  void
  307.  *****************************************************************************/
  308. void mmi_voip_highlight_hold_single(void)
  309. {
  310.     /*----------------------------------------------------------------*/
  311.     /* Local Variables                                                */
  312.     /*----------------------------------------------------------------*/
  313.     /*----------------------------------------------------------------*/
  314.     /* Code Body                                                      */
  315.     /*----------------------------------------------------------------*/
  316.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  317.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  318.     SetLeftSoftkeyFunction(mmi_voip_entry_hold_single, KEY_EVENT_UP);
  319.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  320. }
  321. /*****************************************************************************
  322.  * FUNCTION
  323.  *  mmi_voip_highlight_hold_conference
  324.  * DESCRIPTION
  325.  *  Highlight handler of Call OptionHold Conference
  326.  * PARAMETERS
  327.  *  void
  328.  * RETURNS
  329.  *  void
  330.  *****************************************************************************/
  331. void mmi_voip_highlight_hold_conference(void)
  332. {
  333.     /*----------------------------------------------------------------*/
  334.     /* Local Variables                                                */
  335.     /*----------------------------------------------------------------*/
  336.     /*----------------------------------------------------------------*/
  337.     /* Code Body                                                      */
  338.     /*----------------------------------------------------------------*/
  339.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  340.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  341.     SetLeftSoftkeyFunction(mmi_voip_entry_hold_conference, KEY_EVENT_UP);
  342.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  343. }
  344. /*****************************************************************************
  345.  * FUNCTION
  346.  *  mmi_voip_highlight_retrieve_single
  347.  * DESCRIPTION
  348.  *  Highlight handler of Call OptionRetrieve Single
  349.  * PARAMETERS
  350.  *  void
  351.  * RETURNS
  352.  *  void
  353.  *****************************************************************************/
  354. void mmi_voip_highlight_retrieve_single(void)
  355. {
  356.     /*----------------------------------------------------------------*/
  357.     /* Local Variables                                                */
  358.     /*----------------------------------------------------------------*/
  359.     /*----------------------------------------------------------------*/
  360.     /* Code Body                                                      */
  361.     /*----------------------------------------------------------------*/
  362.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  363.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  364.     SetLeftSoftkeyFunction(mmi_voip_entry_retrieve_single, KEY_EVENT_UP);
  365.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  366. }
  367. /*****************************************************************************
  368.  * FUNCTION
  369.  *  mmi_voip_highlight_retrieve_conference
  370.  * DESCRIPTION
  371.  *  Highlight handler of Call OptionRetrieve Conference
  372.  * PARAMETERS
  373.  *  void
  374.  * RETURNS
  375.  *  void
  376.  *****************************************************************************/
  377. void mmi_voip_highlight_retrieve_conference(void)
  378. {
  379.     /*----------------------------------------------------------------*/
  380.     /* Local Variables                                                */
  381.     /*----------------------------------------------------------------*/
  382.     /*----------------------------------------------------------------*/
  383.     /* Code Body                                                      */
  384.     /*----------------------------------------------------------------*/
  385.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  386.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  387.     SetLeftSoftkeyFunction(mmi_voip_entry_retrieve_conference, KEY_EVENT_UP);
  388.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  389. }
  390. /*****************************************************************************
  391.  * FUNCTION
  392.  *  mmi_voip_highlight_swap
  393.  * DESCRIPTION
  394.  *  Highlight handler of Call OptionSwap
  395.  * PARAMETERS
  396.  *  void
  397.  * RETURNS
  398.  *  void
  399.  *****************************************************************************/
  400. void mmi_voip_highlight_swap(void)
  401. {
  402.     /*----------------------------------------------------------------*/
  403.     /* Local Variables                                                */
  404.     /*----------------------------------------------------------------*/
  405.     /*----------------------------------------------------------------*/
  406.     /* Code Body                                                      */
  407.     /*----------------------------------------------------------------*/
  408.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  409.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  410.     SetLeftSoftkeyFunction(mmi_voip_entry_swap, KEY_EVENT_UP);
  411.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  412. }
  413. /*****************************************************************************
  414.  * FUNCTION
  415.  *  mmi_voip_highlight_conference
  416.  * DESCRIPTION
  417.  *  Highlight handler of Call OptionConference
  418.  * PARAMETERS
  419.  *  void
  420.  * RETURNS
  421.  *  void
  422.  *****************************************************************************/
  423. void mmi_voip_highlight_conference(void)
  424. {
  425.     /*----------------------------------------------------------------*/
  426.     /* Local Variables                                                */
  427.     /*----------------------------------------------------------------*/
  428.     /*----------------------------------------------------------------*/
  429.     /* Code Body                                                      */
  430.     /*----------------------------------------------------------------*/
  431.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  432.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  433.     SetLeftSoftkeyFunction(mmi_voip_entry_conference, KEY_EVENT_UP);
  434.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  435. }
  436. /*****************************************************************************
  437.  * FUNCTION
  438.  *  mmi_voip_highlight_split
  439.  * DESCRIPTION
  440.  *  Highlight handler of Call OptionSplit
  441.  * PARAMETERS
  442.  *  void
  443.  * RETURNS
  444.  *  void
  445.  *****************************************************************************/
  446. void mmi_voip_highlight_split(void)
  447. {
  448.     /*----------------------------------------------------------------*/
  449.     /* Local Variables                                                */
  450.     /*----------------------------------------------------------------*/
  451.     /*----------------------------------------------------------------*/
  452.     /* Code Body                                                      */
  453.     /*----------------------------------------------------------------*/
  454.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  455.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  456.     SetLeftSoftkeyFunction(mmi_voip_entry_split, KEY_EVENT_UP);
  457.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  458. }
  459. /*****************************************************************************
  460.  * FUNCTION
  461.  *  mmi_voip_highlight_end_single
  462.  * DESCRIPTION
  463.  *  Highlight handler of Call OptionEnd Single
  464.  * PARAMETERS
  465.  *  void
  466.  * RETURNS
  467.  *  void
  468.  *****************************************************************************/
  469. void mmi_voip_highlight_end_single(void)
  470. {
  471.     /*----------------------------------------------------------------*/
  472.     /* Local Variables                                                */
  473.     /*----------------------------------------------------------------*/
  474.     /*----------------------------------------------------------------*/
  475.     /* Code Body                                                      */
  476.     /*----------------------------------------------------------------*/
  477.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  478.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  479.     SetLeftSoftkeyFunction(mmi_voip_entry_end_single, KEY_EVENT_UP);
  480.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  481. }
  482. /*****************************************************************************
  483.  * FUNCTION
  484.  *  mmi_voip_highlight_end_conference
  485.  * DESCRIPTION
  486.  *  Highlight handler of Call OptionEnd Conference
  487.  * PARAMETERS
  488.  *  void
  489.  * RETURNS
  490.  *  void
  491.  *****************************************************************************/
  492. void mmi_voip_highlight_end_conference(void)
  493. {
  494.     /*----------------------------------------------------------------*/
  495.     /* Local Variables                                                */
  496.     /*----------------------------------------------------------------*/
  497.     /*----------------------------------------------------------------*/
  498.     /* Code Body                                                      */
  499.     /*----------------------------------------------------------------*/
  500.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  501.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  502.     SetLeftSoftkeyFunction(mmi_voip_entry_end_conference, KEY_EVENT_UP);
  503.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  504. }
  505. /*****************************************************************************
  506.  * FUNCTION
  507.  *  mmi_voip_highlight_end_all
  508.  * DESCRIPTION
  509.  *  Highlight handler of Call OptionEnd All
  510.  * PARAMETERS
  511.  *  void
  512.  * RETURNS
  513.  *  void
  514.  *****************************************************************************/
  515. void mmi_voip_highlight_end_all(void)
  516. {
  517.     /*----------------------------------------------------------------*/
  518.     /* Local Variables                                                */
  519.     /*----------------------------------------------------------------*/
  520.     /*----------------------------------------------------------------*/
  521.     /* Code Body                                                      */
  522.     /*----------------------------------------------------------------*/
  523.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  524.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  525.     SetLeftSoftkeyFunction(mmi_voip_entry_end_all, KEY_EVENT_UP);
  526.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  527. }
  528. /*****************************************************************************
  529.  * FUNCTION
  530.  *  mmi_voip_highlight_transfer
  531.  * DESCRIPTION
  532.  *  Highlight handler of Call OptionTransfer
  533.  * PARAMETERS
  534.  *  void
  535.  * RETURNS
  536.  *  void
  537.  *****************************************************************************/
  538. void mmi_voip_highlight_transfer(void)
  539. {
  540.     /*----------------------------------------------------------------*/
  541.     /* Local Variables                                                */
  542.     /*----------------------------------------------------------------*/
  543.     /*----------------------------------------------------------------*/
  544.     /* Code Body                                                      */
  545.     /*----------------------------------------------------------------*/
  546.     memset(g_voip_cntx_p->call_misc_info.dispUri, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  547.     memset(g_voip_cntx_p->call_misc_info.inputUri, 0, VOIP_URI_LEN);
  548.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  549.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  550.     SetLeftSoftkeyFunction(mmi_voip_entry_transfer, KEY_EVENT_UP);
  551.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  552. }
  553. /*****************************************************************************
  554.  * FUNCTION
  555.  *  mmi_voip_highlight_phonebook
  556.  * DESCRIPTION
  557.  *  Highlight handler of Call OptionPhonebook
  558.  * PARAMETERS
  559.  *  void
  560.  * RETURNS
  561.  *  void
  562.  *****************************************************************************/
  563. void mmi_voip_highlight_phonebook(void)
  564. {
  565.     /*----------------------------------------------------------------*/
  566.     /* Local Variables                                                */
  567.     /*----------------------------------------------------------------*/
  568.     /*----------------------------------------------------------------*/
  569.     /* Code Body                                                      */
  570.     /*----------------------------------------------------------------*/
  571.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  572.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  573.     SetLeftSoftkeyFunction(mmi_phb_call_enter_from_active_call, KEY_EVENT_UP);
  574.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  575. }
  576. /*****************************************************************************
  577.  * FUNCTION
  578.  *  mmi_voip_highlight_mute
  579.  * DESCRIPTION
  580.  *  Highlight handler of Call OptionMute
  581.  * PARAMETERS
  582.  *  void
  583.  * RETURNS
  584.  *  void
  585.  *****************************************************************************/
  586. void mmi_voip_highlight_mute(void)
  587. {
  588.     /*----------------------------------------------------------------*/
  589.     /* Local Variables                                                */
  590.     /*----------------------------------------------------------------*/
  591.     /*----------------------------------------------------------------*/
  592.     /* Code Body                                                      */
  593.     /*----------------------------------------------------------------*/
  594.     if (g_voip_cntx_p->call_misc_info.isMute == TRUE)
  595.     {
  596.         ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_GLOBAL_OK);
  597.     }
  598.     else
  599.     {
  600.         ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_GLOBAL_OK);
  601.     }
  602.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  603.     SetLeftSoftkeyFunction(mmi_voip_set_mute, KEY_EVENT_UP);
  604.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  605. }
  606. /*****************************************************************************
  607.  * FUNCTION
  608.  *  mmi_voip_highlight_dtmf_in_call
  609.  * DESCRIPTION
  610.  *  Highlight handler of Call OptionDTMF
  611.  * PARAMETERS
  612.  *  void
  613.  * RETURNS
  614.  *  void
  615.  *****************************************************************************/
  616. void mmi_voip_highlight_dtmf_in_call(void)
  617. {
  618.     /*----------------------------------------------------------------*/
  619.     /* Local Variables                                                */
  620.     /*----------------------------------------------------------------*/
  621.     /*----------------------------------------------------------------*/
  622.     /* Code Body                                                      */
  623.     /*----------------------------------------------------------------*/
  624.     if (g_voip_cntx_p->call_misc_info.isDtmf == TRUE)
  625.     {
  626.         ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_GLOBAL_OK);
  627.     }
  628.     else
  629.     {
  630.         ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_GLOBAL_OK);
  631.     }
  632.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  633.     SetLeftSoftkeyFunction(mmi_voip_set_dtmf_in_call, KEY_EVENT_UP);
  634.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  635. }
  636. /*****************************************************************************
  637.  * FUNCTION
  638.  *  mmi_voip_hint_mute
  639.  * DESCRIPTION
  640.  *  Hint handler of Call OptionMute
  641.  * PARAMETERS
  642.  *  index       [IN]        Current selected index
  643.  * RETURNS
  644.  *  void
  645.  *****************************************************************************/
  646. void mmi_voip_hint_mute(U16 index)
  647. {
  648.     /*----------------------------------------------------------------*/
  649.     /* Local Variables                                                */
  650.     /*----------------------------------------------------------------*/
  651.     /*----------------------------------------------------------------*/
  652.     /* Code Body                                                      */
  653.     /*----------------------------------------------------------------*/
  654.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  655.     if (g_voip_cntx_p->call_misc_info.isMute == TRUE)
  656.     {
  657.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_ON));
  658.     }
  659.     else
  660.     {
  661.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
  662.     }
  663. }
  664. /*****************************************************************************
  665.  * FUNCTION
  666.  *  mmi_voip_hint_dtmf_in_call
  667.  * DESCRIPTION
  668.  *  Hint handler of Call OptionDTMF
  669.  * PARAMETERS
  670.  *  index       [IN]        Current selected index
  671.  * RETURNS
  672.  *  void
  673.  *****************************************************************************/
  674. void mmi_voip_hint_dtmf_in_call(U16 index)
  675. {
  676.     /*----------------------------------------------------------------*/
  677.     /* Local Variables                                                */
  678.     /*----------------------------------------------------------------*/
  679.     /*----------------------------------------------------------------*/
  680.     /* Code Body                                                      */
  681.     /*----------------------------------------------------------------*/
  682.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  683.     if (g_voip_cntx_p->call_misc_info.isDtmf == TRUE)
  684.     {
  685.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_ON));
  686.     }
  687.     else
  688.     {
  689.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
  690.     }
  691. }
  692. /*****************************************************************************
  693.  * FUNCTION
  694.  *  mmi_voip_entry_login_confirm
  695.  * DESCRIPTION
  696.  *  Login confirmation screen before dialing.
  697.  * PARAMETERS
  698.  *  void
  699.  * RETURNS
  700.  *  void
  701.  *****************************************************************************/
  702. void mmi_voip_entry_login_confirm(void)
  703. {
  704.     /*----------------------------------------------------------------*/
  705.     /* Local Variables                                                */
  706.     /*----------------------------------------------------------------*/
  707.     /*----------------------------------------------------------------*/
  708.     /* Code Body                                                      */
  709.     /*----------------------------------------------------------------*/
  710.     DisplayConfirm(
  711.         STR_GLOBAL_YES,
  712.         IMG_GLOBAL_YES,
  713.         STR_GLOBAL_NO,
  714.         IMG_GLOBAL_NO,
  715.         get_string(STR_ID_VOIP_LOGIN),
  716.         IMG_GLOBAL_QUESTION,
  717.         WARNING_TONE);
  718.     SetLeftSoftkeyFunction(mmi_voip_entry_status, KEY_EVENT_UP);
  719.     SetRightSoftkeyFunction(mmi_voip_go_back_to_call_editor, KEY_EVENT_UP);
  720. }
  721. /*****************************************************************************
  722.  * FUNCTION
  723.  *  mmi_voip_go_back_to_call_editor
  724.  * DESCRIPTION
  725.  *  Go back to call editor screen.
  726.  * PARAMETERS
  727.  *  void
  728.  * RETURNS
  729.  *  void
  730.  *****************************************************************************/
  731. void mmi_voip_go_back_to_call_editor(void)
  732. {
  733.     /*----------------------------------------------------------------*/
  734.     /* Local Variables                                                */
  735.     /*----------------------------------------------------------------*/
  736.     /*----------------------------------------------------------------*/
  737.     /* Code Body                                                      */
  738.     /*----------------------------------------------------------------*/
  739.     DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION);
  740.     GoBackHistory();
  741. }
  742. /*****************************************************************************
  743.  * FUNCTION
  744.  *  mmi_voip_entry_new_call
  745.  * DESCRIPTION
  746.  *  Entry function of VoIPNew Call
  747.  * PARAMETERS
  748.  *  void
  749.  * RETURNS
  750.  *  void
  751.  *****************************************************************************/
  752. void mmi_voip_entry_new_call(void)
  753. {
  754.     /*----------------------------------------------------------------*/
  755.     /* Local Variables                                                */
  756.     /*----------------------------------------------------------------*/
  757.     U8 *guiBuffer = NULL;
  758.     /*----------------------------------------------------------------*/
  759.     /* Code Body                                                      */
  760.     /*----------------------------------------------------------------*/
  761.     EntryNewScreen(SCR_ID_VOIP_CALL_EDITOR, NULL, mmi_voip_entry_new_call, NULL);
  762.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_CALL_EDITOR);
  763.     ShowCategory404Screen(
  764.         STR_GLOBAL_OPTIONS,
  765.         IMG_GLOBAL_OPTIONS,
  766.         STR_GLOBAL_BACK,
  767.         IMG_GLOBAL_BACK,
  768.         IMG_ID_VOIP_CALL_EDITOR,
  769.         g_voip_cntx_p->call_misc_info.dispUri,
  770.         VOIP_URI_LEN,
  771.         guiBuffer);
  772.     SetLeftSoftkeyFunction(mmi_voip_entry_call_editor_option, KEY_EVENT_UP);
  773.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  774.     SetKeyHandler(mmi_voip_pre_dial, KEY_SEND, KEY_EVENT_DOWN);
  775.     SetKeyHandler(mmi_voip_entry_in_call_endkey, KEY_END, KEY_EVENT_DOWN);
  776.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  777.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  778.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  779. }
  780. /*****************************************************************************
  781.  * FUNCTION
  782.  *  mmi_voip_entry_call_editor_option
  783.  * DESCRIPTION
  784.  *  Entry function of VoIPNew CallOption
  785.  * PARAMETERS
  786.  *  void
  787.  * RETURNS
  788.  *  void
  789.  *****************************************************************************/
  790. void mmi_voip_entry_call_editor_option(void)
  791. {
  792.     /*----------------------------------------------------------------*/
  793.     /* Local Variables                                                */
  794.     /*----------------------------------------------------------------*/
  795.     U8 *guiBuffer = NULL;
  796.     U16 numItems = 0;
  797.     U16 nStrItemList[MAX_SUB_MENUS];    /* Dial, Save to Phonebook, Input Method, SOS */
  798.     /*----------------------------------------------------------------*/
  799.     /* Code Body                                                      */
  800.     /*----------------------------------------------------------------*/
  801.     EntryNewScreen(SCR_ID_VOIP_CALL_EDITOR_OPTION, NULL, mmi_voip_entry_call_editor_option, NULL);
  802.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_CALL_EDITOR_OPTION);
  803.     SetParentHandler(MENU_ID_VOIP_CALL_EDITOR_OPTION);
  804.     numItems = GetNumOfChild(MENU_ID_VOIP_CALL_EDITOR_OPTION);
  805.     GetSequenceStringIds(MENU_ID_VOIP_CALL_EDITOR_OPTION, nStrItemList);
  806.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  807.     ShowCategory52Screen(
  808.         STR_GLOBAL_OPTIONS,
  809.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  810.         STR_GLOBAL_OK,
  811.         IMG_GLOBAL_OK,
  812.         STR_GLOBAL_BACK,
  813.         IMG_GLOBAL_BACK,
  814.         numItems,
  815.         nStrItemList,
  816.         (U16*) gIndexIconsImageList,
  817.         NULL,
  818.         0,
  819.         0,
  820.         guiBuffer);
  821.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  822.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  823.     /* ensure at least one call exists, otherwise side key behavior should be the same as up/down arrow */
  824.     if (g_voip_cntx_p->call_list_info.numTotal > 0)
  825.     {
  826.         /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  827.         SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  828.         SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  829.     }    
  830. }
  831. /*****************************************************************************
  832.  * FUNCTION
  833.  *  mmi_voip_entry_outgoing_call
  834.  * DESCRIPTION
  835.  *  Entry function of outgoing call screen.
  836.  * PARAMETERS
  837.  *  void
  838.  * RETURNS
  839.  *  void
  840.  *****************************************************************************/
  841. void mmi_voip_entry_outgoing_call(void)
  842. {
  843.     /*----------------------------------------------------------------*/
  844.     /* Local Variables                                                */
  845.     /*----------------------------------------------------------------*/
  846.     U8 *guiBuffer = NULL;
  847.     /*----------------------------------------------------------------*/
  848.     /* Code Body                                                      */
  849.     /*----------------------------------------------------------------*/
  850.     EntryNewScreen(SCR_ID_VOIP_OUTGOING_CALL, NULL, mmi_voip_entry_outgoing_call, NULL);
  851.     DeleteScreenIfPresent(SCR_ID_VOIP_OUTGOING_CALL);   /* ensure no two outgoing call screens in the history */
  852.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_OUTGOING_CALL);
  853.     memset(g_voip_cntx_p->call_misc_info.dispUri, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  854.     AnsiiNToUnicodeString(
  855.         (S8*)g_voip_cntx_p->call_misc_info.dispUri,
  856.         (S8*)g_voip_cntx_p->call_misc_info.inputUri,
  857.         VOIP_URI_LEN);
  858.     mmi_voip_get_outgoing_disp_name(
  859.         MMI_VOIP_PHB|MMI_VOIP_HISTORY|MMI_VOIP_SOS, 
  860.         g_voip_cntx_p->call_misc_info.dispUri, 
  861.         g_voip_cntx_p->call_misc_info.dispUri, 
  862.         VOIP_URI_LEN);
  863.     ShowCategory18Screen(
  864.         0,
  865.         0,
  866.         0,
  867.         STR_GLOBAL_ABORT,
  868.         0,
  869.         STR_ID_VOIP_CALLING,
  870.         g_voip_cntx_p->call_misc_info.dispUri,
  871.         NULL,
  872.         0,
  873.         IMG_ID_VOIP_OUTGOING_CALL,
  874.         NULL,
  875.         FALSE,
  876.         guiBuffer);
  877.     SetRightSoftkeyFunction(mmi_voip_entry_abort_call, KEY_EVENT_UP);
  878.     SetKeyHandler(mmi_voip_entry_abort_call, KEY_END, KEY_EVENT_DOWN);
  879.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  880.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  881.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  882. }
  883. /*****************************************************************************
  884.  * FUNCTION
  885.  *  mmi_voip_entry_redialing_call
  886.  * DESCRIPTION
  887.  *  Entry function of redial call screen.
  888.  * PARAMETERS
  889.  *  void
  890.  * RETURNS
  891.  *  void
  892.  *****************************************************************************/
  893. void mmi_voip_entry_redialing_call(void)
  894. {
  895.     /*----------------------------------------------------------------*/
  896.     /* Local Variables                                                */
  897.     /*----------------------------------------------------------------*/
  898.     U8 *guiBuffer = NULL;
  899.     
  900.     /*----------------------------------------------------------------*/
  901.     /* Code Body                                                      */
  902.     /*----------------------------------------------------------------*/
  903.     EntryNewScreen(SCR_ID_VOIP_REDIALING_CALL, NULL, mmi_voip_entry_redialing_call, NULL);
  904.     DeleteScreenIfPresent(SCR_ID_VOIP_REDIALING_CALL);   /* ensure no two redialing call screens in the history */
  905.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_REDIALING_CALL);
  906.     memset(g_voip_cntx_p->call_redial_info.redialStr, 0, MMI_VOIP_MAX_STRING_LEN);
  907.     mmi_voip_get_redial_string((U8*)g_voip_cntx_p->call_redial_info.redialStr);
  908.     ShowCategory18Screen(
  909.         0,
  910.         0,
  911.         0,
  912.         STR_GLOBAL_ABORT,
  913.         0,
  914.         STR_ID_VOIP_REDIALING,
  915.         (U8*)g_voip_cntx_p->call_redial_info.redialStr,
  916.         NULL,
  917.         0,
  918.         IMG_ID_VOIP_OUTGOING_CALL,
  919.         NULL,
  920.         FALSE,
  921.         guiBuffer);
  922.     SetRightSoftkeyFunction(mmi_voip_entry_abort_redial, KEY_EVENT_UP);
  923.     SetKeyHandler(mmi_voip_entry_abort_redial, KEY_END, KEY_EVENT_DOWN);
  924.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  925.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  926.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  927. }
  928. /*****************************************************************************
  929.  * FUNCTION
  930.  *  mmi_voip_entry_incoming_call
  931.  * DESCRIPTION
  932.  *  Entry function of incoming call screen.
  933.  * PARAMETERS
  934.  *  void
  935.  * RETURNS
  936.  *  void
  937.  *****************************************************************************/
  938. void mmi_voip_entry_incoming_call(void)
  939. {
  940.     /*----------------------------------------------------------------*/
  941.     /* Local Variables                                                */
  942.     /*----------------------------------------------------------------*/
  943.     U8 *guiBuffer = NULL;
  944.     S32 callId = 0, callIndex = 0;
  945.     /*----------------------------------------------------------------*/
  946.     /* Code Body                                                      */
  947.     /*----------------------------------------------------------------*/
  948.     EntryNewScreen(SCR_ID_VOIP_INCOMING_CALL, NULL, mmi_voip_entry_incoming_call, NULL);
  949.     DeleteScreenIfPresent(SCR_ID_VOIP_INCOMING_CALL);   /* ensure no two incoming call screens in the history */
  950.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_INCOMING_CALL);
  951.     callId = mmi_voip_get_incoming_call_id();
  952.     callIndex = mmi_voip_get_call_index(callId);
  953.     memset((S8*) subMenuData[0], 0, MAX_SUB_MENU_SIZE);
  954.     if (pfnUnicodeStrlen((S8*) g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[0].dispName) != 0)
  955.     {
  956.         pfnUnicodeStrncpy(
  957.             (S8*) subMenuData[0],
  958.             (S8*) g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[0].dispName,
  959.             VOIP_DISP_NAME_LEN);
  960.     }
  961.     else
  962.     {
  963.         AnsiiNToUnicodeString(
  964.             (S8*) subMenuData[0],
  965.             (S8*) g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[0].remoteUri,
  966.             (MAX_SUBMENU_CHARACTERS - 1));
  967.     }
  968.     ShowCategory18Screen(
  969.         0,
  970.         STR_ID_VOIP_ANSWER,
  971.         0,
  972.         STR_ID_VOIP_REJECT,
  973.         0,
  974.         STR_ID_VOIP_RINGING,
  975.         (U8*) subMenuData[0],
  976.         NULL,
  977.         0,
  978.         IMG_ID_VOIP_INCOMING_CALL,
  979.         NULL,
  980.         FALSE,
  981.         guiBuffer);
  982.     /* any key answer is only applicable to the first incoming call, both for voip and gsm */
  983.     if ((g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer == 1) && 
  984.         (g_voip_cntx_p->call_list_info.numTotal == 1) && (GetTotalCallCount() == 0))
  985.     {
  986.         SetGroupKeyHandler(mmi_voip_entry_answer_call, (U16*)PresentAllKeys, TOTAL_KEYS, KEY_EVENT_DOWN);
  987.     }
  988.     SetLeftSoftkeyFunction(mmi_voip_entry_answer_call, KEY_EVENT_UP);
  989.     SetRightSoftkeyFunction(mmi_voip_entry_reject_call, KEY_EVENT_UP);
  990.     SetKeyHandler(mmi_voip_entry_answer_call, KEY_SEND, KEY_EVENT_DOWN);
  991.     SetKeyHandler(mmi_voip_entry_reject_call, KEY_END, KEY_EVENT_DOWN);
  992.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  993.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  994.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  995.     // mmi_voip_play_incoming_tone();
  996. }
  997. /*****************************************************************************
  998.  * FUNCTION
  999.  *  mmi_voip_entry_in_call
  1000.  * DESCRIPTION
  1001.  *  Entry function of in call screen.
  1002.  * PARAMETERS
  1003.  *  void
  1004.  * RETURNS
  1005.  *  void
  1006.  *****************************************************************************/
  1007. void mmi_voip_entry_in_call(void)
  1008. {
  1009.     /*----------------------------------------------------------------*/
  1010.     /* Local Variables                                                */
  1011.     /*----------------------------------------------------------------*/
  1012.     U8 *guiBuffer = NULL;
  1013.     U16 rskStr = 0, numItems = 0;
  1014.     S32 currhiliteTab = 0, i = 0, j = 0;
  1015.     MYTIME currTime, duration;
  1016.     /*----------------------------------------------------------------*/
  1017.     /* Code Body                                                      */
  1018.     /*----------------------------------------------------------------*/
  1019.     EntryNewScreen(SCR_ID_VOIP_IN_CALL, mmi_voip_exit_in_call, mmi_voip_entry_in_call, NULL);
  1020.     DeleteScreenIfPresent(SCR_ID_VOIP_IN_CALL); /* ensure no two active call screens in the history */
  1021.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_IN_CALL);
  1022. #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
  1023.     if (mmi_bt_is_incall_aud_swap2bt() != MMI_TRUE)
  1024. #endif
  1025.     {
  1026.         rskStr = (g_voip_cntx_p->call_misc_info.isLoud == TRUE) ? (STR_ID_VOIP_HAND_HELD) : (STR_ID_VOIP_HAND_FREE);
  1027.     }
  1028.     for (i = 0; i < g_voip_cntx_p->call_list_info.numTotal; i++)
  1029.     {
  1030.         if (g_voip_cntx_p->call_list_info.call_info[i].currState == MMI_VOIP_ACTIVE_STATE)
  1031.         {
  1032.             MMI_tab_bar_items[i].icon = get_image(IMG_ID_VOIP_CALL_STATE_ACTIVE);
  1033.         }
  1034.         else if (g_voip_cntx_p->call_list_info.call_info[i].currState == MMI_VOIP_HOLD_STATE)
  1035.         {
  1036.             MMI_tab_bar_items[i].icon = get_image(IMG_ID_VOIP_CALL_STATE_HOLD);
  1037.         }
  1038.         else
  1039.         {
  1040.             PRINT_INFORMATION(("n[mmi_voip_entry_in_call] Call State should either MMI_VOIP_ACTIVE_STATE or MMI_VOIP_HOLD_STATEn"));
  1041.         }
  1042.         MMI_tab_bar_items[i].text = NULL;
  1043.         MMI_tab_bar_items[i].flags = 0; /* no blink */
  1044.     }
  1045.     currhiliteTab = g_voip_cntx_p->call_misc_info.currhiliteTab;
  1046.     DTGetRTCTime(&currTime);
  1047.     for (i = 0; i < g_voip_cntx_p->call_list_info.numTotal; i++)
  1048.     {
  1049.         for (j = 0; j < g_voip_cntx_p->call_list_info.call_info[i].numDialog; j++)
  1050.         {
  1051.             if ((i == currhiliteTab) && (j == 0))   /* only display duration of the first dialog */
  1052.             {
  1053.                 numItems = g_voip_cntx_p->call_list_info.call_info[i].numDialog;
  1054.                 /* overflow 2030/12/31/23:59:59 */
  1055.                 if (g_voip_cntx_p->call_list_info.call_info[i].dialog_info[j].startTime.nYear == 2030 && 
  1056.                     currTime.nYear < g_voip_cntx_p->call_list_info.call_info[i].dialog_info[j].startTime.nYear)
  1057.                 {
  1058.                     currTime.nYear = g_voip_cntx_p->call_list_info.call_info[i].dialog_info[j].startTime.nYear;
  1059.                     currTime.nMonth = g_voip_cntx_p->call_list_info.call_info[i].dialog_info[j].startTime.nMonth;
  1060.                     currTime.nDay = g_voip_cntx_p->call_list_info.call_info[i].dialog_info[j].startTime.nDay + 1;
  1061.                 }
  1062.                 GetTimeDifference(
  1063.                     &currTime,
  1064.                     &g_voip_cntx_p->call_list_info.call_info[i].dialog_info[j].startTime,
  1065.                     &duration);
  1066.             }
  1067.         }
  1068.     }
  1069.     for (i = 0; i < numItems; i++)
  1070.     {
  1071.         subMenuDataPtrs[i] = subMenuData[i];
  1072.         memset((S8*)subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
  1073.         if (pfnUnicodeStrlen((S8*)g_voip_cntx_p->call_list_info.call_info[currhiliteTab].dialog_info[i].dispName) != 0)
  1074.         {
  1075.             pfnUnicodeStrncpy(
  1076.                 (S8*)subMenuDataPtrs[i],
  1077.                 (S8*)g_voip_cntx_p->call_list_info.call_info[currhiliteTab].dialog_info[i].dispName,
  1078.                 VOIP_DISP_NAME_LEN);
  1079.         }
  1080.         else if (pfnUnicodeStrlen((S8*)g_voip_cntx_p->call_list_info.call_info[currhiliteTab].dialog_info[i].appName) != 0)
  1081.         {
  1082.             pfnUnicodeStrncpy(
  1083.                 (S8*)subMenuDataPtrs[i], 
  1084.                 (S8*)g_voip_cntx_p->call_list_info.call_info[currhiliteTab].dialog_info[i].appName, 
  1085.                 VOIP_DISP_NAME_LEN);
  1086.         }
  1087.         else
  1088.         {
  1089.             AnsiiNToUnicodeString(
  1090.                 (S8*)subMenuDataPtrs[i],
  1091.                 (S8*)g_voip_cntx_p->call_list_info.call_info[currhiliteTab].dialog_info[i].remoteUri,
  1092.                 (MAX_SUBMENU_CHARACTERS - 1));
  1093.         }
  1094.     }
  1095. #if ((defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__))
  1096.     EnableCenterSoftkey(0, IMG_CSK_DIAL_ICON);
  1097. #endif 
  1098.     RegisterHighlightHandler(mmi_voip_highlight_in_call_item);
  1099.     ShowCategory403Screen(
  1100.         (U8*)GetString(STR_ID_VOIP_MAIN),
  1101.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1102.         STR_GLOBAL_OPTIONS,
  1103.         IMG_GLOBAL_OPTIONS,
  1104.         rskStr,
  1105.         0,
  1106.         (S8)g_voip_cntx_p->call_list_info.numTotal,
  1107.         (S8)g_voip_cntx_p->call_misc_info.currhiliteTab,
  1108.         MMI_tab_bar_items,
  1109.         &duration,
  1110.         subMenuDataPtrs,
  1111.         NULL,
  1112.         numItems,
  1113.         (U16)g_voip_cntx_p->call_misc_info.currhiliteIndex,
  1114.         guiBuffer);
  1115.     SetCategory403TabSelectCallback(mmi_voip_tab_jump);
  1116.     SetKeyHandler(mmi_voip_tab_prev, KEY_LEFT_ARROW, KEY_EVENT_DOWN);   /* move to previous tab */
  1117.     SetKeyHandler(mmi_voip_tab_next, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);  /* move to next tab */
  1118.     SetLeftSoftkeyFunction(mmi_voip_entry_call_option, KEY_EVENT_UP);
  1119. #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
  1120.     if (mmi_bt_is_incall_aud_swap2bt() != MMI_TRUE)
  1121.     {
  1122.         SetRightSoftkeyFunction(mmi_voip_set_loud_speaker, KEY_EVENT_UP);
  1123.     }
  1124. #else
  1125.     {
  1126.         SetRightSoftkeyFunction(mmi_voip_set_loud_speaker, KEY_EVENT_UP);
  1127.     }    
  1128. #endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */
  1129. #if ((defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__))
  1130.     SetCenterSoftkeyFunction(mmi_voip_pre_send_dtmf, KEY_EVENT_UP);
  1131. #endif 
  1132.     SetGroupKeyHandler(mmi_voip_pre_send_dtmf, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_DOWN);
  1133.     SetKeyHandler(mmi_voip_entry_in_call_sendkey, KEY_SEND, KEY_EVENT_DOWN);
  1134.     SetKeyHandler(mmi_voip_entry_in_call_endkey, KEY_END, KEY_EVENT_DOWN);
  1135.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  1136.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  1137.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1138. }
  1139. /*****************************************************************************
  1140.  * FUNCTION
  1141.  *  mmi_voip_exit_in_call
  1142.  * DESCRIPTION
  1143.  *  Exit function of in call screen.
  1144.  * PARAMETERS
  1145.  *  void
  1146.  * RETURNS
  1147.  *  void
  1148.  *****************************************************************************/
  1149. void mmi_voip_exit_in_call(void)
  1150. {
  1151.     /*----------------------------------------------------------------*/
  1152.     /* Local Variables                                                */
  1153.     /*----------------------------------------------------------------*/
  1154.     /*----------------------------------------------------------------*/
  1155.     /* Code Body                                                      */
  1156.     /*----------------------------------------------------------------*/
  1157. #if ((defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__))
  1158.     ResetCenterSoftkey();
  1159. #endif 
  1160. }
  1161. /*****************************************************************************
  1162.  * FUNCTION
  1163.  *  mmi_voip_highlight_in_call_item
  1164.  * DESCRIPTION
  1165.  *  Highlight index in the active call screen.
  1166.  * PARAMETERS
  1167.  *  index       [IN]        Current highlight index
  1168.  * RETURNS
  1169.  *  void
  1170.  *****************************************************************************/
  1171. void mmi_voip_highlight_in_call_item(S32 index)
  1172. {
  1173.     /*----------------------------------------------------------------*/
  1174.     /* Local Variables                                                */
  1175.     /*----------------------------------------------------------------*/
  1176.     /*----------------------------------------------------------------*/
  1177.     /* Code Body                                                      */
  1178.     /*----------------------------------------------------------------*/
  1179.     g_voip_cntx_p->call_misc_info.currhiliteIndex = index;
  1180. }
  1181. /*****************************************************************************
  1182.  * FUNCTION
  1183.  *  mmi_voip_tab_jump
  1184.  * DESCRIPTION
  1185.  *  Jump to tab based on index for Category403.
  1186.  * PARAMETERS
  1187.  *  index       [IN]        Current highlight tab
  1188.  * RETURNS
  1189.  *  void
  1190.  *****************************************************************************/
  1191. void mmi_voip_tab_jump(S32 index)
  1192. {
  1193.     /*----------------------------------------------------------------*/
  1194.     /* Local Variables                                                */
  1195.     /*----------------------------------------------------------------*/
  1196.     /*----------------------------------------------------------------*/
  1197.     /* Code Body                                                      */
  1198.     /*----------------------------------------------------------------*/
  1199.     g_voip_cntx_p->call_misc_info.currhiliteTab = index;
  1200.     g_voip_cntx_p->call_misc_info.currhiliteIndex = 0;
  1201.     mmi_voip_entry_in_call();
  1202.     DeleteScreenIfPresent(SCR_ID_VOIP_IN_CALL);
  1203. }
  1204. /*****************************************************************************
  1205.  * FUNCTION
  1206.  *  mmi_voip_tab_prev
  1207.  * DESCRIPTION
  1208.  *  Move to previous tab for Category403.
  1209.  * PARAMETERS
  1210.  *  void
  1211.  * RETURNS
  1212.  *  void
  1213.  *****************************************************************************/
  1214. void mmi_voip_tab_prev(void)
  1215. {
  1216.     /*----------------------------------------------------------------*/
  1217.     /* Local Variables                                                */
  1218.     /*----------------------------------------------------------------*/
  1219.     /*----------------------------------------------------------------*/
  1220.     /* Code Body                                                      */
  1221.     /*----------------------------------------------------------------*/
  1222.     if (g_voip_cntx_p->call_misc_info.currhiliteTab == 0)
  1223.     {
  1224.         g_voip_cntx_p->call_misc_info.currhiliteTab = g_voip_cntx_p->call_list_info.numTotal - 1;
  1225.     }
  1226.     else
  1227.     {
  1228.         g_voip_cntx_p->call_misc_info.currhiliteTab--;
  1229.     }
  1230.     g_voip_cntx_p->call_misc_info.currhiliteIndex = 0;
  1231.     mmi_voip_entry_in_call();
  1232.     DeleteScreenIfPresent(SCR_ID_VOIP_IN_CALL);
  1233. }
  1234. /*****************************************************************************
  1235.  * FUNCTION
  1236.  *  mmi_voip_tab_next
  1237.  * DESCRIPTION
  1238.  *  Move to next tab for Category403.
  1239.  * PARAMETERS
  1240.  *  void
  1241.  * RETURNS
  1242.  *  void
  1243.  *****************************************************************************/
  1244. void mmi_voip_tab_next(void)
  1245. {
  1246.     /*----------------------------------------------------------------*/
  1247.     /* Local Variables                                                */
  1248.     /*----------------------------------------------------------------*/
  1249.     /*----------------------------------------------------------------*/
  1250.     /* Code Body                                                      */
  1251.     /*----------------------------------------------------------------*/
  1252.     if (g_voip_cntx_p->call_misc_info.currhiliteTab == g_voip_cntx_p->call_list_info.numTotal - 1)
  1253.     {
  1254.         g_voip_cntx_p->call_misc_info.currhiliteTab = 0;
  1255.     }
  1256.     else
  1257.     {
  1258.         g_voip_cntx_p->call_misc_info.currhiliteTab++;
  1259.     }
  1260.     g_voip_cntx_p->call_misc_info.currhiliteIndex = 0;
  1261.     mmi_voip_entry_in_call();
  1262.     DeleteScreenIfPresent(SCR_ID_VOIP_IN_CALL);
  1263. }
  1264. /*****************************************************************************
  1265.  * FUNCTION
  1266.  *  mmi_voip_tab_highlight
  1267.  * DESCRIPTION
  1268.  *  Adjust highlight tab for Category403.
  1269.  * PARAMETERS
  1270.  *  void
  1271.  * RETURNS
  1272.  *  void
  1273.  *****************************************************************************/
  1274. void mmi_voip_tab_highlight(void)
  1275. {
  1276.     /*----------------------------------------------------------------*/
  1277.     /* Local Variables                                                */
  1278.     /*----------------------------------------------------------------*/
  1279.     S32 callId = 0;
  1280.     /*----------------------------------------------------------------*/
  1281.     /* Code Body                                                      */
  1282.     /*----------------------------------------------------------------*/
  1283.     callId = mmi_voip_get_active_call_id();
  1284.     /* active call exists, highlight on active call */
  1285.     if (callId != -1)
  1286.     {
  1287.         g_voip_cntx_p->call_misc_info.currhiliteTab = mmi_voip_get_call_index(callId);
  1288.         g_voip_cntx_p->call_misc_info.currhiliteIndex = 0;
  1289.     }
  1290.     /* no active call, highlight on original call */
  1291.     else
  1292.     {
  1293.         /* original call doesn't exist, highlight on last call */
  1294.         if (g_voip_cntx_p->call_misc_info.currhiliteTab > g_voip_cntx_p->call_list_info.numTotal - 1)
  1295.         {
  1296.             g_voip_cntx_p->call_misc_info.currhiliteTab = g_voip_cntx_p->call_list_info.numTotal - 1;
  1297.             g_voip_cntx_p->call_misc_info.currhiliteIndex = 0;
  1298.         }
  1299.     }
  1300. }
  1301. /*****************************************************************************
  1302.  * FUNCTION
  1303.  *  mmi_voip_entry_dtmf_editor
  1304.  * DESCRIPTION
  1305.  *  Entry function of dtmf editor in call.
  1306.  * PARAMETERS
  1307.  *  void
  1308.  * RETURNS
  1309.  *  void
  1310.  *****************************************************************************/
  1311. void mmi_voip_entry_dtmf_editor(void)
  1312. {
  1313.     /*----------------------------------------------------------------*/
  1314.     /* Local Variables                                                */
  1315.     /*----------------------------------------------------------------*/
  1316.     U8 *guiBuffer = NULL;
  1317.     U8 *inputStr = GetCurrInputBuffer(SCR_ID_VOIP_DTMF_EDITOR);
  1318.     S32 inputLen = 0, currhiliteTab = 0, callState = MMI_VOIP_IDLE_STATE;
  1319.     /*----------------------------------------------------------------*/
  1320.     /* Code Body                                                      */
  1321.     /*----------------------------------------------------------------*/
  1322.     EntryNewScreen(SCR_ID_VOIP_DTMF_EDITOR, NULL, mmi_voip_entry_dtmf_editor, NULL);
  1323.     if (pfnUnicodeStrlen((S8*)inputStr) != 0)
  1324.     {
  1325.         inputLen = (MMI_VOIP_DTMF_LEN > pfnUnicodeStrlen((S8*)inputStr)) ? 
  1326.             (pfnUnicodeStrlen((S8*)inputStr)) : (MMI_VOIP_DTMF_LEN - 1);
  1327.         
  1328.         memset(g_voip_cntx_p->call_misc_info.dispDtmf, 0, (MMI_VOIP_DTMF_LEN * ENCODING_LENGTH));
  1329.         pfnUnicodeStrncpy((S8*)g_voip_cntx_p->call_misc_info.dispDtmf, (S8*)inputStr, inputLen);
  1330.     }
  1331.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_DTMF_EDITOR);
  1332.     ShowCategory16Screen(
  1333.         STR_GLOBAL_SAVE,
  1334.         0,
  1335.         STR_GLOBAL_BACK,
  1336.         IMG_GLOBAL_BACK,
  1337.         g_voip_cntx_p->call_misc_info.dispDtmf,
  1338.         MMI_VOIP_DTMF_LEN,
  1339.         guiBuffer);
  1340.     wgui_save_key_handlers();
  1341.     SetLeftSoftkeyFunction(mmi_voip_entry_save_phonebook, KEY_EVENT_UP);
  1342.     SetCategory16RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1343.     currhiliteTab = g_voip_cntx_p->call_misc_info.currhiliteTab;
  1344.     callState = g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState;
  1345.     if ((callState == MMI_VOIP_ACTIVE_STATE) && (g_voip_cntx_p->call_misc_info.isDtmf == TRUE))
  1346.     {
  1347.         SetGroupKeyHandler(mmi_voip_send_dtmf_start, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_DOWN);
  1348.         SetGroupKeyHandler(mmi_voip_send_dtmf_stop, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_UP);
  1349.         SetGroupKeyHandler(MMI_dummy_function, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_LONG_PRESS);
  1350.         SetGroupKeyHandler(MMI_dummy_function, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_REPEAT);
  1351.     }
  1352.     else
  1353.     {
  1354.         SetGroupKeyHandler(MMI_dummy_function, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_DOWN);
  1355.         SetGroupKeyHandler(MMI_dummy_function, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_UP);
  1356.         SetGroupKeyHandler(MMI_dummy_function, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_LONG_PRESS);
  1357.         SetGroupKeyHandler(MMI_dummy_function, (U16*)VoIPDTMFDigits, MMI_VOIP_MAX_NUM_DIGITS, KEY_EVENT_REPEAT);
  1358.     }
  1359.     SetKeyHandler(mmi_voip_entry_in_call_endkey, KEY_END, KEY_EVENT_DOWN);
  1360.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  1361.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  1362.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1363. }
  1364. /*****************************************************************************
  1365.  * FUNCTION
  1366.  *  mmi_voip_entry_call_option
  1367.  * DESCRIPTION
  1368.  *  Entry function of call option screen.
  1369.  * PARAMETERS
  1370.  *  void
  1371.  * RETURNS
  1372.  *  void
  1373.  *****************************************************************************/
  1374. void mmi_voip_entry_call_option(void)
  1375. {
  1376.     /*----------------------------------------------------------------*/
  1377.     /* Local Variables                                                */
  1378.     /*----------------------------------------------------------------*/
  1379.     U8 *guiBuffer = NULL;
  1380.     U16 numItems = 0;
  1381.     U16 nStrItemList[MAX_SUB_MENUS];
  1382.     U8 *nHintItemList[MAX_SUB_MENUS];
  1383.     /*----------------------------------------------------------------*/
  1384.     /* Code Body                                                      */
  1385.     /*----------------------------------------------------------------*/
  1386.     EntryNewScreen(SCR_ID_VOIP_CALL_OPTION, NULL, mmi_voip_entry_call_option, NULL);
  1387.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_CALL_OPTION);
  1388.     SetParentHandler(MENU_ID_VOIP_CALL_OPTION);
  1389.     mmi_voip_hide_call_option();
  1390.     numItems = GetNumOfChild_Ext(MENU_ID_VOIP_CALL_OPTION);
  1391.     GetSequenceStringIds_Ext(MENU_ID_VOIP_CALL_OPTION, nStrItemList);
  1392.     ConstructHintsList(MENU_ID_VOIP_CALL_OPTION, nHintItemList);
  1393.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1394.     ShowCategory52Screen(
  1395.         STR_ID_VOIP_CALL_OPTION,
  1396.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1397.         STR_GLOBAL_OK,
  1398.         IMG_GLOBAL_OK,
  1399.         STR_GLOBAL_BACK,
  1400.         IMG_GLOBAL_BACK,
  1401.         numItems,
  1402.         nStrItemList,
  1403.         (U16*) gIndexIconsImageList,
  1404.         nHintItemList,
  1405.         0,
  1406.         0,
  1407.         guiBuffer);
  1408.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1409.     SetKeyHandler(mmi_voip_entry_in_call_endkey, KEY_END, KEY_EVENT_DOWN);
  1410.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  1411.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  1412.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1413. }
  1414. /*****************************************************************************
  1415.  * FUNCTION
  1416.  *  mmi_voip_hide_call_option
  1417.  * DESCRIPTION
  1418.  *  Hide and unhide call option menu item based on current state.
  1419.  * PARAMETERS
  1420.  *  void
  1421.  * RETURNS
  1422.  *  void
  1423.  *****************************************************************************/
  1424. void mmi_voip_hide_call_option(void)
  1425. {
  1426.     /*----------------------------------------------------------------*/
  1427.     /* Local Variables                                                */
  1428.     /*----------------------------------------------------------------*/
  1429.     S32 currhiliteTab = 0, callIndex = 0, callId = 0, othercallId = 0;
  1430.     /*----------------------------------------------------------------*/
  1431.     /* Code Body                                                      */
  1432.     /*----------------------------------------------------------------*/
  1433.     currhiliteTab = g_voip_cntx_p->call_misc_info.currhiliteTab;
  1434.     callId = g_voip_cntx_p->call_list_info.call_info[currhiliteTab].callId;
  1435.     if (g_voip_cntx_p->call_list_info.numHeld < MMI_VOIP_MAX_HELD_CALL)
  1436.     {
  1437.         if (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState == MMI_VOIP_ACTIVE_STATE)
  1438.         {
  1439.             if (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].numDialog == 1)
  1440.             {
  1441.                 mmi_frm_unhide_menu_item(MENU_ID_VOIP_HOLD_SINGLE);
  1442.                 mmi_frm_hide_menu_item(MENU_ID_VOIP_HOLD_CONFERENCE);
  1443.                 mmi_frm_hide_menu_item(MENU_ID_VOIP_SPLIT);
  1444.             }
  1445.             else    /* conference call */
  1446.             {
  1447.                 mmi_frm_hide_menu_item(MENU_ID_VOIP_HOLD_SINGLE);
  1448.                 mmi_frm_unhide_menu_item(MENU_ID_VOIP_HOLD_CONFERENCE);
  1449.                 mmi_frm_unhide_menu_item(MENU_ID_VOIP_SPLIT);
  1450.             }
  1451.         }
  1452.         else    /* not active */
  1453.         {
  1454.             mmi_frm_hide_menu_item(MENU_ID_VOIP_HOLD_SINGLE);
  1455.             mmi_frm_hide_menu_item(MENU_ID_VOIP_HOLD_CONFERENCE);
  1456.             mmi_frm_hide_menu_item(MENU_ID_VOIP_SPLIT);
  1457.         }
  1458.     }
  1459.     else    /* call boundary exceeds */
  1460.     {
  1461.         mmi_frm_hide_menu_item(MENU_ID_VOIP_HOLD_SINGLE);
  1462.         mmi_frm_hide_menu_item(MENU_ID_VOIP_HOLD_CONFERENCE);
  1463.         mmi_frm_hide_menu_item(MENU_ID_VOIP_SPLIT);
  1464.     }
  1465.     if (mmi_voip_get_active_call_id() == -1)
  1466.     {
  1467.         if (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState == MMI_VOIP_HOLD_STATE)
  1468.         {
  1469.             if (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].numDialog == 1)
  1470.             {
  1471.                 mmi_frm_unhide_menu_item(MENU_ID_VOIP_RETRIEVE_SINGLE);
  1472.                 mmi_frm_hide_menu_item(MENU_ID_VOIP_RETRIEVE_CONFERENCE);
  1473.             }
  1474.             else    /* conference call */
  1475.             {
  1476.                 mmi_frm_hide_menu_item(MENU_ID_VOIP_RETRIEVE_SINGLE);
  1477.                 mmi_frm_unhide_menu_item(MENU_ID_VOIP_RETRIEVE_CONFERENCE);
  1478.             }
  1479.         }
  1480.         else    /* not held */
  1481.         {
  1482.             mmi_frm_hide_menu_item(MENU_ID_VOIP_RETRIEVE_SINGLE);
  1483.             mmi_frm_hide_menu_item(MENU_ID_VOIP_RETRIEVE_CONFERENCE);
  1484.         }
  1485.     }
  1486.     else    /* active call exists */
  1487.     {
  1488.         mmi_frm_hide_menu_item(MENU_ID_VOIP_RETRIEVE_SINGLE);
  1489.         mmi_frm_hide_menu_item(MENU_ID_VOIP_RETRIEVE_CONFERENCE);
  1490.     }
  1491.     /* swap */
  1492.     if (((g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState == MMI_VOIP_ACTIVE_STATE) &&
  1493.          (g_voip_cntx_p->call_list_info.numHeld > 0)) ||
  1494.         ((g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState == MMI_VOIP_HOLD_STATE) &&
  1495.          (mmi_voip_get_active_call_id() != -1)))
  1496.     {
  1497.         mmi_frm_unhide_menu_item(MENU_ID_VOIP_SWAP);
  1498.     }
  1499.     else
  1500.     {
  1501.         mmi_frm_hide_menu_item(MENU_ID_VOIP_SWAP);
  1502.     }
  1503.     /* conference */
  1504.     if ((g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState == MMI_VOIP_ACTIVE_STATE) &&
  1505.         (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].numDialog == 1))
  1506.     {
  1507.         mmi_voip_get_held_call_list(TRUE);
  1508.         othercallId = g_voip_cntx_p->call_list_info.held_call_info[0].callId;
  1509.         if (othercallId != -1)  /* at least one single held call */
  1510.         {
  1511.             mmi_frm_unhide_menu_item(MENU_ID_VOIP_CONFERENCE);
  1512.         }
  1513.         else
  1514.         {
  1515.             mmi_frm_hide_menu_item(MENU_ID_VOIP_CONFERENCE);
  1516.         }
  1517.     }
  1518.     else if ((g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState == MMI_VOIP_HOLD_STATE) &&
  1519.              (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].numDialog == 1))
  1520.     {
  1521.         othercallId = mmi_voip_get_active_call_id();
  1522.         if (othercallId != -1)  /* other active call exists */
  1523.         {
  1524.             callIndex = mmi_voip_get_call_index(othercallId);
  1525.             if (g_voip_cntx_p->call_list_info.call_info[callIndex].numDialog == 1)
  1526.             {
  1527.                 mmi_frm_unhide_menu_item(MENU_ID_VOIP_CONFERENCE);
  1528.             }
  1529.             else
  1530.             {
  1531.                 mmi_frm_hide_menu_item(MENU_ID_VOIP_CONFERENCE);
  1532.             }
  1533.         }
  1534.         else
  1535.         {
  1536.             mmi_frm_hide_menu_item(MENU_ID_VOIP_CONFERENCE);
  1537.         }
  1538.     }
  1539.     else    /* not single active and not single held */
  1540.     {
  1541.         mmi_frm_hide_menu_item(MENU_ID_VOIP_CONFERENCE);
  1542.     }
  1543.     /* end conference */
  1544.     if (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].numDialog != 1)  /* conference call */
  1545.     {
  1546.         mmi_frm_unhide_menu_item(MENU_ID_VOIP_END_CONFERENCE);
  1547.     }
  1548.     else
  1549.     {
  1550.         mmi_frm_hide_menu_item(MENU_ID_VOIP_END_CONFERENCE);
  1551.     }
  1552.     /* end all */
  1553.     if (g_voip_cntx_p->call_list_info.numTotal >= 2)
  1554.     {
  1555.         mmi_frm_unhide_menu_item(MENU_ID_VOIP_END_ALL);
  1556.     }
  1557.     else
  1558.     {
  1559.         mmi_frm_hide_menu_item(MENU_ID_VOIP_END_ALL);
  1560.     }
  1561.     /* transfer */
  1562.     if (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].numDialog == 1)
  1563.     {
  1564.         mmi_frm_unhide_menu_item(MENU_ID_VOIP_TRANSFER);
  1565.     }
  1566.     else
  1567.     {
  1568.         mmi_frm_hide_menu_item(MENU_ID_VOIP_TRANSFER);
  1569.     }
  1570.     /* mute and dtmf */
  1571.     if (g_voip_cntx_p->call_list_info.call_info[currhiliteTab].currState == MMI_VOIP_ACTIVE_STATE)
  1572.     {
  1573.         mmi_frm_unhide_menu_item(MENU_ID_VOIP_MUTE);
  1574.         if (g_voip_cntx_p->call_setting_info.saved_setting.dtmf == VOIP_DTMF_TYPE_NONE) /* DTMF in call setting is off */
  1575.         {
  1576.             mmi_frm_hide_menu_item(MENU_ID_VOIP_DTMF);
  1577.         }
  1578.         else
  1579.         {
  1580.             mmi_frm_unhide_menu_item(MENU_ID_VOIP_DTMF);
  1581.         }
  1582.     }
  1583.     else
  1584.     {
  1585.         mmi_frm_hide_menu_item(MENU_ID_VOIP_MUTE);
  1586.         mmi_frm_hide_menu_item(MENU_ID_VOIP_DTMF);
  1587.     }
  1588. }
  1589. /*****************************************************************************
  1590.  * FUNCTION
  1591.  *  mmi_voip_entry_transfer
  1592.  * DESCRIPTION
  1593.  *  Entry function of call optionTransfer
  1594.  * PARAMETERS
  1595.  *  void
  1596.  * RETURNS
  1597.  *  void
  1598.  *****************************************************************************/
  1599. void mmi_voip_entry_transfer(void)
  1600. {
  1601.     /*----------------------------------------------------------------*/
  1602.     /* Local Variables                                                */
  1603.     /*----------------------------------------------------------------*/
  1604.     U8 *guiBuffer = NULL;
  1605.     /*----------------------------------------------------------------*/
  1606.     /* Code Body                                                      */
  1607.     /*----------------------------------------------------------------*/
  1608.     EntryNewScreen(SCR_ID_VOIP_CALL_EDITOR, NULL, mmi_voip_entry_transfer, NULL);
  1609.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_CALL_EDITOR);
  1610.     ShowCategory404Screen(
  1611.         STR_GLOBAL_OK,
  1612.         IMG_GLOBAL_OK,
  1613.         STR_GLOBAL_BACK,
  1614.         IMG_GLOBAL_BACK,
  1615.         IMG_ID_VOIP_CALL_EDITOR,
  1616.         g_voip_cntx_p->call_misc_info.dispUri,
  1617.         VOIP_URI_LEN,
  1618.         guiBuffer);
  1619.     SetLeftSoftkeyFunction(mmi_voip_entry_transfer_call_determined, KEY_EVENT_UP);
  1620.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1621.     SetKeyHandler(mmi_voip_entry_in_call_endkey, KEY_END, KEY_EVENT_DOWN);
  1622.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  1623.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  1624.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1625. }
  1626. /*****************************************************************************
  1627.  * FUNCTION
  1628.  *  mmi_voip_entry_multi_held_call
  1629.  * DESCRIPTION
  1630.  *  Entry function of call optionSwap or Conference
  1631.  *  if more than one held calls can be selected.
  1632.  * PARAMETERS
  1633.  *  void
  1634.  * RETURNS
  1635.  *  void
  1636.  *****************************************************************************/
  1637. void mmi_voip_entry_multi_held_call(void)
  1638. {
  1639.     /*----------------------------------------------------------------*/
  1640.     /* Local Variables                                                */
  1641.     /*----------------------------------------------------------------*/
  1642.     U8 *guiBuffer = NULL;
  1643.     S32 callId = 0, i = 0;
  1644.     /*----------------------------------------------------------------*/
  1645.     /* Code Body                                                      */
  1646.     /*----------------------------------------------------------------*/
  1647.     EntryNewScreen(SCR_ID_VOIP_MULTI_HELD_CALL, NULL, mmi_voip_entry_multi_held_call, NULL);
  1648.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_MULTI_HELD_CALL);
  1649.     callId = g_voip_cntx_p->call_list_info.held_call_info[i].callId;
  1650.     while ((i < MMI_VOIP_MAX_HELD_CALL) && (callId != -1))
  1651.     {
  1652.         subMenuDataPtrs[i] = subMenuData[i];
  1653.         memset(subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
  1654.         if (pfnUnicodeStrlen((S8*)g_voip_cntx_p->call_list_info.held_call_info[i].dispName) != 0)
  1655.         {
  1656.             pfnUnicodeStrncpy(
  1657.                 (S8*)subMenuDataPtrs[i],
  1658.                 (S8*)g_voip_cntx_p->call_list_info.held_call_info[i].dispName,
  1659.                 VOIP_DISP_NAME_LEN);
  1660.         }
  1661.         else if (pfnUnicodeStrlen((S8*)g_voip_cntx_p->call_list_info.held_call_info[i].appName) != 0)
  1662.         {
  1663.             pfnUnicodeStrncpy(
  1664.                 (S8*)subMenuDataPtrs[i],
  1665.                 (S8*)g_voip_cntx_p->call_list_info.held_call_info[i].appName,
  1666.                 VOIP_DISP_NAME_LEN);
  1667.         }
  1668.         else
  1669.         {
  1670.             AnsiiNToUnicodeString(
  1671.                 (S8*)subMenuDataPtrs[i],
  1672.                 (S8*)g_voip_cntx_p->call_list_info.held_call_info[i].remoteUri,
  1673.                 (MAX_SUBMENU_CHARACTERS - 1));
  1674.         }
  1675.         i++;
  1676.         if (i < MMI_VOIP_MAX_HELD_CALL)
  1677.         {
  1678.             callId = g_voip_cntx_p->call_list_info.held_call_info[i].callId;
  1679.         }
  1680.     }
  1681.     RegisterHighlightHandler(mmi_voip_highlight_multi_held_call_item);
  1682.     ShowCategory6Screen(
  1683.         STR_ID_VOIP_CALL_OPTION,
  1684.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1685.         STR_GLOBAL_OK,
  1686.         IMG_GLOBAL_OK,
  1687.         STR_GLOBAL_BACK,
  1688.         IMG_GLOBAL_BACK,
  1689.         i,
  1690.         subMenuDataPtrs,
  1691.         NULL,
  1692.         0,
  1693.         guiBuffer);
  1694.     SetLeftSoftkeyFunction(mmi_voip_entry_held_call_selected, KEY_EVENT_UP);
  1695.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1696.     SetKeyHandler(mmi_voip_entry_in_call_endkey, KEY_END, KEY_EVENT_DOWN);
  1697.     /* must set KEY_EVENT_DOWN function to overwrite original side key handler of category 52 */
  1698.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_UP, KEY_EVENT_DOWN);
  1699.     SetKeyHandler(mmi_voip_entry_sidekey, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1700. }
  1701. /*****************************************************************************
  1702.  * FUNCTION
  1703.  *  mmi_voip_highlight_multi_held_call_item
  1704.  * DESCRIPTION
  1705.  *  Highlight index in the mutliple held calls screen.
  1706.  * PARAMETERS
  1707.  *  index       [IN]        Current highlight index.
  1708.  * RETURNS
  1709.  *  void
  1710.  *****************************************************************************/
  1711. void mmi_voip_highlight_multi_held_call_item(S32 index)
  1712. {
  1713.     /*----------------------------------------------------------------*/
  1714.     /* Local Variables                                                */
  1715.     /*----------------------------------------------------------------*/
  1716.     /*----------------------------------------------------------------*/
  1717.     /* Code Body                                                      */
  1718.     /*----------------------------------------------------------------*/
  1719.     g_voip_cntx_p->call_misc_info.currhiliteIndex = index;
  1720. }
  1721. /*****************************************************************************
  1722.  * FUNCTION
  1723.  *  mmi_voip_set_loud_speaker
  1724.  * DESCRIPTION
  1725.  *  Turn on and turn off loud speaker in call.
  1726.  * PARAMETERS
  1727.  *  void
  1728.  * RETURNS
  1729.  *  void
  1730.  *****************************************************************************/
  1731. void mmi_voip_set_loud_speaker(void)
  1732. {
  1733.     /*----------------------------------------------------------------*/
  1734.     /* Local Variables                                                */
  1735.     /*----------------------------------------------------------------*/
  1736.     /*----------------------------------------------------------------*/
  1737.     /* Code Body                                                      */
  1738.     /*----------------------------------------------------------------*/
  1739.     if (g_voip_cntx_p->call_misc_info.isLoud == TRUE)
  1740.     {
  1741.         g_voip_cntx_p->call_misc_info.isLoud = FALSE;
  1742.         if (GetExitScrnID() == SCR_ID_VOIP_IN_CALL)
  1743.         {
  1744.             ChangeRightSoftkey(STR_ID_VOIP_HAND_FREE, 0);
  1745.         }
  1746.         DisbleHandsFree();
  1747.         SetLoudSpeaker(FALSE);
  1748.         DisplayPopup(
  1749.             (U8*)GetString(STR_ID_VOIP_LOUD_SPEAKER_OFF),
  1750.             IMG_GLOBAL_OK,
  1751.             1,
  1752.             UI_POPUP_NOTIFYDURATION_TIME,
  1753.             SUCCESS_TONE_IN_CALL);
  1754.     }
  1755.     else
  1756.     {
  1757.         g_voip_cntx_p->call_misc_info.isLoud = TRUE;
  1758.         if (GetExitScrnID() == SCR_ID_VOIP_IN_CALL)
  1759.         {
  1760.             ChangeRightSoftkey(STR_ID_VOIP_HAND_HELD, 0);
  1761.         }
  1762.         EnableHandsFree();
  1763.         SetLoudSpeaker(TRUE);
  1764.         DisplayPopup(
  1765.             (U8*)GetString(STR_ID_VOIP_LOUD_SPEAKER_ON),
  1766.             IMG_GLOBAL_OK,
  1767.             1,
  1768.             UI_POPUP_NOTIFYDURATION_TIME,
  1769.             SUCCESS_TONE_IN_CALL);
  1770.     }
  1771. }
  1772. /*****************************************************************************
  1773.  * FUNCTION
  1774.  *  mmi_voip_set_mute
  1775.  * DESCRIPTION
  1776.  *  Turn on and turn off microphone in call option.
  1777.  * PARAMETERS
  1778.  *  void
  1779.  * RETURNS
  1780.  *  void
  1781.  *****************************************************************************/
  1782. void mmi_voip_set_mute(void)
  1783. {
  1784.     /*----------------------------------------------------------------*/
  1785.     /* Local Variables                                                */
  1786.     /*----------------------------------------------------------------*/
  1787.     /*----------------------------------------------------------------*/
  1788.     /* Code Body                                                      */
  1789.     /*----------------------------------------------------------------*/
  1790.     if (g_voip_cntx_p->call_misc_info.isMute == TRUE)
  1791.     {
  1792.         g_voip_cntx_p->call_misc_info.isMute = FALSE;
  1793.         MuteOffMicrophone();
  1794.         HideStatusIcon(STATUS_ICON_MUTE);
  1795.         UpdateStatusIcons();
  1796.         pfnUnicodeStrcpy((S8*) hintData[GetCurrHiliteID()], (S8*) GetString(STR_GLOBAL_OFF));
  1797.         Category52ChangeItemDescription(GetCurrHiliteID(), (U8*) GetString(STR_GLOBAL_OFF));
  1798.         ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_GLOBAL_OK);
  1799.     }
  1800.     else
  1801.     {
  1802.         g_voip_cntx_p->call_misc_info.isMute = TRUE;
  1803.         MuteOnMicrophone();
  1804.         ShowStatusIcon(STATUS_ICON_MUTE);
  1805.         UpdateStatusIcons();
  1806.         pfnUnicodeStrcpy((S8*) hintData[GetCurrHiliteID()], (S8*) GetString(STR_GLOBAL_ON));
  1807.         Category52ChangeItemDescription(GetCurrHiliteID(), (U8*) GetString(STR_GLOBAL_ON));
  1808.         ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_GLOBAL_OK);
  1809.     }
  1810.     RedrawCategoryFunction();
  1811. }
  1812. /*****************************************************************************
  1813.  * FUNCTION
  1814.  *  mmi_voip_set_dtmf_in_call
  1815.  * DESCRIPTION
  1816.  *  Temporarily turn on and turn off DTMF in call option.
  1817.  * PARAMETERS
  1818.  *  void
  1819.  * RETURNS
  1820.  *  void
  1821.  *****************************************************************************/
  1822. void mmi_voip_set_dtmf_in_call(void)
  1823. {
  1824.     /*----------------------------------------------------------------*/
  1825.     /* Local Variables                                                */
  1826.     /*----------------------------------------------------------------*/
  1827.     /*----------------------------------------------------------------*/
  1828.     /* Code Body                                                      */
  1829.     /*----------------------------------------------------------------*/
  1830.     if (g_voip_cntx_p->call_misc_info.isDtmf == TRUE)
  1831.     {
  1832.         g_voip_cntx_p->call_misc_info.isDtmf = FALSE;
  1833.         pfnUnicodeStrcpy((S8*) hintData[GetCurrHiliteID()], (S8*) GetString(STR_GLOBAL_OFF));
  1834.         Category52ChangeItemDescription(GetCurrHiliteID(), (U8*) GetString(STR_GLOBAL_OFF));
  1835.         ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_GLOBAL_OK);
  1836.     }
  1837.     else
  1838.     {
  1839.         g_voip_cntx_p->call_misc_info.isDtmf = TRUE;
  1840.         pfnUnicodeStrcpy((S8*) hintData[GetCurrHiliteID()], (S8*) GetString(STR_GLOBAL_ON));
  1841.         Category52ChangeItemDescription(GetCurrHiliteID(), (U8*) GetString(STR_GLOBAL_ON));
  1842.         ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_GLOBAL_OK);
  1843.     }
  1844.     RedrawCategoryFunction();
  1845. }
  1846. /*****************************************************************************
  1847.  * FUNCTION
  1848.  *  mmi_voip_entry_popup
  1849.  * DESCRIPTION
  1850.  *  Entry function of VoIP popup.
  1851.  * PARAMETERS
  1852.  *  void
  1853.  * RETURNS
  1854.  *  void
  1855.  *****************************************************************************/
  1856. void mmi_voip_entry_popup(U8 *string, U16 imageId)
  1857. {
  1858.     /*----------------------------------------------------------------*/
  1859.     /* Local Variables                                                */
  1860.     /*----------------------------------------------------------------*/
  1861.     /*----------------------------------------------------------------*/
  1862.     /* Code Body                                                      */
  1863.     /*----------------------------------------------------------------*/
  1864.     EntryNewScreen(SCR_POPUP_SCREEN, mmi_voip_exit_popup, NULL, NULL);
  1865.     ShowCategory63Screen(string, imageId, NULL);
  1866.     StartTimer(VOIP_POPUP_TIMER, MMI_VOIP_GENERAL_TIMEOUT, mmi_voip_entry_popup_over);
  1867. }
  1868. /*****************************************************************************
  1869.  * FUNCTION
  1870.  *  mmi_voip_exit_popup
  1871.  * DESCRIPTION
  1872.  *  Exit function of VoIP popup.
  1873.  * PARAMETERS
  1874.  *  void
  1875.  * RETURNS
  1876.  *  void
  1877.  *****************************************************************************/
  1878. void mmi_voip_exit_popup(void)
  1879. {
  1880.     /*----------------------------------------------------------------*/
  1881.     /* Local Variables                                                */
  1882.     /*----------------------------------------------------------------*/
  1883.     /*----------------------------------------------------------------*/
  1884.     /* Code Body                                                      */
  1885.     /*----------------------------------------------------------------*/
  1886.     StopTimer(VOIP_POPUP_TIMER);
  1887. }
  1888. /*****************************************************************************
  1889.  * FUNCTION
  1890.  *  mmi_voip_entry_popup_over
  1891.  * DESCRIPTION
  1892.  *  Entry function of popup timer expiry.
  1893.  * PARAMETERS
  1894.  *  void
  1895.  * RETURNS
  1896.  *  void
  1897.  *****************************************************************************/
  1898. void mmi_voip_entry_popup_over(void)
  1899. {
  1900.     /*----------------------------------------------------------------*/
  1901.     /* Local Variables                                                */
  1902.     /*----------------------------------------------------------------*/
  1903.     /*----------------------------------------------------------------*/
  1904.     /* Code Body                                                      */
  1905.     /*----------------------------------------------------------------*/
  1906.     StopTimer(VOIP_POPUP_TIMER);
  1907.     GoBackHistory();
  1908. }
  1909. /*****************************************************************************
  1910.  * FUNCTION
  1911.  *  mmi_voip_go_back_screen_check
  1912.  * DESCRIPTION
  1913.  *  Go back to screen based on current state.
  1914.  * PARAMETERS
  1915.  *  void
  1916.  * RETURNS
  1917.  *  void
  1918.  *****************************************************************************/
  1919. void mmi_voip_go_back_screen_check(void)
  1920. {
  1921.     /*----------------------------------------------------------------*/
  1922.     /* Local Variables                                                */
  1923.     /*----------------------------------------------------------------*/
  1924.     /*----------------------------------------------------------------*/
  1925.     /* Code Body                                                      */
  1926.     /*----------------------------------------------------------------*/
  1927.     /* pending action exists, do not adjust history */
  1928.     if (g_voip_cntx_p->call_list_info.processCId == -1)
  1929.     {
  1930.         if ((mmi_voip_get_incoming_call_id() != -1) &&
  1931.             (mmi_voip_get_incoming_call_id() != g_voip_cntx_p->call_list_info.bkrejCId))
  1932.         {
  1933.             if (!IsScreenPresent(SCR_ID_VOIP_INCOMING_CALL))
  1934.             {
  1935.                 mmi_voip_entry_incoming_call();
  1936.             }
  1937.             /* force to add processing screen to history when current screen is processing screen.
  1938.                it is to prevent no popup case so that processing screen is not deleted */
  1939.             else if ((GetExitScrnID() == SCR_ID_VOIP_PROCESSING) || (GetExitScrnID() == SCR_ID_VOIP_OUTGOING_CALL))
  1940.             {
  1941.                 EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, NULL, NULL);
  1942.             }
  1943.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  1944.             DeleteScreenIfPresent(SCR_ID_VOIP_REDIALING_CALL);
  1945.             DeleteScreenIfPresent(SCR_ID_VOIP_OUTGOING_CALL);
  1946.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION);
  1947.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR);
  1948.             DeleteScreenIfPresent(SCR_ID_VOIP_MULTI_HELD_CALL);
  1949.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_OPTION);
  1950.             DeleteScreenIfPresent(SCR_ID_VOIP_DTMF_EDITOR);
  1951.             DeleteScreenIfPresent(SCR_ID_VOIP_IN_CALL);
  1952.             if (GetExitScrnID() == GLOBAL_SCR_DUMMY)
  1953.             {
  1954.                 GoBackHistory();    /* go back to incoming call screen */
  1955.             }
  1956.             mmi_voip_play_incoming_tone();
  1957.         }
  1958.         else if (mmi_voip_get_outgoing_call_id() != -1)
  1959.         {
  1960.             if (!IsScreenPresent(SCR_ID_VOIP_OUTGOING_CALL))
  1961.             {
  1962.                 mmi_voip_entry_outgoing_call();
  1963.             }
  1964.             /* force to add processing screen to history when current screen is processing screen.
  1965.                it is to prevent no popup case so that processing screen is not deleted */
  1966.             else if ((GetExitScrnID() == SCR_ID_VOIP_PROCESSING) || (GetExitScrnID() == SCR_ID_VOIP_OUTGOING_CALL))
  1967.             {
  1968.                 EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, NULL, NULL);
  1969.             }
  1970.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  1971.             DeleteScreenIfPresent(SCR_ID_VOIP_REDIALING_CALL);
  1972.             DeleteScreenIfPresent(SCR_ID_VOIP_INCOMING_CALL);
  1973.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION);
  1974.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR);
  1975.             DeleteScreenIfPresent(SCR_ID_VOIP_MULTI_HELD_CALL);
  1976.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_OPTION);
  1977.             DeleteScreenIfPresent(SCR_ID_VOIP_DTMF_EDITOR);
  1978.             DeleteScreenIfPresent(SCR_ID_VOIP_IN_CALL);
  1979.             if (GetExitScrnID() == GLOBAL_SCR_DUMMY)
  1980.             {
  1981.                 GoBackHistory();    /* go back to outgoing call screen */
  1982.             }
  1983.         }
  1984.         else
  1985.         {
  1986.             mmi_voip_tab_highlight();   /* no matter call exists or not, adjust tab highlight */
  1987.             if ((mmi_voip_get_active_call_id() != -1) || (g_voip_cntx_p->call_list_info.numHeld > 0))
  1988.             {
  1989.                 if (!IsScreenPresent(SCR_ID_VOIP_IN_CALL))
  1990.                 {
  1991.                     mmi_voip_entry_in_call();
  1992.                 }
  1993.                 /* force to add processing screen to history when current screen is processing screen.
  1994.                    it is to prevent no popup case so that processing screen is not deleted */
  1995.                 else if ((GetExitScrnID() == SCR_ID_VOIP_PROCESSING) || (GetExitScrnID() == SCR_ID_VOIP_OUTGOING_CALL))
  1996.                 {
  1997.                     EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, NULL, NULL);
  1998.                 }
  1999.                 DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  2000.                 DeleteScreenIfPresent(SCR_ID_VOIP_REDIALING_CALL);
  2001.                 DeleteScreenIfPresent(SCR_ID_VOIP_INCOMING_CALL);
  2002.                 DeleteScreenIfPresent(SCR_ID_VOIP_OUTGOING_CALL);
  2003.                 DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION);
  2004.                 DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR);
  2005.                 DeleteScreenIfPresent(SCR_ID_VOIP_MULTI_HELD_CALL);
  2006.                 DeleteScreenIfPresent(SCR_ID_VOIP_CALL_OPTION);
  2007.                 DeleteScreenIfPresent(SCR_ID_VOIP_DTMF_EDITOR);
  2008.                 if (GetExitScrnID() == GLOBAL_SCR_DUMMY)
  2009.                 {
  2010.                     GoBackHistory();    /* go back to active call screen */
  2011.                 }
  2012.             }
  2013.             else
  2014.             {
  2015.                 /* force to add processing screen to history when current screen is processing screen.
  2016.                    it is to prevent no popup case so that processing screen is not deleted */
  2017.                 if ((GetExitScrnID() == SCR_ID_VOIP_PROCESSING) || (GetExitScrnID() == SCR_ID_VOIP_OUTGOING_CALL))
  2018.                 {
  2019.                     EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, NULL, NULL);
  2020.                 }
  2021.                 DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  2022.                 DeleteScreenIfPresent(SCR_ID_VOIP_REDIALING_CALL);
  2023.                 DeleteScreenIfPresent(SCR_ID_VOIP_INCOMING_CALL);
  2024.                 DeleteScreenIfPresent(SCR_ID_VOIP_OUTGOING_CALL);
  2025.                 DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION);
  2026.                 DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR);
  2027.                 DeleteScreenIfPresent(SCR_ID_VOIP_MULTI_HELD_CALL);
  2028.                 DeleteScreenIfPresent(SCR_ID_VOIP_CALL_OPTION);
  2029.                 DeleteScreenIfPresent(SCR_ID_VOIP_DTMF_EDITOR);
  2030.                 DeleteScreenIfPresent(SCR_ID_VOIP_IN_CALL);
  2031.                 if (GetExitScrnID() == GLOBAL_SCR_DUMMY)
  2032.                 {
  2033.                     GoBackHistory();
  2034.                 }
  2035.             }
  2036.         }
  2037.     }
  2038. }
  2039. #endif /* __MMI_VOIP__ */