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

MTK

开发平台:

C/C++

  1.         (VOIP_URI_LEN * ENCODING_LENGTH));
  2.     /* Register Port */
  3.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.port = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber);
  4.     /* Username */
  5.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.username, 0, VOIP_USERNAME_LEN);
  6.     UnicodeNToAnsii(
  7.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.username,
  8.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.username,
  9.         (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  10.     /* Password */
  11.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.password, 0, VOIP_PASSWORD_LEN);
  12.     UnicodeNToAnsii(
  13.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.password,
  14.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.password,
  15.         (VOIP_PASSWORD_LEN * ENCODING_LENGTH));
  16. }
  17. /*****************************************************************************
  18.  * FUNCTION
  19.  *  mmi_voip_update_prof_nat_disp_to_cache
  20.  * DESCRIPTION
  21.  *  Copy g_voip_cntx_p->prof_setting_info.disp_prof to
  22.  *  g_voip_cntx_p->prof_setting_info.saved_prof[index] for NAT Setting.
  23.  * PARAMETERS
  24.  *  profIndex           [IN]            Index of intended to update profile
  25.  * RETURNS
  26.  *  void
  27.  *****************************************************************************/
  28. void mmi_voip_update_prof_nat_disp_to_cache(S32 profIndex)
  29. {
  30.     /*----------------------------------------------------------------*/
  31.     /* Local Variables                                                */
  32.     /*----------------------------------------------------------------*/
  33.     /*----------------------------------------------------------------*/
  34.     /* Code Body                                                      */
  35.     /*----------------------------------------------------------------*/
  36.     /* Status */
  37.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natStatus =
  38.         g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex;
  39.     /* Firewall IP */
  40.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[0] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0]);
  41.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[1] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1]);
  42.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[2] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2]);
  43.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[3] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3]);
  44.     /* STUN Server */
  45.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunServer, 0, VOIP_URI_LEN);
  46.     UnicodeNToAnsii(
  47.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunServer,
  48.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  49.         (VOIP_URI_LEN * ENCODING_LENGTH));
  50.     /* STUN Port */
  51.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunPort = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber);
  52.     /* Refresh Interval */
  53.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.refInterval =
  54.         g_voip_cntx_p->prof_setting_info.disp_prof.intervalIndex;
  55. }
  56. /*****************************************************************************
  57.  * FUNCTION
  58.  *  mmi_voip_setup_prof_common_inlineitems
  59.  * DESCRIPTION
  60.  *  Setup inline items for Common Setting.
  61.  * PARAMETERS
  62.  *  void
  63.  * RETURNS
  64.  *  Number of inline items used in Common Setting.
  65.  *****************************************************************************/
  66. S32 mmi_voip_setup_prof_common_inlineitems(void)
  67. {
  68.     /*----------------------------------------------------------------*/
  69.     /* Local Variables                                                */
  70.     /*----------------------------------------------------------------*/
  71.     /*----------------------------------------------------------------*/
  72.     /* Code Body                                                      */
  73.     /*----------------------------------------------------------------*/
  74.     /* Profile Name caption */
  75.     SetInlineItemCaption(
  76.         wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME_CAP,
  77.         (U8*) GetString(STR_ID_VOIP_PROF_COMMON_PROFNAME));
  78.     /* Profile Name */
  79.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME, KEY_LSK, KEY_EVENT_UP);
  80.     SetInlineItemFullScreenEdit_ext(
  81.         wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME,
  82.         STR_ID_VOIP_PROF_COMMON_PROFNAME,
  83.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  84.         (U8*) g_voip_cntx_p->prof_setting_info.disp_prof.profileName,
  85.         MMI_VOIP_MAX_PROFILE_NAME_LEN,
  86.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
  87.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  88.     SetInlineFullScreenEditCustomFunction(
  89.         wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME,
  90.         mmi_voip_highlight_full_screen_editor);
  91.     /* Data Account caption */
  92.     SetInlineItemCaption(
  93.         wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT_CAP,
  94.         (U8*) GetString(STR_ID_VOIP_PROF_COMMON_DATAACCOUNT));
  95.     /* Data Account */
  96.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT, KEY_LSK, KEY_EVENT_UP);
  97.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.dataacctName, 0, ((MAX_DATA_ACCOUNT_NAME_LEN + 1) * sizeof(U16)));
  98.     mmi_dtcnt_get_account_name(
  99.         g_voip_cntx_p->prof_setting_info.disp_prof.dataacctIndex,
  100.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.dataacctName,
  101.         MAX_DATA_ACCOUNT_NAME_LEN);
  102.     SetInlineItemImageText(
  103.         wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT,
  104.         (U8*) g_voip_cntx_p->prof_setting_info.disp_prof.dataacctName,
  105.         0,
  106.         0,
  107.         0,
  108.         MAX_DATA_ACCOUNT_NAME_LEN,
  109.         0,
  110.         0,
  111.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ENCODING_BASED_LENGTH);
  112.     SetInlineFullScreenEditCustomFunctionImageText(
  113.         wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT,
  114.         mmi_voip_entry_prof_data_acct);
  115.     ShowAsControl(wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT);
  116.     /* Auto Login caption */
  117.     SetInlineItemCaption(
  118.         wgui_inline_items + MMI_VOIP_PROF_COMMON_AUTOLOGIN_CAP,
  119.         (U8*) GetString(STR_ID_VOIP_PROF_COMMON_AUTOLOGIN));
  120.     /* Auto Login */
  121.     SetInlineItemActivation(
  122.         wgui_inline_items + MMI_VOIP_PROF_COMMON_AUTOLOGIN,
  123.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  124.         0);
  125.     g_voip_cntx_p->prof_setting_info.disp_prof.twoList[0] = (U8*) GetString(STR_GLOBAL_OFF);
  126.     g_voip_cntx_p->prof_setting_info.disp_prof.twoList[1] = (U8*) GetString(STR_GLOBAL_ON);
  127.     SetInlineItemSelect(
  128.         wgui_inline_items + MMI_VOIP_PROF_COMMON_AUTOLOGIN,
  129.         2,
  130.         g_voip_cntx_p->prof_setting_info.disp_prof.twoList,
  131.         &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
  132.     /* Voice Mail Server caption */
  133.     SetInlineItemCaption(
  134.         wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER_CAP,
  135.         (U8*) GetString(STR_ID_VOIP_PROF_COMMON_VMSERVER));
  136.     /* Voice Mail Server */
  137.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER, KEY_LSK, KEY_EVENT_UP);
  138.     SetInlineItemFullScreenEdit_ext(
  139.         wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER,
  140.         STR_ID_VOIP_PROF_COMMON_VMSERVER,
  141.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  142.         g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  143.         VOIP_URI_LEN,
  144.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  145.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  146.     SetInlineFullScreenEditCustomFunction(
  147.         wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER,
  148.         mmi_voip_highlight_full_screen_editor);
  149.     return MMI_VOIP_PROF_COMMON_INLINE_TOTAL;
  150. }
  151. /*****************************************************************************
  152.  * FUNCTION
  153.  *  mmi_voip_setup_prof_acct_inlineitems
  154.  * DESCRIPTION
  155.  *  Setup inline items for Account Setting.
  156.  * PARAMETERS
  157.  *  void
  158.  * RETURNS
  159.  *  Number of inline items used in Account Setting.
  160.  *****************************************************************************/
  161. S32 mmi_voip_setup_prof_acct_inlineitems(void)
  162. {
  163.     /*----------------------------------------------------------------*/
  164.     /* Local Variables                                                */
  165.     /*----------------------------------------------------------------*/
  166.     /*----------------------------------------------------------------*/
  167.     /* Code Body                                                      */
  168.     /*----------------------------------------------------------------*/
  169.     /* SIP Server caption */
  170.     SetInlineItemCaption(
  171.         wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER_CAP,
  172.         (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_SIPSERVER));
  173.     /* SIP Server */
  174.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER, KEY_LSK, KEY_EVENT_UP);
  175.     SetInlineItemFullScreenEdit_ext(
  176.         wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER,
  177.         STR_ID_VOIP_PROF_ACCOUNT_SIPSERVER,
  178.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  179.         g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  180.         VOIP_URI_LEN,
  181.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  182.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  183.     SetInlineFullScreenEditCustomFunction(
  184.         wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER,
  185.         mmi_voip_highlight_full_screen_editor);
  186.     /* SIP Port caption */
  187.     SetInlineItemCaption(
  188.         wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT_CAP,
  189.         (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_SIPPORT));
  190.     /* SIP Port */
  191.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  192.     SetInlineItemTextEdit(
  193.         wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT,
  194.         g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  195.         MMI_VOIP_MAX_PORT_LEN,
  196.         INPUT_TYPE_NUMERIC);
  197.     RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT);
  198.     EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT);
  199.     DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT);
  200.     /* EnableInlineItemDefaultText(); */
  201.     SetInlineItemTextEditDefaultItemNameIfEmpty(
  202.         wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT,
  203.         STR_ID_VOIP_PROF_DEFAULT);
  204.     /* Display Name caption */
  205.     SetInlineItemCaption(
  206.         wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME_CAP,
  207.         (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_DISPNAME));
  208.     /* Display Name */
  209.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME, KEY_LSK, KEY_EVENT_UP);
  210.     SetInlineItemFullScreenEdit_ext(
  211.         wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME,
  212.         STR_ID_VOIP_PROF_ACCOUNT_DISPNAME,
  213.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  214.         (U8*) g_voip_cntx_p->prof_setting_info.disp_prof.displayName,
  215.         VOIP_DISP_NAME_LEN,
  216.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
  217.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  218.     SetInlineFullScreenEditCustomFunction(
  219.         wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME,
  220.         mmi_voip_highlight_full_screen_editor);
  221.     /* Username caption */
  222.     SetInlineItemCaption(
  223.         wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME_CAP,
  224.         (U8*) GetString(STR_ID_VOIP_PROF_USERNAME));
  225.     /* Username */
  226.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME, KEY_LSK, KEY_EVENT_UP);
  227.     SetInlineItemFullScreenEdit_ext(
  228.         wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME,
  229.         STR_ID_VOIP_PROF_USERNAME,
  230.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  231.         g_voip_cntx_p->prof_setting_info.disp_prof.username,
  232.         VOIP_USERNAME_LEN,
  233.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  234.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  235.     SetInlineFullScreenEditCustomFunction(
  236.         wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME,
  237.         mmi_voip_highlight_full_screen_editor);
  238.     /* Password caption */
  239.     SetInlineItemCaption(
  240.         wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD_CAP,
  241.         (U8*) GetString(STR_ID_VOIP_PROF_PASSWORD));
  242.     /* Password */
  243.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD, KEY_LSK, KEY_EVENT_UP);
  244.     SetInlineItemFullScreenEdit_ext(
  245.         wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD,
  246.         STR_ID_VOIP_PROF_PASSWORD,
  247.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  248.         g_voip_cntx_p->prof_setting_info.disp_prof.password,
  249.         VOIP_PASSWORD_LEN,
  250.         INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  251.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  252.     SetInlineFullScreenEditCustomFunction(
  253.         wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD,
  254.         mmi_voip_highlight_full_screen_editor);
  255.     /* Authorization Name caption */
  256.     SetInlineItemCaption(
  257.         wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME_CAP,
  258.         (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME));
  259.     /* Authorization Name */
  260.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME, KEY_LSK, KEY_EVENT_UP);
  261.     SetInlineItemFullScreenEdit_ext(
  262.         wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME,
  263.         STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME,
  264.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  265.         g_voip_cntx_p->prof_setting_info.disp_prof.authName,
  266.         VOIP_USERNAME_LEN,
  267.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  268.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  269.     SetInlineFullScreenEditCustomFunction(
  270.         wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME,
  271.         mmi_voip_highlight_full_screen_editor);
  272.     return MMI_VOIP_PROF_ACCT_INLINE_TOTAL;
  273. }
  274. /*****************************************************************************
  275.  * FUNCTION
  276.  *  mmi_voip_setup_prof_outbound_inlineitems
  277.  * DESCRIPTION
  278.  *  Setup inline items for Outbound Server.
  279.  * PARAMETERS
  280.  *  void
  281.  * RETURNS
  282.  *  Number of inline items used in Outbound Server.
  283.  *****************************************************************************/
  284. S32 mmi_voip_setup_prof_outbound_inlineitems(void)
  285. {
  286.     /*----------------------------------------------------------------*/
  287.     /* Local Variables                                                */
  288.     /*----------------------------------------------------------------*/
  289.     /*----------------------------------------------------------------*/
  290.     /* Code Body                                                      */
  291.     /*----------------------------------------------------------------*/
  292.     /* Status caption */
  293.     SetInlineItemCaption(
  294.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_STATUS_CAP,
  295.         (U8*) GetString(STR_ID_VOIP_PROF_STATUS));
  296.     /* Status */
  297.     SetInlineItemActivation(
  298.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_STATUS,
  299.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  300.         0);
  301.     g_voip_cntx_p->prof_setting_info.disp_prof.threeList[0] = (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_NEVER);
  302.     g_voip_cntx_p->prof_setting_info.disp_prof.threeList[1] = (U8*) GetString(STR_ID_VOIP_PROF_AUTO);
  303.     g_voip_cntx_p->prof_setting_info.disp_prof.threeList[2] = (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_ALWAYS);
  304.     SetInlineItemSelect(
  305.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_STATUS,
  306.         3,
  307.         g_voip_cntx_p->prof_setting_info.disp_prof.threeList,
  308.         &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
  309.     /* Outbound Server caption */
  310.     SetInlineItemCaption(
  311.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER_CAP,
  312.         (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_SERVER));
  313.     /* Outbound Server */
  314.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER, KEY_LSK, KEY_EVENT_UP);
  315.     SetInlineItemFullScreenEdit_ext(
  316.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER,
  317.         STR_ID_VOIP_PROF_OUTBOUND_SERVER,
  318.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  319.         g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  320.         VOIP_URI_LEN,
  321.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  322.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  323.     SetInlineFullScreenEditCustomFunction(
  324.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER,
  325.         mmi_voip_highlight_full_screen_editor);
  326.     /* Outbound Port caption */
  327.     SetInlineItemCaption(
  328.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT_CAP,
  329.         (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_PORT));
  330.     /* Outbound Port */
  331.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  332.     SetInlineItemTextEdit(
  333.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT,
  334.         g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  335.         MMI_VOIP_MAX_PORT_LEN,
  336.         INPUT_TYPE_NUMERIC);
  337.     RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT);
  338.     EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT);
  339.     DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT);
  340.     /* EnableInlineItemDefaultText(); */
  341.     SetInlineItemTextEditDefaultItemNameIfEmpty(
  342.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT,
  343.         STR_ID_VOIP_PROF_DEFAULT);
  344.     /* Username caption */
  345.     SetInlineItemCaption(
  346.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME_CAP,
  347.         (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME));
  348.     /* Username */
  349.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME, KEY_LSK, KEY_EVENT_UP);
  350.     SetInlineItemFullScreenEdit_ext(
  351.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME,
  352.         STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME,
  353.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  354.         g_voip_cntx_p->prof_setting_info.disp_prof.username,
  355.         VOIP_USERNAME_LEN,
  356.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  357.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  358.     SetInlineFullScreenEditCustomFunction(
  359.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME,
  360.         mmi_voip_highlight_full_screen_editor);
  361.     /* Password caption */
  362.     SetInlineItemCaption(
  363.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD_CAP,
  364.         (U8*) GetString(STR_ID_VOIP_PROF_PASSWORD));
  365.     /* Password */
  366.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD, KEY_LSK, KEY_EVENT_UP);
  367.     SetInlineItemFullScreenEdit_ext(
  368.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD,
  369.         STR_ID_VOIP_PROF_PASSWORD,
  370.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  371.         g_voip_cntx_p->prof_setting_info.disp_prof.password,
  372.         VOIP_PASSWORD_LEN,
  373.         INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  374.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  375.     SetInlineFullScreenEditCustomFunction(
  376.         wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD,
  377.         mmi_voip_highlight_full_screen_editor);
  378.     return MMI_VOIP_PROF_OUTBOUND_INLINE_TOTAL;
  379. }
  380. /*****************************************************************************
  381.  * FUNCTION
  382.  *  mmi_voip_setup_prof_register_inlineitems
  383.  * DESCRIPTION
  384.  *  Setup inline items for Register Server.
  385.  * PARAMETERS
  386.  *  void
  387.  * RETURNS
  388.  *  Number of inline items used in Register Server.
  389.  *****************************************************************************/
  390. S32 mmi_voip_setup_prof_register_inlineitems(void)
  391. {
  392.     /*----------------------------------------------------------------*/
  393.     /* Local Variables                                                */
  394.     /*----------------------------------------------------------------*/
  395.     /*----------------------------------------------------------------*/
  396.     /* Code Body                                                      */
  397.     /*----------------------------------------------------------------*/
  398.     /* Status caption */
  399.     SetInlineItemCaption(
  400.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_STATUS_CAP,
  401.         (U8*) GetString(STR_ID_VOIP_PROF_STATUS));
  402.     /* Status */
  403.     SetInlineItemActivation(
  404.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_STATUS,
  405.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  406.         0);
  407.     g_voip_cntx_p->prof_setting_info.disp_prof.twoList[0] = (U8*) GetString(STR_GLOBAL_OFF);
  408.     g_voip_cntx_p->prof_setting_info.disp_prof.twoList[1] = (U8*) GetString(STR_GLOBAL_ON);
  409.     SetInlineItemSelect(
  410.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_STATUS,
  411.         2,
  412.         g_voip_cntx_p->prof_setting_info.disp_prof.twoList,
  413.         &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
  414.     /* Register Server caption */
  415.     SetInlineItemCaption(
  416.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER_CAP,
  417.         (U8*) GetString(STR_ID_VOIP_PROF_REGISTER_SERVER));
  418.     /* Register Server */
  419.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER, KEY_LSK, KEY_EVENT_UP);
  420.     SetInlineItemFullScreenEdit_ext(
  421.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER,
  422.         STR_ID_VOIP_PROF_REGISTER_SERVER,
  423.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  424.         g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  425.         VOIP_URI_LEN,
  426.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  427.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  428.     SetInlineFullScreenEditCustomFunction(
  429.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER,
  430.         mmi_voip_highlight_full_screen_editor);
  431.     /* Register Port caption */
  432.     SetInlineItemCaption(
  433.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT_CAP,
  434.         (U8*) GetString(STR_ID_VOIP_PROF_REGISTER_PORT));
  435.     /* Register Port */
  436.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  437.     SetInlineItemTextEdit(
  438.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT,
  439.         g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  440.         MMI_VOIP_MAX_PORT_LEN,
  441.         INPUT_TYPE_NUMERIC);
  442.     RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT);
  443.     EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT);
  444.     DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT);
  445.     /* EnableInlineItemDefaultText(); */
  446.     SetInlineItemTextEditDefaultItemNameIfEmpty(
  447.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT,
  448.         STR_ID_VOIP_PROF_DEFAULT);
  449.     /* Username caption */
  450.     SetInlineItemCaption(
  451.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME_CAP,
  452.         (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME));
  453.     /* Username */
  454.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME, KEY_LSK, KEY_EVENT_UP);
  455.     SetInlineItemFullScreenEdit_ext(
  456.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME,
  457.         STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME,
  458.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  459.         g_voip_cntx_p->prof_setting_info.disp_prof.username,
  460.         VOIP_USERNAME_LEN,
  461.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  462.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  463.     SetInlineFullScreenEditCustomFunction(
  464.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME,
  465.         mmi_voip_highlight_full_screen_editor);
  466.     /* Password caption */
  467.     SetInlineItemCaption(
  468.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD_CAP,
  469.         (U8*) GetString(STR_ID_VOIP_PROF_PASSWORD));
  470.     /* Password */
  471.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD, KEY_LSK, KEY_EVENT_UP);
  472.     SetInlineItemFullScreenEdit_ext(
  473.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD,
  474.         STR_ID_VOIP_PROF_PASSWORD,
  475.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  476.         g_voip_cntx_p->prof_setting_info.disp_prof.password,
  477.         VOIP_PASSWORD_LEN,
  478.         INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  479.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  480.     SetInlineFullScreenEditCustomFunction(
  481.         wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD,
  482.         mmi_voip_highlight_full_screen_editor);
  483.     return MMI_VOIP_PROF_REGISTER_INLINE_TOTAL;
  484. }
  485. /*****************************************************************************
  486.  * FUNCTION
  487.  *  mmi_voip_setup_prof_nat_inlineitems
  488.  * DESCRIPTION
  489.  *  Setup inline items for NAT Setting.
  490.  * PARAMETERS
  491.  *  void
  492.  * RETURNS
  493.  *  Number of inline items used in NAT Setting.
  494.  *****************************************************************************/
  495. S32 mmi_voip_setup_prof_nat_inlineitems(void)
  496. {
  497.     /*----------------------------------------------------------------*/
  498.     /* Local Variables                                                */
  499.     /*----------------------------------------------------------------*/
  500.     /*----------------------------------------------------------------*/
  501.     /* Code Body                                                      */
  502.     /*----------------------------------------------------------------*/
  503.     /* Status caption */
  504.     SetInlineItemCaption(wgui_inline_items + MMI_VOIP_PROF_NAT_STATUS_CAP, (U8*) GetString(STR_ID_VOIP_PROF_STATUS));
  505.     /* Status */
  506.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_STATUS, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  507.     g_voip_cntx_p->prof_setting_info.disp_prof.threeList[0] = (U8*) GetString(STR_GLOBAL_OFF);
  508.     g_voip_cntx_p->prof_setting_info.disp_prof.threeList[1] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_STATICNAT);
  509.     g_voip_cntx_p->prof_setting_info.disp_prof.threeList[2] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_STUNSERVER);
  510.     SetInlineItemSelect(
  511.         wgui_inline_items + MMI_VOIP_PROF_NAT_STATUS,
  512.         3,
  513.         g_voip_cntx_p->prof_setting_info.disp_prof.threeList,
  514.         &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
  515.     /* NAT Firewall IP caption */
  516.     SetInlineItemCaption(
  517.         wgui_inline_items + MMI_VOIP_PROF_NAT_FIREWALL_CAP,
  518.         (U8*) GetString(STR_ID_VOIP_PROF_NAT_FIREWALL));
  519.     /* NAT Firewall IP */
  520.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_FIREWALL, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  521.     SetInlineItemIP4(
  522.         wgui_inline_items + MMI_VOIP_PROF_NAT_FIREWALL,
  523.         g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0],
  524.         g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1],
  525.         g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2],
  526.         g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3],
  527.         mmi_voip_prof_ip_addr_convert);
  528.     /* STUN Server caption */
  529.     SetInlineItemCaption(
  530.         wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER_CAP,
  531.         (U8*) GetString(STR_ID_VOIP_PROF_NAT_STUNSERVER));
  532.     /* STUN Server */
  533.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER, KEY_LSK, KEY_EVENT_UP);
  534.     SetInlineItemFullScreenEdit_ext(
  535.         wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER,
  536.         STR_ID_VOIP_PROF_NAT_STUNSERVER,
  537.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  538.         g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  539.         VOIP_URI_LEN,
  540.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  541.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  542.     SetInlineFullScreenEditCustomFunction(
  543.         wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER,
  544.         mmi_voip_highlight_full_screen_editor);
  545.     /* STUN Port caption */
  546.     SetInlineItemCaption(
  547.         wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT_CAP,
  548.         (U8*) GetString(STR_ID_VOIP_PROF_NAT_STUNPORT));
  549.     /* STUN Port */
  550.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  551.     SetInlineItemTextEdit(
  552.         wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT,
  553.         g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  554.         MMI_VOIP_MAX_PORT_LEN,
  555.         INPUT_TYPE_NUMERIC);
  556.     RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT);
  557.     EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT);
  558.     DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT);
  559.     /* EnableInlineItemDefaultText(); */
  560.     SetInlineItemTextEditDefaultItemNameIfEmpty(
  561.         wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT,
  562.         STR_ID_VOIP_PROF_DEFAULT);
  563.     /* NAT Refresh Interval caption */
  564.     SetInlineItemCaption(
  565.         wgui_inline_items + MMI_VOIP_PROF_NAT_INTERVAL_CAP,
  566.         (U8*) GetString(STR_ID_VOIP_PROF_NAT_INTERVAL));
  567.     /* NAT Refresh Interval */
  568.     SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_INTERVAL, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  569.     g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[0] = (U8*) GetString(STR_ID_VOIP_PROF_AUTO);
  570.     g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[1] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_5MIN);
  571.     g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[2] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_10MIN);
  572.     g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[3] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_30MIN);
  573.     g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[4] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_60MIN);
  574.     SetInlineItemSelect(
  575.         wgui_inline_items + MMI_VOIP_PROF_NAT_INTERVAL,
  576.         5,
  577.         g_voip_cntx_p->prof_setting_info.disp_prof.fiveList,
  578.         &g_voip_cntx_p->prof_setting_info.disp_prof.intervalIndex);
  579.     return MMI_VOIP_PROF_NAT_INLINE_TOTAL;
  580. }
  581. /*****************************************************************************
  582.  * FUNCTION
  583.  *  mmi_voip_entry_full_screen_editor_option
  584.  * DESCRIPTION
  585.  *  Entry function of full screen editorOption
  586.  * PARAMETERS
  587.  *  void
  588.  * RETURNS
  589.  *  void
  590.  *****************************************************************************/
  591. void mmi_voip_entry_full_screen_editor_option(void)
  592. {
  593.     /*----------------------------------------------------------------*/
  594.     /* Local Variables                                                */
  595.     /*----------------------------------------------------------------*/
  596.     U8 *guiBuffer = NULL;
  597.     U16 numItems = 0;
  598.     U16 nStrItemList[MAX_SUB_MENUS];    /* Done, Input Method */
  599.     /*----------------------------------------------------------------*/
  600.     /* Code Body                                                      */
  601.     /*----------------------------------------------------------------*/
  602.     EntryNewScreen(SCR_ID_VOIP_FULL_EDITOR_OPTION, NULL, mmi_voip_entry_full_screen_editor_option, NULL);
  603.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_FULL_EDITOR_OPTION);
  604.     SetParentHandler(MENU_ID_VOIP_FULL_EDITOR_OPTION);
  605.     numItems = GetNumOfChild(MENU_ID_VOIP_FULL_EDITOR_OPTION);
  606.     GetSequenceStringIds(MENU_ID_VOIP_FULL_EDITOR_OPTION, nStrItemList);
  607.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  608.     ShowCategory52Screen(
  609.         STR_GLOBAL_OPTIONS,
  610.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  611.         STR_GLOBAL_OK,
  612.         IMG_GLOBAL_OK,
  613.         STR_GLOBAL_BACK,
  614.         IMG_GLOBAL_BACK,
  615.         numItems,
  616.         nStrItemList,
  617.         (U16*) gIndexIconsImageList,
  618.         NULL,
  619.         0,
  620.         0,
  621.         guiBuffer);
  622.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  623.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  624. }
  625. /*****************************************************************************
  626.  * FUNCTION
  627.  *  mmi_voip_entry_prof_data_acct
  628.  * DESCRIPTION
  629.  *  Entry function of data account
  630.  * PARAMETERS
  631.  *  void
  632.  * RETURNS
  633.  *  void
  634.  *****************************************************************************/
  635. void mmi_voip_entry_prof_data_acct(void)
  636. {
  637.     /*----------------------------------------------------------------*/
  638.     /* Local Variables                                                */
  639.     /*----------------------------------------------------------------*/
  640.     /*----------------------------------------------------------------*/
  641.     /* Code Body                                                      */
  642.     /*----------------------------------------------------------------*/
  643.     mmi_dtcnt_select_account(mmi_voip_prof_data_acct_callback, MENU_ID_VOIP_MAIN, DATA_ACCOUNT_BEARER_PS_ONLY);
  644. }
  645. /*****************************************************************************
  646.  * FUNCTION
  647.  *  mmi_voip_prof_data_acct_callback
  648.  * DESCRIPTION
  649.  *  Callback function for data account selection
  650.  * PARAMETERS
  651.  *  index           [IN]            Selected index
  652.  * RETURNS
  653.  *  void
  654.  *****************************************************************************/
  655. void mmi_voip_prof_data_acct_callback(U16 index)
  656. {
  657.     /*----------------------------------------------------------------*/
  658.     /* Local Variables                                                */
  659.     /*----------------------------------------------------------------*/
  660.     /*----------------------------------------------------------------*/
  661.     /* Code Body                                                      */
  662.     /*----------------------------------------------------------------*/
  663.     g_voip_cntx_p->prof_setting_info.disp_prof.dataacctIndex = index;
  664.     DeleteUptoScrID(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
  665.     GoBackHistory();
  666.     SetInlineListMenuChanged();
  667. }
  668. /*****************************************************************************
  669.  * FUNCTION
  670.  *  mmi_voip_prof_ip_addr_convert
  671.  * DESCRIPTION
  672.  *  Convert ip format to ip string.
  673.  * PARAMETERS
  674.  *  ipStr           [IN/OUT]        Ip string in unicode
  675.  *  ip1             [IN]            First number in the ip format
  676.  *  ip2             [IN]            Second number in the ip format
  677.  *  ip3             [IN]            Third number in the ip format
  678.  *  ip4             [IN]            Fourth number in the ip format
  679.  * RETURNS
  680.  *  void
  681.  *****************************************************************************/
  682. void mmi_voip_prof_ip_addr_convert(U8 *ipStr, U8 *ip1, U8 *ip2, U8 *ip3, U8 *ip4)
  683. {
  684.     /*----------------------------------------------------------------*/
  685.     /* Local Variables                                                */
  686.     /*----------------------------------------------------------------*/
  687.     U8 dot[4];
  688.     /*----------------------------------------------------------------*/
  689.     /* Code Body                                                      */
  690.     /*----------------------------------------------------------------*/
  691.     AnsiiToUnicodeString((S8*) dot, (S8*) ".");
  692.     pfnUnicodeStrcpy((S8*) ipStr, (S8*) ip1);
  693.     pfnUnicodeStrcat((S8*) ipStr, (S8*) dot);
  694.     pfnUnicodeStrcat((S8*) ipStr, (S8*) ip2);
  695.     pfnUnicodeStrcat((S8*) ipStr, (S8*) dot);
  696.     pfnUnicodeStrcat((S8*) ipStr, (S8*) ip3);
  697.     pfnUnicodeStrcat((S8*) ipStr, (S8*) dot);
  698.     pfnUnicodeStrcat((S8*) ipStr, (S8*) ip4);
  699. }
  700. /*****************************************************************************
  701.  * FUNCTION
  702.  *  mmi_voip_prof_validate_activation
  703.  * DESCRIPTION
  704.  *  The profile can be activated only if SIP server and username are not empty.
  705.  * PARAMETERS
  706.  *  profIndex           [IN]            Index of profile
  707.  * RETURNS
  708.  *  String id of the error.
  709.  *****************************************************************************/
  710. U16 mmi_voip_prof_validate_activation(S32 profIndex)
  711. {
  712.     /*----------------------------------------------------------------*/
  713.     /* Local Variables                                                */
  714.     /*----------------------------------------------------------------*/
  715.     U16 errorstrId = 0;
  716.     /*----------------------------------------------------------------*/
  717.     /* Code Body                                                      */
  718.     /*----------------------------------------------------------------*/
  719.     if (voip_custom_get_p2p_call_state() == FALSE)
  720.     {
  721.         if (!strlen((S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.sipServer))
  722.         {
  723.             errorstrId = STR_ID_VOIP_EMPTY_SIP_SERVER;
  724.         }
  725.         if (!strlen((S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.username))
  726.         {
  727.             errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
  728.         }
  729.     }
  730.     else    /* p2p is on in the engineering mode */
  731.     {
  732.         if (!strlen((S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.username))
  733.         {
  734.             errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
  735.         }
  736.     }
  737.     return errorstrId;
  738. }
  739. /*****************************************************************************
  740.  * FUNCTION
  741.  *  mmi_voip_prof_validate_inputs
  742.  * DESCRIPTION
  743.  *  Check if the input is valid based on the current screen.
  744.  * PARAMETERS
  745.  *  void
  746.  * RETURNS
  747.  *  String id of the error.
  748.  *****************************************************************************/
  749. U16 mmi_voip_prof_validate_inputs(void)
  750. {
  751.     /*----------------------------------------------------------------*/
  752.     /* Local Variables                                                */
  753.     /*----------------------------------------------------------------*/
  754.     U16 currScreen = g_voip_cntx_p->prof_setting_info.currScr;
  755.     U16 errorstrId = 0;
  756.     /*----------------------------------------------------------------*/
  757.     /* Code Body                                                      */
  758.     /*----------------------------------------------------------------*/
  759.     switch (currScreen)
  760.     {
  761.         case SCR_ID_VOIP_PROF_COMMON:
  762.             /* validate profile name */
  763.             if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.profileName))
  764.             {
  765.                 errorstrId = STR_ID_VOIP_EMPTY_PROFILE_NAME;
  766.             }
  767.             /* validate voice mail server */
  768.             if (mmi_voip_validate_uri(g_voip_cntx_p->prof_setting_info.disp_prof.serverName) == FALSE)
  769.             {
  770.                 errorstrId = STR_ID_VOIP_INVALID_VM_SERVER;
  771.             }
  772.             break;
  773.         case SCR_ID_VOIP_PROF_ACCOUNT:
  774.             if (voip_custom_get_p2p_call_state() == FALSE)
  775.             {
  776.                 /* validate sip server */
  777.                 if ((g_voip_cntx_p->prof_setting_info.actprofIndex == g_voip_cntx_p->prof_setting_info.currprofIndex) &&
  778.                     (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
  779.                 {
  780.                     errorstrId = STR_ID_VOIP_EMPTY_SIP_SERVER;
  781.                 }
  782.                 /* validate port number */
  783.                 if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
  784.                 {
  785.                     gui_itoa(0, (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
  786.                 }
  787.                 else
  788.                 {
  789.                     if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
  790.                     {
  791.                         errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
  792.                     }
  793.                 }
  794.                 /* validate username */
  795.                 if ((g_voip_cntx_p->prof_setting_info.actprofIndex == g_voip_cntx_p->prof_setting_info.currprofIndex) &&
  796.                     (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.username)))
  797.                 {
  798.                     errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
  799.                 }
  800.                 else
  801.                 {
  802.                     if (mmi_voip_validate_uri(g_voip_cntx_p->prof_setting_info.disp_prof.username) == FALSE)
  803.                     {
  804.                         errorstrId = STR_ID_VOIP_INVALID_USERNAME;
  805.                     }
  806.                 }
  807.             }
  808.             else    /* p2p is on in the engineering mode */
  809.             {
  810.                 /* validate username */
  811.                 if ((g_voip_cntx_p->prof_setting_info.actprofIndex == g_voip_cntx_p->prof_setting_info.currprofIndex) &&
  812.                     (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.username)))
  813.                 {
  814.                     errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
  815.                 }
  816.                 else
  817.                 {
  818.                     if (mmi_voip_validate_uri(g_voip_cntx_p->prof_setting_info.disp_prof.username) == FALSE)
  819.                     {
  820.                         errorstrId = STR_ID_VOIP_INVALID_USERNAME;
  821.                     }
  822.                 }
  823.             }
  824.             break;
  825.         case SCR_ID_VOIP_PROF_OUTBOUND:
  826.             /* validate outbound server */
  827.             if (((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 1) || 
  828.                  (g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 2)) &&
  829.                 (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
  830.             {
  831.                 errorstrId = STR_ID_VOIP_EMPTY_OUTBOUND_SERVER;
  832.             }
  833.             /* validate port number */
  834.             if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
  835.             {
  836.                 gui_itoa(0, (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
  837.             }
  838.             else
  839.             {
  840.                 if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
  841.                 {
  842.                     errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
  843.                 }
  844.             }
  845.             break;
  846.         case SCR_ID_VOIP_PROF_REGISTER:
  847.             /* validate register server */
  848.             if ((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 1) &&
  849.                 (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
  850.             {
  851.                 errorstrId = STR_ID_VOIP_EMPTY_REGISTER_SERVER;
  852.             }
  853.             /* validate port number */
  854.             if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
  855.             {
  856.                 gui_itoa(0, (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
  857.             }
  858.             else
  859.             {
  860.                 if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
  861.                 {
  862.                     errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
  863.                 }
  864.             }
  865.             break;
  866.         case SCR_ID_VOIP_PROF_NAT:
  867.             /* validate nat firewall ip */
  868.             if ((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 1) &&
  869.                 (mmi_voip_validate_ip
  870.                  (g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0],
  871.                   g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1],
  872.                   g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2],
  873.                   g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3]) == FALSE))
  874.             {
  875.                 errorstrId = STR_ID_VOIP_INVALID_IP_ADDRESS;
  876.             }
  877.             /* validate stun server */
  878.             if ((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 2) &&
  879.                 (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
  880.             {
  881.                 errorstrId = STR_ID_VOIP_EMPTY_STUN_SERVER;
  882.             }
  883.             /* validate port number */
  884.             if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
  885.             {
  886.                 gui_itoa(0, (UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
  887.             }
  888.             else
  889.             {
  890.                 if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
  891.                 {
  892.                     errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
  893.                 }
  894.             }
  895.             break;
  896.         default:
  897.             MMI_ASSERT(0);
  898.     }
  899.     return errorstrId;
  900. }
  901. /*****************************************************************************
  902.  * FUNCTION
  903.  *  mmi_voip_entry_prof_confirm
  904.  * DESCRIPTION
  905.  *  Confirmation screen before saving the profile.
  906.  * PARAMETERS
  907.  *  void
  908.  * RETURNS
  909.  *  void
  910.  *****************************************************************************/
  911. void mmi_voip_entry_prof_confirm(void)
  912. {
  913.     /*----------------------------------------------------------------*/
  914.     /* Local Variables                                                */
  915.     /*----------------------------------------------------------------*/
  916.     /*----------------------------------------------------------------*/
  917.     /* Code Body                                                      */
  918.     /*----------------------------------------------------------------*/
  919.     DisplayConfirm(
  920.         STR_GLOBAL_YES,
  921.         IMG_GLOBAL_YES,
  922.         STR_GLOBAL_NO,
  923.         IMG_GLOBAL_NO,
  924.         get_string(STR_GLOBAL_SAVE),
  925.         IMG_GLOBAL_QUESTION,
  926.         WARNING_TONE);
  927.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_save, KEY_EVENT_UP);
  928.     SetRightSoftkeyFunction(mmi_voip_go_back_to_prof_edit, KEY_EVENT_UP);
  929. }
  930. /*****************************************************************************
  931.  * FUNCTION
  932.  *  mmi_voip_entry_prof_save
  933.  * DESCRIPTION
  934.  *  Save the profile.
  935.  * PARAMETERS
  936.  *  void
  937.  * RETURNS
  938.  *  void
  939.  *****************************************************************************/
  940. void mmi_voip_entry_prof_save(void)
  941. {
  942.     /*----------------------------------------------------------------*/
  943.     /* Local Variables                                                */
  944.     /*----------------------------------------------------------------*/
  945.     U16 errorstrId = 0;
  946.     U16 currScreen = g_voip_cntx_p->prof_setting_info.currScr;
  947.     S32 profIndex = g_voip_cntx_p->prof_setting_info.currprofIndex;
  948.     /*----------------------------------------------------------------*/
  949.     /* Code Body                                                      */
  950.     /*----------------------------------------------------------------*/
  951.     errorstrId = mmi_voip_prof_validate_inputs();
  952.     if (errorstrId != 0)
  953.     {
  954.         DisplayPopup(
  955.             (U8*)GetString(errorstrId), 
  956.             IMG_GLOBAL_UNFINISHED, 
  957.             1, 
  958.             UI_POPUP_NOTIFYDURATION_TIME, 
  959.             ERROR_TONE);
  960.         return;
  961.     }
  962.     switch (currScreen)
  963.     {
  964.         case SCR_ID_VOIP_PROF_COMMON:
  965.             mmi_voip_update_prof_common_disp_to_cache(profIndex);
  966.             break;
  967.         case SCR_ID_VOIP_PROF_ACCOUNT:
  968.             mmi_voip_update_prof_acct_disp_to_cache(profIndex);
  969.             break;
  970.         case SCR_ID_VOIP_PROF_OUTBOUND:
  971.             mmi_voip_update_prof_outbound_disp_to_cache(profIndex);
  972.             break;
  973.         case SCR_ID_VOIP_PROF_REGISTER:
  974.             mmi_voip_update_prof_register_disp_to_cache(profIndex);
  975.             break;
  976.         case SCR_ID_VOIP_PROF_NAT:
  977.             mmi_voip_update_prof_nat_disp_to_cache(profIndex);
  978.             break;
  979.         default:
  980.             MMI_ASSERT(0);
  981.     }
  982.     if (mmi_voip_save_profile(profIndex))
  983.     {
  984.         DisplayPopup(
  985.             (U8*)GetString(STR_GLOBAL_SAVED),
  986.             IMG_GLOBAL_ACTIVATED,
  987.             1,
  988.             UI_POPUP_NOTIFYDURATION_TIME,
  989.             SUCCESS_TONE);
  990.         DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
  991.     }
  992.     else
  993.     {
  994.         DisplayPopup(
  995.             (U8*)GetString(STR_GLOBAL_NOT_DONE),
  996.             IMG_GLOBAL_UNFINISHED,
  997.             1,
  998.             UI_POPUP_NOTIFYDURATION_TIME,
  999.             ERROR_TONE);
  1000.         DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
  1001.     }
  1002. }
  1003. /*****************************************************************************
  1004.  * FUNCTION
  1005.  *  mmi_voip_go_back_to_prof_edit
  1006.  * DESCRIPTION
  1007.  *  Go back to profile edit screen.
  1008.  * PARAMETERS
  1009.  *  void
  1010.  * RETURNS
  1011.  *  void
  1012.  *****************************************************************************/
  1013. void mmi_voip_go_back_to_prof_edit(void)
  1014. {
  1015.     /*----------------------------------------------------------------*/
  1016.     /* Local Variables                                                */
  1017.     /*----------------------------------------------------------------*/
  1018.     /*----------------------------------------------------------------*/
  1019.     /* Code Body                                                      */
  1020.     /*----------------------------------------------------------------*/
  1021.     DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
  1022.     GoBackHistory();
  1023. }
  1024. /*****************************************************************************
  1025.  * FUNCTION
  1026.  *  mmi_voip_entry_call_setting
  1027.  * DESCRIPTION
  1028.  *  Entry function of VoIPCall Setting
  1029.  * PARAMETERS
  1030.  *  void
  1031.  * RETURNS
  1032.  *  void
  1033.  *****************************************************************************/
  1034. void mmi_voip_entry_call_setting(void)
  1035. {
  1036.     /*----------------------------------------------------------------*/
  1037.     /* Local Variables                                                */
  1038.     /*----------------------------------------------------------------*/
  1039.     U8 *guiBuffer = NULL;
  1040.     U16 numItems = 0;
  1041.     U16 nStrItemList[MAX_SUB_MENUS];
  1042.     /* Auto Answer, Auto Reject, Auto Redial, Hide Caller ID, DTMF, Set Codec Order */
  1043.     U8 *nHintItemList[MAX_SUB_MENUS];
  1044.     /*----------------------------------------------------------------*/
  1045.     /* Code Body                                                      */
  1046.     /*----------------------------------------------------------------*/
  1047.     EntryNewScreen(SCR_ID_VOIP_CALL_SETTING, NULL, mmi_voip_entry_call_setting, NULL);
  1048.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_CALL_SETTING);
  1049.     SetParentHandler(MENU_ID_VOIP_CALL_SETTING);
  1050.     numItems = GetNumOfChild(MENU_ID_VOIP_CALL_SETTING);
  1051.     GetSequenceStringIds(MENU_ID_VOIP_CALL_SETTING, nStrItemList);
  1052.     ConstructHintsList(MENU_ID_VOIP_CALL_SETTING, nHintItemList);
  1053.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1054.     ShowCategory52Screen(
  1055.         STR_ID_VOIP_CALL_SETTING,
  1056.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1057.         STR_GLOBAL_OK,
  1058.         IMG_GLOBAL_OK,
  1059.         STR_GLOBAL_BACK,
  1060.         IMG_GLOBAL_BACK,
  1061.         numItems,
  1062.         nStrItemList,
  1063.         (U16*) gIndexIconsImageList,
  1064.         nHintItemList,
  1065.         0,
  1066.         0,
  1067.         guiBuffer);
  1068.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1069.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1070. }
  1071. /*****************************************************************************
  1072.  * FUNCTION
  1073.  *  mmi_voip_entry_setting_general
  1074.  * DESCRIPTION
  1075.  *  Entry function of VoIPCall SettingOK
  1076.  * PARAMETERS
  1077.  *  void
  1078.  * RETURNS
  1079.  *  void
  1080.  *****************************************************************************/
  1081. void mmi_voip_entry_setting_general(void)
  1082. {
  1083.     /*----------------------------------------------------------------*/
  1084.     /* Local Variables                                                */
  1085.     /*----------------------------------------------------------------*/
  1086.     U16 currScreen = g_voip_cntx_p->call_setting_info.currScr;
  1087.     U8 *guiBuffer = NULL;
  1088.     U16 titleId = 0, numItems = 0;
  1089.     U16 nStrItemList[MAX_SUB_MENUS];
  1090.     /*----------------------------------------------------------------*/
  1091.     /* Code Body                                                      */
  1092.     /*----------------------------------------------------------------*/
  1093.     EntryNewScreen(SCR_ID_VOIP_SETTING_GENERAL, NULL, mmi_voip_entry_setting_general, NULL);
  1094.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_SETTING_GENERAL);
  1095.     switch (currScreen)
  1096.     {
  1097.         case SCR_ID_VOIP_SETTING_AUTO_ANSWER:
  1098.             mmi_voip_update_setting_answer_cache_to_disp();
  1099.             titleId = STR_ID_VOIP_SETTING_AUTO_ANSWER;
  1100.             numItems = 3;
  1101.             nStrItemList[0] = STR_GLOBAL_OFF;
  1102.             nStrItemList[1] = STR_ID_VOIP_SETTING_ANYKEY;
  1103.             nStrItemList[2] = STR_ID_VOIP_SETTING_AUTO;
  1104.             break;
  1105.         case SCR_ID_VOIP_SETTING_AUTO_REJECT:
  1106.             mmi_voip_update_setting_reject_cache_to_disp();
  1107.             titleId = STR_ID_VOIP_SETTING_AUTO_REJECT;
  1108.             numItems = 3;
  1109.             nStrItemList[0] = STR_GLOBAL_OFF;
  1110.             nStrItemList[1] = STR_ID_VOIP_SETTING_REJECT_UNKNOWN;
  1111.             nStrItemList[2] = STR_ID_VOIP_SETTING_REJECT_ALL;
  1112.             break;
  1113.         case SCR_ID_VOIP_SETTING_AUTO_REDIAL:
  1114.             mmi_voip_update_setting_redial_cache_to_disp();
  1115.             titleId = STR_ID_VOIP_SETTING_AUTO_REDIAL;
  1116.             numItems = 2;
  1117.             nStrItemList[0] = STR_GLOBAL_OFF;
  1118.             nStrItemList[1] = STR_GLOBAL_ON;
  1119.             break;
  1120.         case SCR_ID_VOIP_SETTING_HIDE_CALLER_ID:
  1121.             mmi_voip_update_setting_hide_cache_to_disp();
  1122.             titleId = STR_ID_VOIP_SETTING_HIDE_CALLER_ID;
  1123.             numItems = 2;
  1124.             nStrItemList[0] = STR_GLOBAL_OFF;
  1125.             nStrItemList[1] = STR_GLOBAL_ON;
  1126.             break;
  1127.         case SCR_ID_VOIP_SETTING_DTMF:
  1128.             mmi_voip_update_setting_dtmf_cache_to_disp();
  1129.             titleId = STR_ID_VOIP_SETTING_DTMF;
  1130.             numItems = 3;
  1131.             nStrItemList[0] = STR_ID_VOIP_SETTING_INBAND;
  1132.             nStrItemList[1] = STR_ID_VOIP_SETTING_OUTBAND;
  1133.             nStrItemList[2] = STR_GLOBAL_OFF;
  1134.             break;
  1135.         case SCR_ID_VOIP_SETTING_COMFORT_NOISE:
  1136.             mmi_voip_update_setting_noise_cache_to_disp();
  1137.             titleId = STR_ID_VOIP_SETTING_COMFORT_NOISE;
  1138.             numItems = 2;
  1139.             nStrItemList[0] = STR_GLOBAL_ON;
  1140.             nStrItemList[1] = STR_GLOBAL_OFF;
  1141.             break;
  1142.         case SCR_ID_VOIP_SETTING_SET_CODEC_ORDER:
  1143.         default:
  1144.             MMI_ASSERT(0);
  1145.     }
  1146.     RegisterHighlightHandler(mmi_voip_highlight_setting_general_item);
  1147.     ShowCategory11Screen(
  1148.         titleId,
  1149.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1150.         STR_GLOBAL_OK,
  1151.         IMG_GLOBAL_OK,
  1152.         STR_GLOBAL_BACK,
  1153.         IMG_GLOBAL_BACK,
  1154.         numItems,
  1155.         nStrItemList,
  1156.         (U16) g_voip_cntx_p->call_setting_info.currIndex,
  1157.         guiBuffer);
  1158.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general_confirm, KEY_EVENT_UP);
  1159.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1160.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1161. }
  1162. /*****************************************************************************
  1163.  * FUNCTION
  1164.  *  mmi_voip_highlight_setting_general_item
  1165.  * DESCRIPTION
  1166.  *  Highlight item of selecting a selection in VoIPCall SettingOK
  1167.  * PARAMETERS
  1168.  *  index           [IN]            Current highlight index.
  1169.  * RETURNS
  1170.  *  void
  1171.  *****************************************************************************/
  1172. void mmi_voip_highlight_setting_general_item(S32 index)
  1173. {
  1174.     /*----------------------------------------------------------------*/
  1175.     /* Local Variables                                                */
  1176.     /*----------------------------------------------------------------*/
  1177.     /*----------------------------------------------------------------*/
  1178.     /* Code Body                                                      */
  1179.     /*----------------------------------------------------------------*/
  1180.     g_voip_cntx_p->call_setting_info.currIndex = index;
  1181. }
  1182. /*****************************************************************************
  1183.  * FUNCTION
  1184.  *  mmi_voip_update_setting_answer_cache_to_disp
  1185.  * DESCRIPTION
  1186.  *  Copy g_voip_cntx_p->call_setting_info.saved_setting to
  1187.  *  g_voip_cntx_p->call_setting_info.currIndex for Auto Answer.
  1188.  * PARAMETERS
  1189.  *  void
  1190.  * RETURNS
  1191.  *  void
  1192.  *****************************************************************************/
  1193. void mmi_voip_update_setting_answer_cache_to_disp(void)
  1194. {
  1195.     /*----------------------------------------------------------------*/
  1196.     /* Local Variables                                                */
  1197.     /*----------------------------------------------------------------*/
  1198.     /*----------------------------------------------------------------*/
  1199.     /* Code Body                                                      */
  1200.     /*----------------------------------------------------------------*/
  1201.     g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer;
  1202. }
  1203. /*****************************************************************************
  1204.  * FUNCTION
  1205.  *  mmi_voip_update_setting_reject_cache_to_disp
  1206.  * DESCRIPTION
  1207.  *  Copy g_voip_cntx_p->call_setting_info.saved_setting to
  1208.  *  g_voip_cntx_p->call_setting_info.currIndex for Auto Reject.
  1209.  * PARAMETERS
  1210.  *  void
  1211.  * RETURNS
  1212.  *  void
  1213.  *****************************************************************************/
  1214. void mmi_voip_update_setting_reject_cache_to_disp(void)
  1215. {
  1216.     /*----------------------------------------------------------------*/
  1217.     /* Local Variables                                                */
  1218.     /*----------------------------------------------------------------*/
  1219.     /*----------------------------------------------------------------*/
  1220.     /* Code Body                                                      */
  1221.     /*----------------------------------------------------------------*/
  1222.     g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.autoReject;
  1223. }
  1224. /*****************************************************************************
  1225.  * FUNCTION
  1226.  *  mmi_voip_update_setting_redial_cache_to_disp
  1227.  * DESCRIPTION
  1228.  *  Copy g_voip_cntx_p->call_setting_info.saved_setting to
  1229.  *  g_voip_cntx_p->call_setting_info.currIndex for Auto Redial.
  1230.  * PARAMETERS
  1231.  *  void
  1232.  * RETURNS
  1233.  *  void
  1234.  *****************************************************************************/
  1235. void mmi_voip_update_setting_redial_cache_to_disp(void)
  1236. {
  1237.     /*----------------------------------------------------------------*/
  1238.     /* Local Variables                                                */
  1239.     /*----------------------------------------------------------------*/
  1240.     /*----------------------------------------------------------------*/
  1241.     /* Code Body                                                      */
  1242.     /*----------------------------------------------------------------*/
  1243.     g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.autoRedial;
  1244. }
  1245. /*****************************************************************************
  1246.  * FUNCTION
  1247.  *  mmi_voip_update_setting_hide_cache_to_disp
  1248.  * DESCRIPTION
  1249.  *  Copy g_voip_cntx_p->call_setting_info.saved_setting to
  1250.  *  g_voip_cntx_p->call_setting_info.currIndex for Hide Caller ID.
  1251.  * PARAMETERS
  1252.  *  void
  1253.  * RETURNS
  1254.  *  void
  1255.  *****************************************************************************/
  1256. void mmi_voip_update_setting_hide_cache_to_disp(void)
  1257. {
  1258.     /*----------------------------------------------------------------*/
  1259.     /* Local Variables                                                */
  1260.     /*----------------------------------------------------------------*/
  1261.     /*----------------------------------------------------------------*/
  1262.     /* Code Body                                                      */
  1263.     /*----------------------------------------------------------------*/
  1264.     g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId;
  1265. }
  1266. /*****************************************************************************
  1267.  * FUNCTION
  1268.  *  mmi_voip_update_setting_dtmf_cache_to_disp
  1269.  * DESCRIPTION
  1270.  *  Copy g_voip_cntx_p->call_setting_info.saved_setting to
  1271.  *  g_voip_cntx_p->call_setting_info.currIndex for DTMF.
  1272.  * PARAMETERS
  1273.  *  void
  1274.  * RETURNS
  1275.  *  void
  1276.  *****************************************************************************/
  1277. void mmi_voip_update_setting_dtmf_cache_to_disp(void)
  1278. {
  1279.     /*----------------------------------------------------------------*/
  1280.     /* Local Variables                                                */
  1281.     /*----------------------------------------------------------------*/
  1282.     /*----------------------------------------------------------------*/
  1283.     /* Code Body                                                      */
  1284.     /*----------------------------------------------------------------*/
  1285.     g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.dtmf;
  1286. }
  1287. /*****************************************************************************
  1288.  * FUNCTION
  1289.  *  mmi_voip_update_setting_noise_cache_to_disp
  1290.  * DESCRIPTION
  1291.  *  Copy g_voip_cntx_p->call_setting_info.saved_setting to
  1292.  *  g_voip_cntx_p->call_setting_info.currIndex for Comfort Noise.
  1293.  * PARAMETERS
  1294.  *  void
  1295.  * RETURNS
  1296.  *  void
  1297.  *****************************************************************************/
  1298. void mmi_voip_update_setting_noise_cache_to_disp(void)
  1299. {
  1300.     /*----------------------------------------------------------------*/
  1301.     /* Local Variables                                                */
  1302.     /*----------------------------------------------------------------*/
  1303.     /*----------------------------------------------------------------*/
  1304.     /* Code Body                                                      */
  1305.     /*----------------------------------------------------------------*/
  1306.     g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise;
  1307. }
  1308. /*****************************************************************************
  1309.  * FUNCTION
  1310.  *  mmi_voip_update_setting_codec_cache_to_disp
  1311.  * DESCRIPTION
  1312.  *  Copy g_voip_cntx_p->call_setting_info.saved_setting to
  1313.  *  g_voip_cntx_p->call_setting_info.dispCodec for Set Codec Order.
  1314.  * PARAMETERS
  1315.  *  void
  1316.  * RETURNS
  1317.  *  void
  1318.  *****************************************************************************/
  1319. void mmi_voip_update_setting_codec_cache_to_disp(void)
  1320. {
  1321.     /*----------------------------------------------------------------*/
  1322.     /* Local Variables                                                */
  1323.     /*----------------------------------------------------------------*/
  1324.     S32 i = 0, j = 0;
  1325.     /*----------------------------------------------------------------*/
  1326.     /* Code Body                                                      */
  1327.     /*----------------------------------------------------------------*/
  1328.     for (i = 0; i < g_voip_cntx_p->call_setting_info.numCodec; i++)
  1329.     {
  1330.         memset(g_voip_cntx_p->call_setting_info.dispCodec[i], 0, (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
  1331.         if (strlen((S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i]))
  1332.         {
  1333.             AnsiiNToUnicodeString(
  1334.                 (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
  1335.                 (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i],
  1336.                 MMI_VOIP_MAX_CODEC_NAME_LEN);
  1337.             for (j = 0; j < MMI_VOIP_MAX_CODEC_NUM; j++)
  1338.             {
  1339.                 if (!pfnUnicodeStrcmp((S8*)g_voip_cntx_p->call_setting_info.dispCodec[i], (S8*)GetString(STR_ID_VOIP_SETTING_CODEC2 + j)))
  1340.                 {
  1341.                     g_voip_cntx_p->call_setting_info.codecEnum[i] = g_voip_codec_table[j + 1];  /* AMR should not appear in the menu */
  1342.                     break;
  1343.                 }
  1344.             }
  1345.         }
  1346.         else
  1347.         {
  1348.             g_voip_cntx_p->call_setting_info.numCodec = i;
  1349.             break;
  1350.         }
  1351.     }
  1352. }
  1353. /*****************************************************************************
  1354.  * FUNCTION
  1355.  *  mmi_voip_update_setting_answer_disp_to_cache
  1356.  * DESCRIPTION
  1357.  *  Copy g_voip_cntx_p->call_setting_info.currIndex to
  1358.  *  g_voip_cntx_p->call_setting_info.saved_setting for Auto Answer.
  1359.  * PARAMETERS
  1360.  *  void
  1361.  * RETURNS
  1362.  *  TRUE means the data is different from the original;
  1363.  *  FALSE means the data is the same as the original.
  1364.  *****************************************************************************/
  1365. BOOL mmi_voip_update_setting_answer_disp_to_cache(void)
  1366. {
  1367.     /*----------------------------------------------------------------*/
  1368.     /* Local Variables                                                */
  1369.     /*----------------------------------------------------------------*/
  1370.     /*----------------------------------------------------------------*/
  1371.     /* Code Body                                                      */
  1372.     /*----------------------------------------------------------------*/
  1373.     if (g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer != g_voip_cntx_p->call_setting_info.currIndex)
  1374.     {
  1375.         g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer = g_voip_cntx_p->call_setting_info.currIndex;
  1376.         return TRUE;
  1377.     }
  1378.     return FALSE;
  1379. }
  1380. /*****************************************************************************
  1381.  * FUNCTION
  1382.  *  mmi_voip_update_setting_reject_disp_to_cache
  1383.  * DESCRIPTION
  1384.  *  Copy g_voip_cntx_p->call_setting_info.currIndex to
  1385.  *  g_voip_cntx_p->call_setting_info.saved_setting for Auto Reject.
  1386.  * PARAMETERS
  1387.  *  void
  1388.  * RETURNS
  1389.  *  TRUE means the data is different from the original;
  1390.  *  FALSE means the data is the same as the original.
  1391.  *****************************************************************************/
  1392. BOOL mmi_voip_update_setting_reject_disp_to_cache(void)
  1393. {
  1394.     /*----------------------------------------------------------------*/
  1395.     /* Local Variables                                                */
  1396.     /*----------------------------------------------------------------*/
  1397.     /*----------------------------------------------------------------*/
  1398.     /* Code Body                                                      */
  1399.     /*----------------------------------------------------------------*/
  1400.     if (g_voip_cntx_p->call_setting_info.saved_setting.autoReject != g_voip_cntx_p->call_setting_info.currIndex)
  1401.     {
  1402.         g_voip_cntx_p->call_setting_info.saved_setting.autoReject = g_voip_cntx_p->call_setting_info.currIndex;
  1403.         return TRUE;
  1404.     }
  1405.     return FALSE;
  1406. }
  1407. /*****************************************************************************
  1408.  * FUNCTION
  1409.  *  mmi_voip_update_setting_redial_disp_to_cache
  1410.  * DESCRIPTION
  1411.  *  Copy g_voip_cntx_p->call_setting_info.currIndex to
  1412.  *  g_voip_cntx_p->call_setting_info.saved_setting for Auto Redial.
  1413.  * PARAMETERS
  1414.  *  void
  1415.  * RETURNS
  1416.  *  TRUE means the data is different from the original;
  1417.  *  FALSE means the data is the same as the original.
  1418.  *****************************************************************************/
  1419. BOOL mmi_voip_update_setting_redial_disp_to_cache(void)
  1420. {
  1421.     /*----------------------------------------------------------------*/
  1422.     /* Local Variables                                                */
  1423.     /*----------------------------------------------------------------*/
  1424.     /*----------------------------------------------------------------*/
  1425.     /* Code Body                                                      */
  1426.     /*----------------------------------------------------------------*/
  1427.     if (g_voip_cntx_p->call_setting_info.saved_setting.autoRedial != g_voip_cntx_p->call_setting_info.currIndex)
  1428.     {
  1429.         g_voip_cntx_p->call_setting_info.saved_setting.autoRedial = g_voip_cntx_p->call_setting_info.currIndex;
  1430.         return TRUE;
  1431.     }
  1432.     return FALSE;
  1433. }
  1434. /*****************************************************************************
  1435.  * FUNCTION
  1436.  *  mmi_voip_update_setting_hide_disp_to_cache
  1437.  * DESCRIPTION
  1438.  *  Copy g_voip_cntx_p->call_setting_info.currIndex to
  1439.  *  g_voip_cntx_p->call_setting_info.saved_setting for Hide Caller ID.
  1440.  * PARAMETERS
  1441.  *  void
  1442.  * RETURNS
  1443.  *  TRUE means the data is different from the original;
  1444.  *  FALSE means the data is the same as the original.
  1445.  *****************************************************************************/
  1446. BOOL mmi_voip_update_setting_hide_disp_to_cache(void)
  1447. {
  1448.     /*----------------------------------------------------------------*/
  1449.     /* Local Variables                                                */
  1450.     /*----------------------------------------------------------------*/
  1451.     /*----------------------------------------------------------------*/
  1452.     /* Code Body                                                      */
  1453.     /*----------------------------------------------------------------*/
  1454.     if (g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId != g_voip_cntx_p->call_setting_info.currIndex)
  1455.     {
  1456.         g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId = g_voip_cntx_p->call_setting_info.currIndex;
  1457.         return TRUE;
  1458.     }
  1459.     return FALSE;
  1460. }
  1461. /*****************************************************************************
  1462.  * FUNCTION
  1463.  *  mmi_voip_update_setting_dtmf_disp_to_cache
  1464.  * DESCRIPTION
  1465.  *  Copy g_voip_cntx_p->call_setting_info.currIndex to
  1466.  *  g_voip_cntx_p->call_setting_info.saved_setting for DTMF.
  1467.  * PARAMETERS
  1468.  *  void
  1469.  * RETURNS
  1470.  *  TRUE means the data is different from the original;
  1471.  *  FALSE means the data is the same as the original.
  1472.  *****************************************************************************/
  1473. BOOL mmi_voip_update_setting_dtmf_disp_to_cache(void)
  1474. {
  1475.     /*----------------------------------------------------------------*/
  1476.     /* Local Variables                                                */
  1477.     /*----------------------------------------------------------------*/
  1478.     /*----------------------------------------------------------------*/
  1479.     /* Code Body                                                      */
  1480.     /*----------------------------------------------------------------*/
  1481.     if (g_voip_cntx_p->call_setting_info.saved_setting.dtmf != g_voip_cntx_p->call_setting_info.currIndex)
  1482.     {
  1483.         g_voip_cntx_p->call_setting_info.saved_setting.dtmf = g_voip_cntx_p->call_setting_info.currIndex;
  1484.         return TRUE;
  1485.     }
  1486.     return FALSE;
  1487. }
  1488. /*****************************************************************************
  1489.  * FUNCTION
  1490.  *  mmi_voip_update_setting_noise_disp_to_cache
  1491.  * DESCRIPTION
  1492.  *  Copy g_voip_cntx_p->call_setting_info.currIndex to
  1493.  *  g_voip_cntx_p->call_setting_info.saved_setting for Comfort Noise.
  1494.  * PARAMETERS
  1495.  *  void
  1496.  * RETURNS
  1497.  *  TRUE means the data is different from the original;
  1498.  *  FALSE means the data is the same as the original.
  1499.  *****************************************************************************/
  1500. BOOL mmi_voip_update_setting_noise_disp_to_cache(void)
  1501. {
  1502.     /*----------------------------------------------------------------*/
  1503.     /* Local Variables                                                */
  1504.     /*----------------------------------------------------------------*/
  1505.     /*----------------------------------------------------------------*/
  1506.     /* Code Body                                                      */
  1507.     /*----------------------------------------------------------------*/
  1508.     if (g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise != g_voip_cntx_p->call_setting_info.currIndex)
  1509.     {
  1510.         g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise = g_voip_cntx_p->call_setting_info.currIndex;
  1511.         return TRUE;
  1512.     }
  1513.     return FALSE;
  1514. }
  1515. /*****************************************************************************
  1516.  * FUNCTION
  1517.  *  mmi_voip_update_setting_codec_disp_to_cache
  1518.  * DESCRIPTION
  1519.  *  Copy g_voip_cntx_p->call_setting_info.dispCodec to
  1520.  *  g_voip_cntx_p->call_setting_info.saved_setting for Set Codec Order.
  1521.  * PARAMETERS
  1522.  *  void
  1523.  * RETURNS
  1524.  *  TRUE means the data is different from the original;
  1525.  *  FALSE means the data is the same as the original.
  1526.  *****************************************************************************/
  1527. BOOL mmi_voip_update_setting_codec_disp_to_cache(void)
  1528. {
  1529.     /*----------------------------------------------------------------*/
  1530.     /* Local Variables                                                */
  1531.     /*----------------------------------------------------------------*/
  1532.     S32 i = 0, j = 0;
  1533.     /*----------------------------------------------------------------*/
  1534.     /* Code Body                                                      */
  1535.     /*----------------------------------------------------------------*/
  1536.     for (i = 0; i < g_voip_cntx_p->call_setting_info.numCodec; i++)
  1537.     {
  1538.         memset(g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i], 0, MMI_VOIP_MAX_CODEC_NAME_LEN);
  1539.         UnicodeNToAnsii(
  1540.             (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i],
  1541.             (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
  1542.             (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
  1543.         for (j = 0; j < MMI_VOIP_MAX_CODEC_NUM; j++)
  1544.         {
  1545.             if (!pfnUnicodeStrcmp((S8*)g_voip_cntx_p->call_setting_info.dispCodec[i], (S8*)GetString(STR_ID_VOIP_SETTING_CODEC2 + j)))
  1546.             {
  1547.                 g_voip_cntx_p->call_setting_info.codecEnum[i] = g_voip_codec_table[j + 1];      /* AMR should not appear in the menu */
  1548.                 break;
  1549.             }
  1550.         }
  1551.     }
  1552.     return TRUE;
  1553. }
  1554. /*****************************************************************************
  1555.  * FUNCTION
  1556.  *  mmi_voip_entry_setting_general_confirm
  1557.  * DESCRIPTION
  1558.  *  Confirmation screen before saving the setting.
  1559.  * PARAMETERS
  1560.  *  void
  1561.  * RETURNS
  1562.  *  void
  1563.  *****************************************************************************/
  1564. void mmi_voip_entry_setting_general_confirm(void)
  1565. {
  1566.     /*----------------------------------------------------------------*/
  1567.     /* Local Variables                                                */
  1568.     /*----------------------------------------------------------------*/
  1569.     /*----------------------------------------------------------------*/
  1570.     /* Code Body                                                      */
  1571.     /*----------------------------------------------------------------*/
  1572.     DisplayConfirm(
  1573.         STR_GLOBAL_YES,
  1574.         IMG_GLOBAL_YES,
  1575.         STR_GLOBAL_NO,
  1576.         IMG_GLOBAL_NO,
  1577.         get_string(STR_GLOBAL_SAVE),
  1578.         IMG_GLOBAL_QUESTION,
  1579.         WARNING_TONE);
  1580.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general_save, KEY_EVENT_UP);
  1581.     SetRightSoftkeyFunction(mmi_voip_go_back_to_call_setting, KEY_EVENT_UP);
  1582. }
  1583. /*****************************************************************************
  1584.  * FUNCTION
  1585.  *  mmi_voip_entry_setting_general_save
  1586.  * DESCRIPTION
  1587.  *  Save the setting.
  1588.  * PARAMETERS
  1589.  *  void
  1590.  * RETURNS
  1591.  *  void
  1592.  *****************************************************************************/
  1593. void mmi_voip_entry_setting_general_save(void)
  1594. {
  1595.     /*----------------------------------------------------------------*/
  1596.     /* Local Variables                                                */
  1597.     /*----------------------------------------------------------------*/
  1598.     U16 currScreen = g_voip_cntx_p->call_setting_info.currScr;
  1599.     BOOL isChange = FALSE;
  1600.     /*----------------------------------------------------------------*/
  1601.     /* Code Body                                                      */
  1602.     /*----------------------------------------------------------------*/
  1603.     switch (currScreen)
  1604.     {
  1605.         case SCR_ID_VOIP_SETTING_AUTO_ANSWER:
  1606.             isChange = mmi_voip_update_setting_answer_disp_to_cache();
  1607.             break;
  1608.         case SCR_ID_VOIP_SETTING_AUTO_REJECT:
  1609.             isChange = mmi_voip_update_setting_reject_disp_to_cache();
  1610.             break;
  1611.         case SCR_ID_VOIP_SETTING_AUTO_REDIAL:
  1612.             isChange = mmi_voip_update_setting_redial_disp_to_cache();
  1613.             break;
  1614.         case SCR_ID_VOIP_SETTING_HIDE_CALLER_ID:
  1615.             isChange = mmi_voip_update_setting_hide_disp_to_cache();
  1616.             break;
  1617.         case SCR_ID_VOIP_SETTING_DTMF:
  1618.             isChange = mmi_voip_update_setting_dtmf_disp_to_cache();
  1619.             break;
  1620.         case SCR_ID_VOIP_SETTING_COMFORT_NOISE:
  1621.             isChange = mmi_voip_update_setting_noise_disp_to_cache();
  1622.             break;
  1623.         case SCR_ID_VOIP_SETTING_SET_CODEC_ORDER:
  1624.         default:
  1625.             MMI_ASSERT(0);
  1626.     }
  1627.     if (mmi_voip_save_setting())
  1628.     {
  1629.         if (isChange)
  1630.         {
  1631.             mmi_voip_setting_req();
  1632.         }
  1633.         else
  1634.         {
  1635.             DisplayPopup(
  1636.                 (U8*)GetString(STR_GLOBAL_SAVED),
  1637.                 IMG_GLOBAL_ACTIVATED,
  1638.                 1,
  1639.                 UI_POPUP_NOTIFYDURATION_TIME,
  1640.                 SUCCESS_TONE);
  1641.             DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_GENERAL);
  1642.         }
  1643.     }
  1644.     else
  1645.     {
  1646.         DisplayPopup(
  1647.             (U8*)GetString(STR_GLOBAL_NOT_DONE),
  1648.             IMG_GLOBAL_UNFINISHED,
  1649.             1,
  1650.             UI_POPUP_NOTIFYDURATION_TIME,
  1651.             ERROR_TONE);
  1652.         DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_GENERAL);
  1653.     }
  1654. }
  1655. /*****************************************************************************
  1656.  * FUNCTION
  1657.  *  mmi_voip_go_back_to_call_setting
  1658.  * DESCRIPTION
  1659.  *  Go back to call setting screen.
  1660.  * PARAMETERS
  1661.  *  void
  1662.  * RETURNS
  1663.  *  void
  1664.  *****************************************************************************/
  1665. void mmi_voip_go_back_to_call_setting(void)
  1666. {
  1667.     /*----------------------------------------------------------------*/
  1668.     /* Local Variables                                                */
  1669.     /*----------------------------------------------------------------*/
  1670.     /*----------------------------------------------------------------*/
  1671.     /* Code Body                                                      */
  1672.     /*----------------------------------------------------------------*/
  1673.     DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_GENERAL);
  1674.     GoBackHistory();
  1675. }
  1676. /*****************************************************************************
  1677.  * FUNCTION
  1678.  *  mmi_voip_entry_set_codec_order
  1679.  * DESCRIPTION
  1680.  *  Entry function of VoIPCall SettingSet Codec Order
  1681.  * PARAMETERS
  1682.  *  void
  1683.  * RETURNS
  1684.  *  void
  1685.  *****************************************************************************/
  1686. void mmi_voip_entry_set_codec_order(void)
  1687. {
  1688.     /*----------------------------------------------------------------*/
  1689.     /* Local Variables                                                */
  1690.     /*----------------------------------------------------------------*/
  1691.     U8 *guiBuffer = NULL;
  1692.     U16 numItems = 0;
  1693.     U8 *nStrItemList[MAX_SUB_MENUS];
  1694.     S32 i = 0;
  1695.     /*----------------------------------------------------------------*/
  1696.     /* Code Body                                                      */
  1697.     /*----------------------------------------------------------------*/
  1698.     EntryNewScreen(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER, NULL, mmi_voip_entry_set_codec_order, NULL);
  1699.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER);
  1700.     mmi_voip_update_setting_codec_cache_to_disp();
  1701.     numItems = g_voip_cntx_p->call_setting_info.numCodec;
  1702.     for (i = 0; i < numItems; i++)
  1703.     {
  1704.         nStrItemList[i] = g_voip_cntx_p->call_setting_info.dispCodec[i];
  1705.     }
  1706.     RegisterHighlightHandler(mmi_voip_highlight_set_codec_order_item);
  1707.     ShowCategory6Screen(
  1708.         STR_ID_VOIP_SETTING_SET_CODEC_ORDER,
  1709.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1710.         STR_GLOBAL_OPTIONS,
  1711.         IMG_GLOBAL_OPTIONS,
  1712.         STR_GLOBAL_BACK,
  1713.         IMG_GLOBAL_BACK,
  1714.         numItems,
  1715.         nStrItemList,
  1716.         NULL,
  1717.         g_voip_cntx_p->call_setting_info.currIndex,
  1718.         guiBuffer);
  1719.     SetLeftSoftkeyFunction(mmi_voip_entry_set_codec_order_option, KEY_EVENT_UP);
  1720.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1721.     SetKeyHandler(mmi_voip_entry_set_codec_order_option, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1722.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1723. }
  1724. /*****************************************************************************
  1725.  * FUNCTION
  1726.  *  mmi_voip_highlight_set_codec_order_item
  1727.  * DESCRIPTION
  1728.  *  Highlight item of selecting a selection in VoIPCall SettingSet Codec Order
  1729.  * PARAMETERS
  1730.  *  index           [IN]            Current highlight index.
  1731.  * RETURNS
  1732.  *  void
  1733.  *****************************************************************************/
  1734. void mmi_voip_highlight_set_codec_order_item(S32 index)
  1735. {
  1736.     /*----------------------------------------------------------------*/
  1737.     /* Local Variables                                                */
  1738.     /*----------------------------------------------------------------*/
  1739.     /*----------------------------------------------------------------*/
  1740.     /* Code Body                                                      */
  1741.     /*----------------------------------------------------------------*/
  1742.     g_voip_cntx_p->call_setting_info.currIndex = index;
  1743. }
  1744. /*****************************************************************************
  1745.  * FUNCTION
  1746.  *  mmi_voip_entry_set_codec_order_option
  1747.  * DESCRIPTION
  1748.  *  Entry function of VoIPCall SettingSet Codec OrderOption
  1749.  * PARAMETERS
  1750.  *  void
  1751.  * RETURNS
  1752.  *  void
  1753.  *****************************************************************************/
  1754. void mmi_voip_entry_set_codec_order_option(void)
  1755. {
  1756.     /*----------------------------------------------------------------*/
  1757.     /* Local Variables                                                */
  1758.     /*----------------------------------------------------------------*/
  1759.     U8 *guiBuffer = NULL;
  1760.     /*----------------------------------------------------------------*/
  1761.     /* Code Body                                                      */
  1762.     /*----------------------------------------------------------------*/
  1763.     EntryNewScreen(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION, NULL, mmi_voip_entry_set_codec_order_option, NULL);
  1764.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
  1765.     g_voip_cntx_p->call_setting_info.currPriority = g_voip_cntx_p->call_setting_info.currIndex + 1;
  1766.     ShowCategory87Screen(
  1767.         STR_ID_VOIP_SETTING_PRIORITY,
  1768.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1769.         STR_GLOBAL_OK,
  1770.         IMG_GLOBAL_OK,
  1771.         STR_GLOBAL_BACK,
  1772.         IMG_GLOBAL_BACK,
  1773.         1,
  1774.         g_voip_cntx_p->call_setting_info.numCodec,
  1775.         &g_voip_cntx_p->call_setting_info.currPriority,
  1776.         guiBuffer);
  1777.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_codec_confirm, KEY_EVENT_UP);
  1778.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1779. }
  1780. /*****************************************************************************
  1781.  * FUNCTION
  1782.  *  mmi_voip_entry_setting_codec_confirm
  1783.  * DESCRIPTION
  1784.  *  Confirmation screen before saving the codec order.
  1785.  * PARAMETERS
  1786.  *  void
  1787.  * RETURNS
  1788.  *  void
  1789.  *****************************************************************************/
  1790. void mmi_voip_entry_setting_codec_confirm(void)
  1791. {
  1792.     /*----------------------------------------------------------------*/
  1793.     /* Local Variables                                                */
  1794.     /*----------------------------------------------------------------*/
  1795.     /*----------------------------------------------------------------*/
  1796.     /* Code Body                                                      */
  1797.     /*----------------------------------------------------------------*/
  1798.     DisplayConfirm(
  1799.         STR_GLOBAL_YES,
  1800.         IMG_GLOBAL_YES,
  1801.         STR_GLOBAL_NO,
  1802.         IMG_GLOBAL_NO,
  1803.         get_string(STR_GLOBAL_SAVE),
  1804.         IMG_GLOBAL_QUESTION,
  1805.         WARNING_TONE);
  1806.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_codec_save, KEY_EVENT_UP);
  1807.     SetRightSoftkeyFunction(mmi_voip_go_back_to_codec_order, KEY_EVENT_UP);
  1808. }
  1809. /*****************************************************************************
  1810.  * FUNCTION
  1811.  *  mmi_voip_entry_setting_codec_save
  1812.  * DESCRIPTION
  1813.  *  Save the codec order.
  1814.  * PARAMETERS
  1815.  *  void
  1816.  * RETURNS
  1817.  *  void
  1818.  *****************************************************************************/
  1819. void mmi_voip_entry_setting_codec_save(void)
  1820. {
  1821.     /*----------------------------------------------------------------*/
  1822.     /* Local Variables                                                */
  1823.     /*----------------------------------------------------------------*/
  1824.     S32 srcIndex = g_voip_cntx_p->call_setting_info.currIndex;
  1825.     S32 destIndex = g_voip_cntx_p->call_setting_info.currPriority - 1;
  1826.     S32 i = 0;
  1827.     BOOL isChange = FALSE;
  1828.     /*----------------------------------------------------------------*/
  1829.     /* Code Body                                                      */
  1830.     /*----------------------------------------------------------------*/
  1831.     if (srcIndex < destIndex)
  1832.     {
  1833.         memset(
  1834.             g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
  1835.             0,
  1836.             (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
  1837.         AnsiiNToUnicodeString(
  1838.             (S8*) g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
  1839.             (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[srcIndex],
  1840.             MMI_VOIP_MAX_CODEC_NAME_LEN);
  1841.         for (i = srcIndex; i < destIndex; i++)
  1842.         {
  1843.             memset(g_voip_cntx_p->call_setting_info.dispCodec[i], 0, (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
  1844.             AnsiiNToUnicodeString(
  1845.                 (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
  1846.                 (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i + 1],
  1847.                 MMI_VOIP_MAX_CODEC_NAME_LEN);
  1848.         }
  1849.         g_voip_cntx_p->call_setting_info.currIndex = destIndex;
  1850.     }
  1851.     else if (srcIndex > destIndex)
  1852.     {
  1853.         memset(
  1854.             g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
  1855.             0,
  1856.             (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
  1857.         AnsiiNToUnicodeString(
  1858.             (S8*) g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
  1859.             (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[srcIndex],
  1860.             MMI_VOIP_MAX_CODEC_NAME_LEN);
  1861.         for (i = srcIndex; i > destIndex; i--)
  1862.         {
  1863.             memset(g_voip_cntx_p->call_setting_info.dispCodec[i], 0, (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
  1864.             AnsiiNToUnicodeString(
  1865.                 (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
  1866.                 (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i - 1],
  1867.                 MMI_VOIP_MAX_CODEC_NAME_LEN);
  1868.         }
  1869.         g_voip_cntx_p->call_setting_info.currIndex = destIndex;
  1870.     }
  1871.     else    /* srcIndex == destIndex */
  1872.     {
  1873.         /* do nothing */
  1874.     }
  1875.     isChange = mmi_voip_update_setting_codec_disp_to_cache();
  1876.     if (mmi_voip_save_setting())
  1877.     {
  1878.         if (isChange)
  1879.         {
  1880.             mmi_voip_setting_req();
  1881.         }
  1882.         else
  1883.         {
  1884.             DisplayPopup(
  1885.                 (U8*)GetString(STR_GLOBAL_SAVED),
  1886.                 IMG_GLOBAL_ACTIVATED,
  1887.                 1,
  1888.                 UI_POPUP_NOTIFYDURATION_TIME,
  1889.                 SUCCESS_TONE);
  1890.             DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
  1891.         }
  1892.     }
  1893.     else
  1894.     {
  1895.         DisplayPopup(
  1896.             (U8*)GetString(STR_GLOBAL_NOT_DONE),
  1897.             IMG_GLOBAL_UNFINISHED,
  1898.             1,
  1899.             UI_POPUP_NOTIFYDURATION_TIME,
  1900.             ERROR_TONE);
  1901.         DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
  1902.     }
  1903. }
  1904. /*****************************************************************************
  1905.  * FUNCTION
  1906.  *  mmi_voip_go_back_to_codec_order
  1907.  * DESCRIPTION
  1908.  *  Go back to set codec order screen.
  1909.  * PARAMETERS
  1910.  *  void
  1911.  * RETURNS
  1912.  *  void
  1913.  *****************************************************************************/
  1914. void mmi_voip_go_back_to_codec_order(void)
  1915. {
  1916.     /*----------------------------------------------------------------*/
  1917.     /* Local Variables                                                */
  1918.     /*----------------------------------------------------------------*/
  1919.     /*----------------------------------------------------------------*/
  1920.     /* Code Body                                                      */
  1921.     /*----------------------------------------------------------------*/
  1922.     DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
  1923.     GoBackHistory();
  1924. }
  1925. #ifdef SIP_CONFORMANCE_TEST
  1926. /*****************************************************************************
  1927.  * FUNCTION
  1928.  *  mmi_voip_entry_option_query
  1929.  * DESCRIPTION
  1930.  *  Entry function of VoIPOption Query
  1931.  * PARAMETERS
  1932.  *  void
  1933.  * RETURNS
  1934.  *  void
  1935.  *****************************************************************************/
  1936. void mmi_voip_entry_option_query(void)
  1937. {
  1938.     /*----------------------------------------------------------------*/
  1939.     /* Local Variables                                                */
  1940.     /*----------------------------------------------------------------*/
  1941.     U8 *guiBuffer = NULL;
  1942.     /*----------------------------------------------------------------*/
  1943.     /* Code Body                                                      */
  1944.     /*----------------------------------------------------------------*/
  1945.     EntryNewScreen(SCR_ID_VOIP_OPTION_QUERY_EDITOR, NULL, mmi_voip_entry_option_query, NULL);
  1946.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_OPTION_QUERY_EDITOR);
  1947.     ShowCategory5Screen(
  1948.         STR_ID_VOIP_MAIN,
  1949.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1950.         STR_GLOBAL_OK,
  1951.         IMG_GLOBAL_OK,
  1952.         STR_GLOBAL_BACK,
  1953.         IMG_GLOBAL_BACK,
  1954.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  1955.         g_voip_cntx_p->call_misc_info.dispUri,
  1956.         VOIP_URI_LEN,
  1957.         guiBuffer);
  1958.     SetLeftSoftkeyFunction(mmi_voip_entry_option_query_check, KEY_EVENT_UP);
  1959.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1960. }
  1961. /*****************************************************************************
  1962.  * FUNCTION
  1963.  *  mmi_voip_entry_option_query_result
  1964.  * DESCRIPTION
  1965.  *  Display option query result.
  1966.  * PARAMETERS
  1967.  *  asciiData           [IN]            Option query result in ascii
  1968.  * RETURNS
  1969.  *  void
  1970.  *****************************************************************************/
  1971. void mmi_voip_entry_option_query_result(U8 *asciiData)
  1972. {
  1973.     /*----------------------------------------------------------------*/
  1974.     /* Local Variables                                                */
  1975.     /*----------------------------------------------------------------*/
  1976.     
  1977.     /*----------------------------------------------------------------*/
  1978.     /* Code Body                                                      */
  1979.     /*----------------------------------------------------------------*/
  1980.     AnsiiNToUnicodeString((S8*)subMenuData, (S8*)asciiData, VOIP_SIP_OPTION_LEN);
  1981.     EntryNewScreen(SCR_ID_VOIP_OPTION_QUERY_RESULT, NULL, NULL, NULL);
  1982.     ShowCategory74Screen(
  1983.         STR_ID_VOIP_OPTION_QUERY,
  1984.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1985.         STR_GLOBAL_OK,
  1986.         IMG_GLOBAL_OK,
  1987.         0,
  1988.         IMG_GLOBAL_BACK,
  1989.         (U8*)subMenuData,
  1990.         (MAX_SUB_MENUS * MAX_SUB_MENU_SIZE),
  1991.         NULL);
  1992.     SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1993. }
  1994. #endif /* SIP_CONFORMANCE_TEST */
  1995. /*****************************************************************************
  1996.  * FUNCTION
  1997.  *  mmi_voip_go_back_2_history
  1998.  * DESCRIPTION
  1999.  *  Delete one history and go back history.
  2000.  * PARAMETERS
  2001.  *  void
  2002.  * RETURNS
  2003.  *  void
  2004.  *****************************************************************************/
  2005. void mmi_voip_go_back_2_history(void)
  2006. {
  2007.     /*----------------------------------------------------------------*/
  2008.     /* Local Variables                                                */
  2009.     /*----------------------------------------------------------------*/
  2010.     /*----------------------------------------------------------------*/
  2011.     /* Code Body                                                      */
  2012.     /*----------------------------------------------------------------*/
  2013.     GoBacknHistory(1);
  2014. }
  2015. #endif /* __MMI_VOIP__ */