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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  *  VoIPMsgHdlr.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *  MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *  Coding Template header file
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * removed!
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * removed!
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * removed!
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * removed!
  114.  *
  115.  * removed!
  116.  * removed!
  117.  * removed!
  118.  *
  119.  * removed!
  120.  * removed!
  121.  * removed!
  122.  *
  123.  * removed!
  124.  * removed!
  125.  * removed!
  126.  *
  127.  * removed!
  128.  * removed!
  129.  * removed!
  130.  *
  131.  * removed!
  132.  * removed!
  133.  * removed!
  134.  *
  135.  * removed!
  136.  * removed!
  137.  * removed!
  138.  *
  139.  * removed!
  140.  * removed!
  141.  * removed!
  142.  *
  143.  * removed!
  144.  * removed!
  145.  * removed!
  146.  *
  147.  * removed!
  148.  * removed!
  149.  * removed!
  150.  *
  151.  * removed!
  152.  * removed!
  153.  * removed!
  154.  *
  155.  * removed!
  156.  * removed!
  157.  * removed!
  158.  *
  159.  * removed!
  160.  * removed!
  161.  * removed!
  162.  *
  163.  * removed!
  164.  * removed!
  165.  * removed!
  166.  *
  167.  * removed!
  168.  * removed!
  169.  * removed!
  170.  *
  171.  * removed!
  172.  * removed!
  173.  * removed!
  174.  *
  175.  * removed!
  176.  * removed!
  177.  * removed!
  178.  *
  179.  * removed!
  180.  * removed!
  181.  * removed!
  182.  *
  183.  * removed!
  184.  * removed!
  185.  * removed!
  186.  *
  187.  * removed!
  188.  * removed!
  189.  * removed!
  190.  *
  191.  * removed!
  192.  * removed!
  193.  * removed!
  194.  *
  195.  *------------------------------------------------------------------------------
  196.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  197.  *============================================================================
  198.  ****************************************************************************/
  199. #include "MMI_features.h"
  200. #ifdef __MMI_VOIP__
  201. #include "stdC.h"
  202. #include "L4Dr1.h"
  203. #include "DebugInitDef.h"
  204. #include "mmi_trc.h"    /* debug info */
  205. #include "GlobalMenuItems.h"
  206. #include "GlobalScrEnum.h"
  207. #include "CustMenuRes.h"
  208. #include "CustDataRes.h"
  209. #include "ProtocolEvents.h"
  210. #include "CommonScreens.h"
  211. #include "SettingProfile.h"
  212. #include "EventsGprot.h"
  213. #include "wgui_categories_popup.h"
  214. #include "wgui_categories_inputs.h"
  215. #include "wgui_categories_util.h"
  216. #include "NVRAMEnum.h"
  217. #include "NVRAMProt.h"
  218. #include "NVRAMType.h"
  219. #include "custom_nvram_editor_data_item.h"
  220. #include "custom_data_account.h"
  221. #include "AlarmFrameWorkProt.h"
  222. #include "CallManagementGprot.h"
  223. #include "Conversions.h"
  224. #include "gpioInc.h"
  225. #include "TimerEvents.h"
  226. #include "wgui_status_icons.h"
  227. #include "VoIPDef.h"
  228. #include "VoIPGProt.h"
  229. #include "VoIPProt.h"
  230. extern U32 voip_custom_get_local_port(void);
  231. /*****************************************************************************
  232.  * FUNCTION
  233.  *  mmi_voip_send_message
  234.  * DESCRIPTION
  235.  *  General function to send message to other task.
  236.  * PARAMETERS
  237.  *  moduleSrc           [IN]        
  238.  *  moduleDest          [IN]        
  239.  *  msgId               [IN]        Message id
  240.  *  localPara           [IN]        Local parameter
  241.  *  peerBuff            [IN]        Peer buffer
  242.  *  module_type         [IN]        Destination module
  243.  * RETURNS
  244.  *  void
  245.  *****************************************************************************/
  246. void mmi_voip_send_message(module_type moduleSrc, module_type moduleDest, U16 msgId, void *localPara, void *peerBuff)
  247. {
  248.     /*----------------------------------------------------------------*/
  249.     /* Local Variables                                                */
  250.     /*----------------------------------------------------------------*/
  251.     MYQUEUE Message;
  252.     /*----------------------------------------------------------------*/
  253.     /* Code Body                                                      */
  254.     /*----------------------------------------------------------------*/
  255.     Message.oslSrcId = moduleSrc;
  256.     Message.oslDestId = moduleDest;
  257.     Message.oslMsgId = msgId;
  258.     Message.oslDataPtr = localPara;
  259.     Message.oslPeerBuffPtr = peerBuff;
  260.     OslMsgSendExtQueue(&Message);
  261. }
  262. /*****************************************************************************
  263.  * FUNCTION
  264.  *  mmi_voip_register_req
  265.  * DESCRIPTION
  266.  *  Send register request to VoIP CC.
  267.  * PARAMETERS
  268.  *  void
  269.  * RETURNS
  270.  *  void
  271.  *****************************************************************************/
  272. void mmi_voip_register_req(void)
  273. {
  274.     /*----------------------------------------------------------------*/
  275.     /* Local Variables                                                */
  276.     /*----------------------------------------------------------------*/
  277.     S32 actprofIndex = g_voip_cntx_p->prof_setting_info.actprofIndex;
  278.     S32 refreshTime = 0;
  279.     mmi_voip_register_req_struct *msgReq;
  280.     msgReq = (mmi_voip_register_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_register_req_struct));
  281.     /*----------------------------------------------------------------*/
  282.     /* Code Body                                                      */
  283.     /*----------------------------------------------------------------*/
  284.     g_voip_cntx_p->reg_state_info = MMI_VOIP_PROCESS_STATE;
  285.     if ((actprofIndex != -1) && (g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].comm_info.autoLogin == 1)) /* auto login */
  286.     {
  287.         StopTimer(VOIP_AUTOLOGIN_TIMER);
  288.     }
  289.     
  290.     msgReq->profile.local_port = (U16)voip_custom_get_local_port(); /* for auto provisioning */
  291.     msgReq->profile.data_account = (U8) g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].comm_info.dataAcct;
  292.     memcpy(
  293.         msgReq->profile.voice_mail,
  294.         g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].comm_info.vmServer,
  295.         VOIP_URI_LEN);
  296.     memcpy(
  297.         msgReq->profile.sip_server,
  298.         g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].acct_info.sipServer,
  299.         VOIP_URI_LEN);
  300.     msgReq->profile.sip_port = g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].acct_info.sipPort;
  301.     mmi_chset_convert(
  302.         MMI_CHSET_UCS2,
  303.         MMI_CHSET_UTF8,
  304.         (char*)g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].acct_info.dispName,
  305.         (char*)msgReq->profile.disp_name,
  306.         (S32)(VOIP_DISP_NAME_LEN * sizeof(U16)));
  307.     memcpy(
  308.         msgReq->profile.sip_username,
  309.         g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].acct_info.username,
  310.         VOIP_USERNAME_LEN);
  311.     memcpy(
  312.         msgReq->profile.sip_password,
  313.         g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].acct_info.password,
  314.         VOIP_PASSWORD_LEN);
  315.     memcpy(
  316.         msgReq->profile.auth_username,
  317.         g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].acct_info.authName,
  318.         VOIP_USERNAME_LEN);
  319.     msgReq->profile.outbound_type = g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].out_server_info.status;
  320.     if ((msgReq->profile.outbound_type == VOIP_OUTBOUND_AUTO) ||
  321.         (msgReq->profile.outbound_type == VOIP_OUTBOUND_ALWAYS))
  322.     {
  323.         memcpy(
  324.             msgReq->profile.outbound_server,
  325.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].out_server_info.server,
  326.             VOIP_URI_LEN);
  327.         msgReq->profile.outbound_port = g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].out_server_info.port;
  328.         memcpy(
  329.             msgReq->profile.outbound_username,
  330.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].out_server_info.username,
  331.             VOIP_USERNAME_LEN);
  332.         memcpy(
  333.             msgReq->profile.outbound_password,
  334.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].out_server_info.password,
  335.             VOIP_PASSWORD_LEN);
  336.     }
  337.     msgReq->profile.enable_registrar =
  338.         (g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].reg_server_info.status == 1) ? (TRUE) : (FALSE);
  339.     if (msgReq->profile.enable_registrar == TRUE)
  340.     {
  341.         memcpy(
  342.             msgReq->profile.registrar_server,
  343.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].reg_server_info.server,
  344.             VOIP_URI_LEN);
  345.         msgReq->profile.registrar_port = g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].reg_server_info.port;
  346.         memcpy(
  347.             msgReq->profile.registrar_username,
  348.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].reg_server_info.username,
  349.             VOIP_USERNAME_LEN);
  350.         memcpy(
  351.             msgReq->profile.registrar_password,
  352.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].reg_server_info.password,
  353.             VOIP_PASSWORD_LEN);
  354.     }
  355.     msgReq->profile.nat_type = g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.natStatus;
  356.     if (msgReq->profile.nat_type == VOIP_NAT_TYPE_STATIC_IP)    /* Static NAT */
  357.     {
  358.         msgReq->profile.fire_wall[0] =
  359.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.natFirewall[0];
  360.         msgReq->profile.fire_wall[1] =
  361.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.natFirewall[1];
  362.         msgReq->profile.fire_wall[2] =
  363.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.natFirewall[2];
  364.         msgReq->profile.fire_wall[3] =
  365.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.natFirewall[3];
  366.     }
  367.     else if (msgReq->profile.nat_type == VOIP_NAT_TYPE_STUN)    /* STUN Server */
  368.     {
  369.         memcpy(
  370.             msgReq->profile.stun_server,
  371.             g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.stunServer,
  372.             VOIP_URI_LEN);
  373.         msgReq->profile.stun_port = g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.stunPort;
  374.         msgReq->profile.nat_refresh =
  375.             (g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.refInterval == 0) ? (TRUE) : (FALSE);
  376.         if (msgReq->profile.nat_refresh == FALSE)
  377.         {
  378.             refreshTime = (U8)g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].nat_info.refInterval;
  379.             switch (refreshTime)
  380.             {
  381.                 case 1:
  382.                     msgReq->profile.nat_refresh_time = 5;
  383.                     break;
  384.                 case 2:
  385.                     msgReq->profile.nat_refresh_time = 10;
  386.                     break;
  387.                 case 3:
  388.                     msgReq->profile.nat_refresh_time = 30;
  389.                     break;
  390.                 case 4:
  391.                     msgReq->profile.nat_refresh_time = 60;
  392.                     break;
  393.                 default:
  394.                     break;
  395.             }
  396.         }
  397.     }
  398.     msgReq->setting.auto_answer = (g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer == 2) ? (TRUE) : (FALSE);
  399.     msgReq->setting.auto_decline = (g_voip_cntx_p->call_setting_info.saved_setting.autoReject == 1) ? (TRUE) : (FALSE);
  400.     msgReq->setting.do_not_disturb =
  401.         (g_voip_cntx_p->call_setting_info.saved_setting.autoReject == 2) ? (TRUE) : (FALSE);
  402.     msgReq->setting.hide_user_id =
  403.         (g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId == 1) ? (TRUE) : (FALSE);
  404.     msgReq->setting.dtmf = g_voip_cntx_p->call_setting_info.saved_setting.dtmf;
  405.     msgReq->setting.comfortable_noise =
  406.         (g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise == 0) ? (TRUE) : (FALSE);
  407.     memcpy(
  408.         msgReq->setting.codec_order,
  409.         g_voip_cntx_p->call_setting_info.codecEnum,
  410.         (VOIP_MAX_NUM_CODEC * sizeof(voip_codec_enum)));
  411.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_REGISTER_REQ, msgReq, NULL);
  412. }
  413. /*****************************************************************************
  414.  * FUNCTION
  415.  *  mmi_voip_register_rsp
  416.  * DESCRIPTION
  417.  *  Receive register response from VoIP CC.
  418.  * PARAMETERS
  419.  *  inMsg           [IN]        Message structure from voip cc
  420.  * RETURNS
  421.  *  void
  422.  *****************************************************************************/
  423. void mmi_voip_register_rsp(void *inMsg)
  424. {
  425.     /*----------------------------------------------------------------*/
  426.     /* Local Variables                                                */
  427.     /*----------------------------------------------------------------*/
  428.     S32 actprofIndex = g_voip_cntx_p->prof_setting_info.actprofIndex;
  429.     mmi_voip_register_rsp_struct *msgRsp = (mmi_voip_register_rsp_struct*)inMsg;
  430.     /*----------------------------------------------------------------*/
  431.     /* Code Body                                                      */
  432.     /*----------------------------------------------------------------*/
  433.     if (msgRsp->result == VOIP_OK)
  434.     {
  435.         g_voip_cntx_p->reg_state_info = MMI_VOIP_REG_STATE;
  436.         ShowStatusIcon(STATUS_ICON_VOIP);
  437.         UpdateStatusIcons();
  438.         
  439.         if ((actprofIndex != -1) && (g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].comm_info.autoLogin == 1)) /* auto login */
  440.         {
  441.             StopTimer(VOIP_AUTOLOGIN_TIMER);
  442.         }
  443.         
  444.         if (IsScreenPresent(SCR_ID_VOIP_CALL_EDITOR))
  445.         {
  446.             DisplayPopup(
  447.                 (U8*)GetString(STR_ID_VOIP_LOGIN_OK),
  448.                 IMG_GLOBAL_ACTIVATED,
  449.                 1,
  450.                 UI_POPUP_NOTIFYDURATION_TIME,
  451.                 SUCCESS_TONE);
  452.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  453.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION); /* go back to call editor screen */
  454.         }
  455.         else if (IsScreenPresent(SCR_ID_VOIP_MAIN))
  456.         {
  457.             DisplayPopup(
  458.                 (U8*)GetString(STR_ID_VOIP_LOGIN_OK),
  459.                 IMG_GLOBAL_ACTIVATED,
  460.                 1,
  461.                 UI_POPUP_NOTIFYDURATION_TIME,
  462.                 SUCCESS_TONE);
  463.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  464.         }
  465.         else if (IsScreenPresent(MAIN_MENU_SERVICES_MENUID)) /* intend to go to voip main menu but state is not allowed */
  466.         {
  467.             mmi_voip_entry_main_menu();
  468.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  469.         }
  470.         else if (GetExitScrnID() == SCR_ID_VOIP_PROCESSING) /* dial voip call from other application */
  471.         {
  472.             GoBackHistory();
  473.         }
  474.         else /* rsp for auto login */
  475.         {
  476.             /* do nothing */
  477.         }
  478.     }
  479.     else
  480.     {
  481.         g_voip_cntx_p->reg_state_info = MMI_VOIP_DEREG_STATE;
  482.         HideStatusIcon(STATUS_ICON_VOIP);
  483.         UpdateStatusIcons();
  484.         
  485.         if (IsScreenPresent(SCR_ID_VOIP_CALL_EDITOR))
  486.         {
  487.             DisplayPopup(
  488.                 (U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)),
  489.                 IMG_GLOBAL_UNFINISHED,
  490.                 1,
  491.                 UI_POPUP_NOTIFYDURATION_TIME,
  492.                 ERROR_TONE);
  493.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  494.             DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION); /* go back to call editor screen */
  495.         }
  496.         else if (IsScreenPresent(SCR_ID_VOIP_MAIN))
  497.         {
  498.             DisplayPopup(
  499.                 (U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)),
  500.                 IMG_GLOBAL_UNFINISHED,
  501.                 1,
  502.                 UI_POPUP_NOTIFYDURATION_TIME,
  503.                 ERROR_TONE);
  504.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  505.         }
  506.         else if (GetExitScrnID() == SCR_ID_VOIP_PROCESSING) /* intend to go to voip main menu but state is not allowed */
  507.         {
  508.             mmi_voip_entry_main_menu();
  509.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  510.         }
  511.         else if (GetExitScrnID() == SCR_ID_VOIP_PROCESSING) /* dial voip call from other application */
  512.         {
  513.             GoBackHistory();
  514.         }
  515.         else /* rsp for auto login */
  516.         {
  517.             /* do nothing */
  518.         }
  519.         if ((actprofIndex != -1) && (g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].comm_info.autoLogin == 1)) /* auto login */
  520.         {
  521.             /* send request to voip cc in the background */
  522.             StartTimer(VOIP_AUTOLOGIN_TIMER, (MMI_VOIP_GENERAL_TIMEOUT * 10), mmi_voip_register_req);
  523.         }
  524.     }
  525. }
  526. /*****************************************************************************
  527.  * FUNCTION
  528.  *  mmi_voip_deregister_req
  529.  * DESCRIPTION
  530.  *  Send de-register request to VoIP CC.
  531.  * PARAMETERS
  532.  *  void
  533.  * RETURNS
  534.  *  void
  535.  *****************************************************************************/
  536. void mmi_voip_deregister_req(void)
  537. {
  538.     /*----------------------------------------------------------------*/
  539.     /* Local Variables                                                */
  540.     /*----------------------------------------------------------------*/
  541.     S32 actprofIndex = g_voip_cntx_p->prof_setting_info.actprofIndex;
  542.     
  543.     /*----------------------------------------------------------------*/
  544.     /* Code Body                                                      */
  545.     /*----------------------------------------------------------------*/
  546.     g_voip_cntx_p->reg_state_info = MMI_VOIP_PROCESS_STATE;
  547.     
  548.     if ((actprofIndex != -1) && (g_voip_cntx_p->prof_setting_info.saved_prof[actprofIndex].comm_info.autoLogin == 1)) /* auto login */
  549.     {
  550.         StopTimer(VOIP_AUTOLOGIN_TIMER);
  551.     }
  552.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_DEREGISTER_REQ, NULL, NULL);
  553. }
  554. /*****************************************************************************
  555.  * FUNCTION
  556.  *  mmi_voip_deregister_rsp
  557.  * DESCRIPTION
  558.  *  Receive de-register response from VoIP CC.
  559.  * PARAMETERS
  560.  *  inMsg           [IN]        Message structure from voip cc
  561.  * RETURNS
  562.  *  void
  563.  *****************************************************************************/
  564. void mmi_voip_deregister_rsp(void *inMsg)
  565. {
  566.     /*----------------------------------------------------------------*/
  567.     /* Local Variables                                                */
  568.     /*----------------------------------------------------------------*/
  569.     mmi_voip_deregister_rsp_struct *msgRsp = (mmi_voip_deregister_rsp_struct*)inMsg;
  570.     /*----------------------------------------------------------------*/
  571.     /* Code Body                                                      */
  572.     /*----------------------------------------------------------------*/
  573.     if (msgRsp->result == VOIP_OK)
  574.     {
  575.         g_voip_cntx_p->reg_state_info = MMI_VOIP_DEREG_STATE;
  576.         HideStatusIcon(STATUS_ICON_VOIP);
  577.         UpdateStatusIcons();
  578.         if (IsScreenPresent(SCR_ID_VOIP_MAIN))
  579.         {
  580.             DisplayPopup(
  581.                 (U8*)GetString(STR_ID_VOIP_LOGOUT_OK),
  582.                 IMG_GLOBAL_ACTIVATED,
  583.                 1,
  584.                 UI_POPUP_NOTIFYDURATION_TIME,
  585.                 SUCCESS_TONE);
  586.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  587.         }
  588.         else if (GetExitScrnID() == SCR_ID_VOIP_PROCESSING) /* intend to go to voip main menu but state is not allowed */
  589.         {
  590.             mmi_voip_entry_main_menu();
  591.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  592.         }
  593.     }
  594.     else
  595.     {
  596.         g_voip_cntx_p->reg_state_info = MMI_VOIP_DEREG_STATE;
  597.         HideStatusIcon(STATUS_ICON_VOIP);
  598.         UpdateStatusIcons();
  599.         if (IsScreenPresent(SCR_ID_VOIP_MAIN))
  600.         {
  601.             DisplayPopup(
  602.                 (U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)),
  603.                 IMG_GLOBAL_UNFINISHED,
  604.                 1,
  605.                 UI_POPUP_NOTIFYDURATION_TIME,
  606.                 ERROR_TONE);
  607.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  608.         }
  609.         else if (GetExitScrnID() == SCR_ID_VOIP_PROCESSING) /* intend to go to voip main menu but state is not allowed */
  610.         {
  611.             mmi_voip_entry_main_menu();
  612.             DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  613.         }
  614.     }
  615. }
  616. /*****************************************************************************
  617.  * FUNCTION
  618.  *  mmi_voip_deregister_ind
  619.  * DESCRIPTION
  620.  *  Receive de-register indication from VoIP CC.
  621.  * PARAMETERS
  622.  *  inMsg           [IN]        Message structure from voip cc
  623.  * RETURNS
  624.  *  void
  625.  *****************************************************************************/
  626. void mmi_voip_deregister_ind(void *inMsg)
  627. {
  628.     /*----------------------------------------------------------------*/
  629.     /* Local Variables                                                */
  630.     /*----------------------------------------------------------------*/
  631.     S32 profIndex = 0;
  632.     mmi_voip_deregister_ind_struct *msgInd = (mmi_voip_deregister_ind_struct*)inMsg;
  633.     /*----------------------------------------------------------------*/
  634.     /* Code Body                                                      */
  635.     /*----------------------------------------------------------------*/
  636.     if (msgInd->result != VOIP_OK)
  637.     {
  638.         g_voip_cntx_p->reg_state_info = MMI_VOIP_DEREG_STATE;
  639.         HideStatusIcon(STATUS_ICON_VOIP);
  640.         UpdateStatusIcons();
  641.         DisplayPopup(
  642.             (U8*)GetString(STR_ID_VOIP_LOGOUT_IND),
  643.             IMG_GLOBAL_ACTIVATED,
  644.             1,
  645.             UI_POPUP_NOTIFYDURATION_TIME,
  646.             SUCCESS_TONE);
  647.         DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  648.     }
  649.     else
  650.     {
  651.         MMI_ASSERT(msgInd->result != VOIP_OK);
  652.     }
  653.     
  654.     profIndex = g_voip_cntx_p->prof_setting_info.actprofIndex;
  655.     if ((profIndex != -1) && (g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.autoLogin == 1)) /* auto login */
  656.     {
  657.     #ifdef __MMI_WLAN_FEATURES__
  658.         mmi_wlan_add_event_notify_hdlr(mmi_voip_wlan_state_callback);
  659.     #endif
  660.     }
  661. }
  662. /*****************************************************************************
  663.  * FUNCTION
  664.  *  mmi_voip_setting_req
  665.  * DESCRIPTION
  666.  *  Send setting request to VoIP CC.
  667.  * PARAMETERS
  668.  *  void
  669.  * RETURNS
  670.  *  void
  671.  *****************************************************************************/
  672. void mmi_voip_setting_req(void)
  673. {
  674.     /*----------------------------------------------------------------*/
  675.     /* Local Variables                                                */
  676.     /*----------------------------------------------------------------*/
  677.     mmi_voip_setting_req_struct *msgReq;
  678.     msgReq = (mmi_voip_setting_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_setting_req_struct));
  679.     /*----------------------------------------------------------------*/
  680.     /* Code Body                                                      */
  681.     /*----------------------------------------------------------------*/
  682.     msgReq->setting.auto_answer = (g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer == 2) ? (TRUE) : (FALSE);
  683.     msgReq->setting.auto_decline = (g_voip_cntx_p->call_setting_info.saved_setting.autoReject == 1) ? (TRUE) : (FALSE);
  684.     msgReq->setting.do_not_disturb =
  685.         (g_voip_cntx_p->call_setting_info.saved_setting.autoReject == 2) ? (TRUE) : (FALSE);
  686.     msgReq->setting.hide_user_id =
  687.         (g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId == 1) ? (TRUE) : (FALSE);
  688.     msgReq->setting.dtmf = g_voip_cntx_p->call_setting_info.saved_setting.dtmf;
  689.     msgReq->setting.comfortable_noise =
  690.         (g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise == 0) ? (TRUE) : (FALSE);
  691.     memcpy(
  692.         msgReq->setting.codec_order,
  693.         g_voip_cntx_p->call_setting_info.codecEnum,
  694.         (VOIP_MAX_NUM_CODEC * sizeof(voip_codec_enum)));
  695.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_SETTING_REQ, msgReq, NULL);
  696. }
  697. /*****************************************************************************
  698.  * FUNCTION
  699.  *  mmi_voip_setting_rsp
  700.  * DESCRIPTION
  701.  *  Receive setting response from VoIP CC.
  702.  * PARAMETERS
  703.  *  inMsg           [IN]        Message structure from voip cc
  704.  * RETURNS
  705.  *  void
  706.  *****************************************************************************/
  707. void mmi_voip_setting_rsp(void *inMsg)
  708. {
  709.     /*----------------------------------------------------------------*/
  710.     /* Local Variables                                                */
  711.     /*----------------------------------------------------------------*/
  712.     mmi_voip_setting_rsp_struct *msgRsp = (mmi_voip_setting_rsp_struct*)inMsg;
  713.     /*----------------------------------------------------------------*/
  714.     /* Code Body                                                      */
  715.     /*----------------------------------------------------------------*/
  716.     if (msgRsp->result == VOIP_OK)
  717.     {
  718.         DisplayPopup(
  719.             (U8*)GetString(STR_GLOBAL_SAVED),
  720.             IMG_GLOBAL_ACTIVATED,
  721.             1,
  722.             UI_POPUP_NOTIFYDURATION_TIME,
  723.             SUCCESS_TONE);
  724.     }
  725.     else
  726.     {
  727.         DisplayPopup(
  728.             (U8*)GetString(STR_GLOBAL_NOT_DONE),
  729.             IMG_GLOBAL_UNFINISHED,
  730.             1,
  731.             UI_POPUP_NOTIFYDURATION_TIME,
  732.             ERROR_TONE);
  733.     }
  734.     DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);  /* for set codec order screen */
  735.     DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_GENERAL); /* for all screens except set codec order screen */
  736. }
  737. /*****************************************************************************
  738.  * FUNCTION
  739.  *  mmi_voip_progressing_ind
  740.  * DESCRIPTION
  741.  *  Receive progressing indication from VoIP CC when
  742.  *  MO call request is sent but not yet received response.
  743.  * PARAMETERS
  744.  *  inMsg           [IN]        Message structure from voip cc
  745.  * RETURNS
  746.  *  void
  747.  *****************************************************************************/
  748. void mmi_voip_progressing_ind(void *inMsg)
  749. {
  750.     /*----------------------------------------------------------------*/
  751.     /* Local Variables                                                */
  752.     /*----------------------------------------------------------------*/
  753.     mmi_voip_progressing_ind_struct *msgInd = (mmi_voip_progressing_ind_struct*)inMsg;
  754.     /*----------------------------------------------------------------*/
  755.     /* Code Body                                                      */
  756.     /*----------------------------------------------------------------*/
  757.     if (msgInd->status == VOIP_CALL_PROG_TRYING)
  758.     {
  759.         g_voip_cntx_p->call_list_info.processCId = msgInd->call_id;
  760.         g_voip_cntx_p->call_list_info.processDId = msgInd->dialog_id;
  761.         mmi_voip_add_to_call_list(msgInd->call_list, msgInd->call_id, msgInd->dialog_id, MMI_VOIP_OUTGOING_STATE);
  762.         mmi_voip_switch_session(MMI_VOIP_OUTGOING_STATE);
  763.     }
  764.     else if (msgInd->status == VOIP_CALL_PROG_FORWARDED)
  765.     {
  766.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_CALL_FORWARDED), IMG_GLOBAL_ACTIVATED);
  767.     #if 0
  768. /* under construction !*/
  769. /* under construction !*/
  770. /* under construction !*/
  771. /* under construction !*/
  772. /* under construction !*/
  773. /* under construction !*/
  774.     #endif
  775.     }
  776.     else    /* msgInd->status == VOIP_CALL_PROG_RINGING */
  777.     {
  778.         mmi_voip_play_inbandtone();
  779.     }
  780. }
  781. /*****************************************************************************
  782.  * FUNCTION
  783.  *  mmi_voip_call_ring_ind
  784.  * DESCRIPTION
  785.  *  Receive ring indication from VoIP CC when MT call is coming.
  786.  * PARAMETERS
  787.  *  inMsg           [IN]        Message structure from voip cc
  788.  * RETURNS
  789.  *  void
  790.  *****************************************************************************/
  791. void mmi_voip_call_ring_ind(void *inMsg)
  792. {
  793.     /*----------------------------------------------------------------*/
  794.     /* Local Variables                                                */
  795.     /*----------------------------------------------------------------*/
  796.     mmi_voip_call_ring_ind_struct *msgInd = (mmi_voip_call_ring_ind_struct*)inMsg;
  797.     /*----------------------------------------------------------------*/
  798.     /* Code Body                                                      */
  799.     /*----------------------------------------------------------------*/
  800.     if (g_voip_cntx_p->call_list_info.numTotal < MMI_VOIP_MAX_NUM_CALL)
  801.     {
  802.         if ((g_voip_cntx_p->call_list_info.processCId == -1) && (!isIncomingCall()))
  803.         {
  804.             TurnOnBacklight(1);
  805.             if (GetCurrentState() == CM_OUTGOING_STATE)
  806.             {
  807.                 DropRequest();
  808.             }
  809.             mmi_voip_add_to_call_list(msgInd->call_list, msgInd->call_id, msgInd->dialog_id, MMI_VOIP_INCOMING_STATE);
  810.             mmi_voip_switch_session(MMI_VOIP_INCOMING_STATE);
  811.             mmi_voip_entry_incoming_call();
  812.             mmi_voip_play_incoming_tone();
  813.             /* auto answer is only applicable to the first incoming call, both for voip and gsm */
  814.             if ((g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer == 2) && 
  815.                 (g_voip_cntx_p->call_list_info.numTotal == 1) && (GetTotalCallCount() == 0))
  816.             {
  817.                 StartTimer(VOIP_AUTOANSWER_TIMER, MMI_VOIP_GENERAL_TIMEOUT, mmi_voip_entry_answer_call);
  818.             }
  819.             /* abort auto redial when there is an incoming call */
  820.             if (g_voip_cntx_p->call_setting_info.saved_setting.autoRedial == TRUE)
  821.             {
  822.                 PRINT_INFORMATION(("n[mmi_voip_call_ring_ind] Stop Redial Timer to Abort Redialn"));
  823.                 mmi_voip_entry_abort_redial();
  824.             }
  825.         }
  826.         else /* pending action exists */
  827.         {
  828.             /* background reject without user's awareness */
  829.             mmi_voip_background_reject_req(msgInd->call_id, msgInd->dialog_id);
  830.         }
  831.     }
  832.     else /* call boundry exceeds */
  833.     {
  834.         /* background reject without user's awareness */
  835.         mmi_voip_background_reject_req(msgInd->call_id, msgInd->dialog_id);
  836.     }
  837. }
  838. /*****************************************************************************
  839.  * FUNCTION
  840.  *  mmi_voip_call_end_ind
  841.  * DESCRIPTION
  842.  *  Receive end indication from VoIP CC when call is disconnected.
  843.  * PARAMETERS
  844.  *  inMsg           [IN]        Message structure from voip cc
  845.  * RETURNS
  846.  *  void
  847.  *****************************************************************************/
  848. void mmi_voip_call_end_ind(void *inMsg)
  849. {
  850.     /*----------------------------------------------------------------*/
  851.     /* Local Variables                                                */
  852.     /*----------------------------------------------------------------*/
  853.     S32 callIndex = 0;
  854.     mmi_voip_call_end_ind_struct *msgInd = (mmi_voip_call_end_ind_struct*)inMsg;
  855.     /*----------------------------------------------------------------*/
  856.     /* Code Body                                                      */
  857.     /*----------------------------------------------------------------*/
  858.     if (g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer == 2)
  859.     {
  860.         StopTimer(VOIP_AUTOANSWER_TIMER);
  861.     }
  862.     
  863.     if (msgInd->result == VOIP_OK)
  864.     {
  865.         mmi_voip_stop_inbandtone();
  866.         mmi_voip_stop_incoming_tone();
  867.         /* in case remote release call when local is asked to transfer it, 
  868.          * mmi will not handle transfer failed state_ind after end_ind */
  869.         callIndex = mmi_voip_get_call_index(msgInd->call_id);
  870.         if ((callIndex != -1) && 
  871.             (g_voip_cntx_p->call_list_info.call_info[callIndex].currState == MMI_VOIP_TRANSFER_STATE) && 
  872.             (msgInd->call_id == g_voip_cntx_p->call_list_info.processCId) && 
  873.             (msgInd->dialog_id == g_voip_cntx_p->call_list_info.processDId))
  874.         {
  875.             g_voip_cntx_p->call_list_info.processCId = -1;
  876.             g_voip_cntx_p->call_list_info.processDId = -1;
  877.         }
  878.         mmi_voip_update_call_list(msgInd->call_list, FALSE); /* delete call id from call list */
  879.         mmi_voip_go_back_screen_check();
  880.     }
  881.     else
  882.     {
  883.         MMI_ASSERT(msgInd->result == VOIP_OK); /* call end cannot fail */
  884.     }
  885. }
  886. /*****************************************************************************
  887.  * FUNCTION
  888.  *  mmi_voip_call_state_ind
  889.  * DESCRIPTION
  890.  *  Receive state indication from VoIP CC when remote state is changed.
  891.  * PARAMETERS
  892.  *  inMsg           [IN]        Message structure from voip cc
  893.  * RETURNS
  894.  *  void
  895.  *****************************************************************************/
  896. void mmi_voip_call_state_ind(void *inMsg)
  897. {
  898.     /*----------------------------------------------------------------*/
  899.     /* Local Variables                                                */
  900.     /*----------------------------------------------------------------*/
  901.     S32 callIndex = 0, dialogIndex = 0;
  902.     mmi_voip_call_state_ind_struct *msgInd = (mmi_voip_call_state_ind_struct*)inMsg;
  903.     /*----------------------------------------------------------------*/
  904.     /* Code Body                                                      */
  905.     /*----------------------------------------------------------------*/
  906.     /* update call info only for specific call in case call list file open fail 
  907.      * due to remote hold / unhold rapidly */   
  908.     callIndex = mmi_voip_get_call_index(msgInd->call_id);
  909.     if (callIndex != -1)
  910.     {
  911.         dialogIndex = mmi_voip_get_dialog_index(callIndex, msgInd->dialog_id);
  912.         if (dialogIndex != -1)
  913.         {            
  914.             g_voip_cntx_p->call_list_info.call_info[callIndex].currState = mmi_voip_get_call_state_enum(msgInd->call.dialog[msgInd->dialog_id].dialog_state);
  915.             memset(g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].dispName, 0, (VOIP_DISP_NAME_LEN * sizeof(U16)));
  916.             mmi_chset_convert(
  917.                 MMI_CHSET_UTF8, 
  918.                 MMI_CHSET_UCS2, 
  919.                 (char*)msgInd->call.dialog[msgInd->dialog_id].user_addr.disp_name, 
  920.                 (char*)g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].dispName, 
  921.                 (S32)(VOIP_DISP_NAME_LEN * sizeof(U16)));
  922.             /* uri changes, need to update appName */
  923.             if (strncmp((S8*)g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].remoteUri, (S8*)msgInd->call.dialog[msgInd->dialog_id].user_addr.uri, VOIP_URI_LEN))
  924.             {
  925.                 memset(g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].appName, 0, (VOIP_DISP_NAME_LEN * sizeof(U16)));
  926.             }
  927.             memset(g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].remoteUri, 0, VOIP_URI_LEN);
  928.             memcpy(g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].remoteUri, msgInd->call.dialog[msgInd->dialog_id].user_addr.uri, VOIP_URI_LEN);
  929.             if (mmi_voip_is_addr_change(&g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].sdp_info, &msgInd->call.dialog[msgInd->dialog_id].sdp_info))
  930.             {
  931.                 mmi_voip_remove_mixer_before_close(callIndex);
  932.                 mmi_voip_close_rtp(g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].rtpHandle);
  933.                 g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].rtpHandle = mmi_voip_create_rtp(&msgInd->call.dialog[msgInd->dialog_id].sdp_info);
  934.             }
  935.             memcpy(&g_voip_cntx_p->call_list_info.call_info[callIndex].dialog_info[dialogIndex].sdp_info, &msgInd->call.dialog[msgInd->dialog_id].sdp_info, sizeof(voip_sdp_struct));
  936.             mmi_voip_switch_rtp(FALSE, msgInd->call_id, msgInd->dialog_id);
  937.             
  938.             if (msgInd->change_cause == VOIP_STATE_IND_TRANSFERING)
  939.             {
  940.                 /* in case of release call, release current transfering call */
  941.                 g_voip_cntx_p->call_list_info.processCId = msgInd->call_id;
  942.                 g_voip_cntx_p->call_list_info.processDId = msgInd->dialog_id;
  943.                 /* voip cc dialog state is active for transferring,
  944.                    so mmi needs to set it as TRANSFER_STATE itself */
  945.                 g_voip_cntx_p->call_list_info.call_info[callIndex].currState = MMI_VOIP_TRANSFER_STATE;
  946.                 mmi_voip_set_processing_parameter(
  947.                     STR_ID_VOIP_TRANSFER,
  948.                     STR_ID_VOIP_PROCESSING,
  949.                     IMG_GLOBAL_PROGRESS,
  950.                     0,
  951.                     0,
  952.                     0,
  953.                     0,
  954.                     0,
  955.                     mmi_voip_entry_release_call);
  956.                 mmi_voip_entry_processing_screen();
  957.             }
  958.             else if (msgInd->change_cause == VOIP_STATE_IND_TRANSFERED)
  959.             {
  960.                 g_voip_cntx_p->call_list_info.processCId = -1;
  961.                 g_voip_cntx_p->call_list_info.processDId = -1;
  962.                 mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_TRANSFER_OK), IMG_GLOBAL_ACTIVATED);
  963.             #if 0
  964. /* under construction !*/
  965. /* under construction !*/
  966. /* under construction !*/
  967. /* under construction !*/
  968. /* under construction !*/
  969. /* under construction !*/
  970.             #endif
  971.                 mmi_voip_go_back_screen_check();
  972.             }
  973.             else if (msgInd->change_cause == VOIP_STATE_IND_TRANSFER_FAILED)
  974.             {
  975.                 g_voip_cntx_p->call_list_info.processCId = -1;
  976.                 g_voip_cntx_p->call_list_info.processDId = -1;
  977.                 mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_TRANSFER_FAIL), IMG_GLOBAL_UNFINISHED);
  978.             #if 0
  979. /* under construction !*/
  980. /* under construction !*/
  981. /* under construction !*/
  982. /* under construction !*/
  983. /* under construction !*/
  984. /* under construction !*/
  985.             #endif
  986.                 mmi_voip_go_back_screen_check();
  987.             }
  988.             else    /* msgInd->change_cause == VOIP_STATE_IND_SDP_CHANGE */
  989.             {
  990.                 /* do nothing */
  991.             }
  992.         }
  993.         else
  994.         {
  995.             /* do not assert in case answering gsm when transferring,
  996.                state_ind will still be received even all voip calls are released */
  997.             PRINT_INFORMATION(("n[mmi_voip_call_state_ind] Dialog does not existn"));
  998.         }
  999.     }
  1000.     else
  1001.     {
  1002.         /* do not assert in case answering gsm when transferring,
  1003.            state_ind will still be received even all voip calls are released */
  1004.         PRINT_INFORMATION(("n[mmi_voip_call_state_ind] Call does not existn"));
  1005.     }
  1006. }
  1007. /*****************************************************************************
  1008.  * FUNCTION
  1009.  *  mmi_voip_msg_waiting_ind
  1010.  * DESCRIPTION
  1011.  *  Receive message waiting indication from VoIP CC.
  1012.  * PARAMETERS
  1013.  *  inMsg           [IN]        Message structure from voip cc
  1014.  * RETURNS
  1015.  *  void
  1016.  *****************************************************************************/
  1017. void mmi_voip_msg_waiting_ind(void *inMsg)
  1018. {
  1019.     /*----------------------------------------------------------------*/
  1020.     /* Local Variables                                                */
  1021.     /*----------------------------------------------------------------*/
  1022.     S32 i = 0;
  1023.     mmi_voip_waiting_msg_ind_struct *msgInd = (mmi_voip_waiting_msg_ind_struct*)inMsg;
  1024.     /*----------------------------------------------------------------*/
  1025.     /* Code Body                                                      */
  1026.     /*----------------------------------------------------------------*/
  1027.     TurnOnBacklight(1);
  1028.     for (i = (VOIP_MWI_TOTAL - 1); i >= 0; i--)
  1029.     {
  1030.         if (msgInd->mwi_info.msg_present[i] == TRUE)
  1031.         {
  1032.             g_voip_cntx_p->msg_waiting_info.isDisp = TRUE;
  1033.             g_voip_cntx_p->msg_waiting_info.mwiType = mmi_voip_get_mwi_state_enum(i);
  1034.             memcpy(&g_voip_cntx_p->msg_waiting_info.mwiMsg, &msgInd->mwi_info.msg[i], sizeof(voip_msg_struct));
  1035.             if (msgInd->mwi_info.is_account_present == TRUE)
  1036.             {
  1037.                 memcpy(g_voip_cntx_p->msg_waiting_info.mwiAcct, msgInd->mwi_info.msg_account, VOIP_URI_LEN);
  1038.             }
  1039.             else
  1040.             {
  1041.                 memset(g_voip_cntx_p->msg_waiting_info.mwiAcct, 0, VOIP_URI_LEN);
  1042.             }
  1043.             if (mmi_voip_is_idle_state())
  1044.             {
  1045.                 mmi_voip_entry_msg_waiting_ind();
  1046.             }
  1047.             else
  1048.             {
  1049.                 if (!isInCall())
  1050.                 {
  1051.                     mmi_voip_entry_msg_waiting_popup();
  1052.                 }
  1053.                 else    /* do not interrupt GSM call or VoIP call, only play a beep */
  1054.                 {
  1055.                     playRequestedTone(SMS_IN_CALL_TONE);
  1056.                 }
  1057.             }
  1058.         }
  1059.     }
  1060. }
  1061. /*****************************************************************************
  1062.  * FUNCTION
  1063.  *  mmi_voip_at_call_ctrl_approve_ind
  1064.  * DESCRIPTION
  1065.  *  Receive AT command call control approve indication from L4C.
  1066.  * PARAMETERS
  1067.  *  inMsg           [IN]        Message structure from l4c
  1068.  * RETURNS
  1069.  *  void
  1070.  *****************************************************************************/
  1071. void mmi_voip_at_call_ctrl_approve_ind(void *inMsg)
  1072. {
  1073.     /*----------------------------------------------------------------*/
  1074.     /* Local Variables                                                */
  1075.     /*----------------------------------------------------------------*/
  1076.     mmi_voip_at_call_ctrl_approve_ind_struct *msgInd = (mmi_voip_at_call_ctrl_approve_ind_struct*)inMsg;
  1077.     /*----------------------------------------------------------------*/
  1078.     /* Code Body                                                      */
  1079.     /*----------------------------------------------------------------*/
  1080.     switch (msgInd->action)
  1081.     {
  1082.         case RMMI_CM_ATD:
  1083.         case RMMI_CM_BLDN:
  1084.             if (g_voip_cntx_p->call_list_info.numTotal != 0)
  1085.             {
  1086.                 mmi_voip_at_call_ctrl_approve_res_req(FALSE, msgInd->action);
  1087.             }
  1088.             else
  1089.             {
  1090.                 mmi_voip_at_call_ctrl_approve_res_req(TRUE, msgInd->action);
  1091.             }            
  1092.             break;
  1093.         case RMMI_CM_ATH:
  1094.             /* release gsm call doesn't affect voip, so always return true */
  1095.             mmi_voip_at_call_ctrl_approve_res_req(TRUE, msgInd->action);
  1096.             break;
  1097.         case RMMI_CM_ATA:
  1098.             /* release voip call only if gsm incoming call exists and is ready to answer */
  1099.             if ((g_voip_cntx_p->call_list_info.numTotal != 0) && (GetTotalCallCount() != 0))
  1100.             {
  1101.                 g_voip_cntx_p->call_list_info.needConn = MMI_VOIP_CALL_CONN_AT;
  1102.                 mmi_voip_background_release_all_req();
  1103.             }
  1104.             else
  1105.             {
  1106.                 mmi_voip_at_call_ctrl_approve_res_req(TRUE, msgInd->action);
  1107.             }            
  1108.             break;
  1109.         case RMMI_CM_CHLD:
  1110.             /* for gsm and voip co-existence, retrieve a gsm held call must notify voip first.
  1111.                in current design, since gsm and voip cannot co-exist, cannot hold gsm call when voip call exists 
  1112.                in case the screen changes and voip incoming screen disappears */
  1113.             if (g_voip_cntx_p->call_list_info.numTotal != 0)
  1114.             {
  1115.                 mmi_voip_at_call_ctrl_approve_res_req(FALSE, msgInd->action);
  1116.             }
  1117.             else
  1118.             {
  1119.                 mmi_voip_at_call_ctrl_approve_res_req(TRUE, msgInd->action);
  1120.             }
  1121.             break;
  1122.         default:
  1123.             MMI_ASSERT(0);
  1124.             break;
  1125.     }
  1126. }
  1127. /*****************************************************************************
  1128.  * FUNCTION
  1129.  *  mmi_voip_at_call_ctrl_approve_res_req
  1130.  * DESCRIPTION
  1131.  *  Send AT command call control approve confirm to L4C.
  1132.  * PARAMETERS
  1133.  *  result          [IN]        Approve to proceed the at command or not
  1134.  * RETURNS
  1135.  *  void
  1136.  *****************************************************************************/
  1137. void mmi_voip_at_call_ctrl_approve_res_req(U8 result, U8 action)
  1138. {
  1139.     /*----------------------------------------------------------------*/
  1140.     /* Local Variables                                                */
  1141.     /*----------------------------------------------------------------*/
  1142.     mmi_voip_at_call_ctrl_approve_res_req_struct *msgReq;
  1143.     msgReq = (mmi_voip_at_call_ctrl_approve_res_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_at_call_ctrl_approve_res_req_struct));
  1144.     /*----------------------------------------------------------------*/
  1145.     /* Code Body                                                      */
  1146.     /*----------------------------------------------------------------*/
  1147.     msgReq->result = result;
  1148.     msgReq->action = action;
  1149.     msgReq->string_ptr = NULL;
  1150.     msgReq->node_ptr = NULL;
  1151.     msgReq->err_id = NULL;
  1152.     mmi_voip_send_message(MOD_MMI, MOD_L4C, MSG_ID_MMI_VOIP_AT_CALL_CTRL_APPROVE_RES_REQ, msgReq, NULL);
  1153. }
  1154. /*****************************************************************************
  1155.  * FUNCTION
  1156.  *  mmi_voip_call_status_req
  1157.  * DESCRIPTION
  1158.  *  Send call status request to L4C.
  1159.  * PARAMETERS
  1160.  *  inMsg           [IN]        Message structure from l4c
  1161.  * RETURNS
  1162.  *  void
  1163.  *****************************************************************************/
  1164. void mmi_voip_call_status_req(U8 status)
  1165. {
  1166.     /*----------------------------------------------------------------*/
  1167.     /* Local Variables                                                */
  1168.     /*----------------------------------------------------------------*/
  1169.     mmi_voip_call_status_req_struct *msgReq;
  1170.     msgReq = (mmi_voip_call_status_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_status_req_struct));
  1171.     /*----------------------------------------------------------------*/
  1172.     /* Code Body                                                      */
  1173.     /*----------------------------------------------------------------*/
  1174.     msgReq->call_status = status;
  1175.     mmi_voip_send_message(MOD_MMI, MOD_L4C, MSG_ID_MMI_VOIP_CALL_STATUS_REQ, msgReq, NULL);
  1176. }
  1177. /*****************************************************************************
  1178.  * FUNCTION
  1179.  *  mmi_voip_call_status_rsp
  1180.  * DESCRIPTION
  1181.  *  Receive call status response from L4C.
  1182.  * PARAMETERS
  1183.  *  inMsg           [IN]        Message structure from l4c
  1184.  * RETURNS
  1185.  *  void
  1186.  *****************************************************************************/
  1187. void mmi_voip_call_status_rsp(void *inMsg)
  1188. {
  1189.     /*----------------------------------------------------------------*/
  1190.     /* Local Variables                                                */
  1191.     /*----------------------------------------------------------------*/
  1192.     /*----------------------------------------------------------------*/
  1193.     /* Code Body                                                      */
  1194.     /*----------------------------------------------------------------*/
  1195.     /* no need to handle its response because the action is always success */
  1196. }
  1197. #ifdef SIP_CONFORMANCE_TEST
  1198. /*****************************************************************************
  1199.  * FUNCTION
  1200.  *  mmi_voip_option_query_req
  1201.  * DESCRIPTION
  1202.  *  Send option query request to VoIP CC.
  1203.  * PARAMETERS
  1204.  *  void
  1205.  * RETURNS
  1206.  *  void
  1207.  *****************************************************************************/
  1208. void mmi_voip_option_query_req(void)
  1209. {
  1210.     /*----------------------------------------------------------------*/
  1211.     /* Local Variables                                                */
  1212.     /*----------------------------------------------------------------*/
  1213.     mmi_voip_option_req_struct *msgReq;
  1214.     msgReq = (mmi_voip_option_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_option_req_struct));
  1215.     /*----------------------------------------------------------------*/
  1216.     /* Code Body                                                      */
  1217.     /*----------------------------------------------------------------*/
  1218.     memcpy(msgReq->uri, g_voip_cntx_p->call_misc_info.inputUri, VOIP_URI_LEN);
  1219.     SetProtocolEventHandler(mmi_voip_option_query_rsp, MSG_ID_MMI_VOIP_OPTION_RSP);
  1220.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_OPTION_REQ, msgReq, NULL);
  1221.     AlmDisableExpiryHandler();
  1222. }
  1223. /*****************************************************************************
  1224.  * FUNCTION
  1225.  *  mmi_voip_option_query_rsp
  1226.  * DESCRIPTION
  1227.  *  Receive option query response from VoIP CC.
  1228.  * PARAMETERS
  1229.  *  inMsg           [IN]        Message structure from voip cc
  1230.  * RETURNS
  1231.  *  void
  1232.  *****************************************************************************/
  1233. void mmi_voip_option_query_rsp(void *inMsg)
  1234. {
  1235.     /*----------------------------------------------------------------*/
  1236.     /* Local Variables                                                */
  1237.     /*----------------------------------------------------------------*/
  1238.     mmi_voip_option_rsp_struct *msgRsp = (mmi_voip_option_rsp_struct*)inMsg;
  1239.     /*----------------------------------------------------------------*/
  1240.     /* Code Body                                                      */
  1241.     /*----------------------------------------------------------------*/
  1242.     if (msgRsp->result == VOIP_OK)
  1243.     {
  1244.         mmi_voip_entry_option_query_result((U8*)msgRsp->data);
  1245.     }
  1246.     else
  1247.     {
  1248.         DisplayPopup(
  1249.             (U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)),
  1250.             IMG_GLOBAL_UNFINISHED,
  1251.             1,
  1252.             UI_POPUP_NOTIFYDURATION_TIME,
  1253.             ERROR_TONE);
  1254.     }
  1255.     DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  1256.     DeleteScreenIfPresent(SCR_ID_VOIP_OPTION_QUERY_EDITOR);
  1257.     AlmEnableExpiryHandler();
  1258. }
  1259. #endif /* SIP_CONFORMANCE_TEST */
  1260. /*****************************************************************************
  1261.  * FUNCTION
  1262.  *  mmi_voip_dispatch_call_act_rsp
  1263.  * DESCRIPTION
  1264.  *  Receive action response from VoIP CC and
  1265.  *  dispatch to corresponding response handler.
  1266.  * PARAMETERS
  1267.  *  inMsg           [IN]        Message structure from voip cc
  1268.  * RETURNS
  1269.  *  void
  1270.  *****************************************************************************/
  1271. void mmi_voip_dispatch_call_act_rsp(void *inMsg)
  1272. {
  1273.     /*----------------------------------------------------------------*/
  1274.     /* Local Variables                                                */
  1275.     /*----------------------------------------------------------------*/
  1276.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1277.     /*----------------------------------------------------------------*/
  1278.     /* Code Body                                                      */
  1279.     /*----------------------------------------------------------------*/
  1280.     switch (msgRsp->op_code)
  1281.     {
  1282.         case VOIP_CALL_ACT_DIAL_CALL:
  1283.         case VOIP_CALL_ACT_HOLD_AND_DIAL:
  1284.             mmi_voip_dial_rsp(inMsg);
  1285.             break;
  1286.         case VOIP_CALL_ACT_ACCEPT_CALL:
  1287.         case VOIP_CALL_ACT_HOLD_AND_ACCEPT:
  1288.             mmi_voip_accept_rsp(inMsg);
  1289.             break;
  1290.         case VOIP_CALL_ACT_HOLD_CALL:
  1291.             mmi_voip_hold_rsp(inMsg);
  1292.             break;
  1293.         case VOIP_CALL_ACT_RETRIEVE_CALL:
  1294.             mmi_voip_retrieve_rsp(inMsg);
  1295.             break;
  1296.         case VOIP_CALL_ACT_SWAP_CALL:
  1297.             mmi_voip_swap_rsp(inMsg);
  1298.             break;
  1299.         case VOIP_CALL_ACT_MERGE_CALL:
  1300.             mmi_voip_merge_rsp(inMsg);
  1301.             break;
  1302.         case VOIP_CALL_ACT_SPLIT_CALL:
  1303.             mmi_voip_split_rsp(inMsg);
  1304.             break;
  1305.         case VOIP_CALL_ACT_REL_CALL:
  1306.         case VOIP_CALL_ACT_REL_ALL_CALLS:
  1307.         case VOIP_CALL_ACT_FORCE_REL_CALL:
  1308.             mmi_voip_release_rsp(inMsg);
  1309.             break;
  1310.         case VOIP_CALL_ACT_BK_REL_MT_CALL:
  1311.             mmi_voip_background_reject_rsp(inMsg);
  1312.             break;
  1313.         case VOIP_CALL_ACT_BK_REL_ALL_CALL:
  1314.             mmi_voip_background_release_all_rsp(inMsg);
  1315.             break;
  1316.         case VOIP_CALL_ACT_BLIND_TRANSFER:
  1317.             mmi_voip_transfer_rsp(inMsg);
  1318.             break;
  1319.         case VOIP_CALL_ACT_REL_ALL_AND_DIAL_EMERGENCY:
  1320.             mmi_voip_dial_sos_rsp(inMsg);
  1321.             break;
  1322.     #if 0
  1323. /* under construction !*/
  1324. /* under construction !*/
  1325. /* under construction !*/
  1326. /* under construction !*/
  1327. /* under construction !*/
  1328. /* under construction !*/
  1329.     #endif
  1330.         default:
  1331.             MMI_ASSERT(0);  /* unrecognized call action */
  1332.             break;
  1333.     }
  1334. }
  1335. /*****************************************************************************
  1336.  * FUNCTION
  1337.  *  mmi_voip_dial_req
  1338.  * DESCRIPTION
  1339.  *  Send dial request to VoIP CC.
  1340.  * PARAMETERS
  1341.  *  void
  1342.  * RETURNS
  1343.  *  void
  1344.  *****************************************************************************/
  1345. void mmi_voip_dial_req(void)
  1346. {
  1347.     /*----------------------------------------------------------------*/
  1348.     /* Local Variables                                                */
  1349.     /*----------------------------------------------------------------*/
  1350.     mmi_voip_call_act_req_struct *msgReq;
  1351.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1352.     /*----------------------------------------------------------------*/
  1353.     /* Code Body                                                      */
  1354.     /*----------------------------------------------------------------*/
  1355.     g_voip_cntx_p->call_list_info.processCId = 0;
  1356.     g_voip_cntx_p->call_list_info.processDId = 0;
  1357.     msgReq->op_code = VOIP_CALL_ACT_DIAL_CALL;
  1358.     memcpy(msgReq->target_call, g_voip_cntx_p->call_misc_info.inputUri, VOIP_URI_LEN);
  1359.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1360. }
  1361. /*****************************************************************************
  1362.  * FUNCTION
  1363.  *  mmi_voip_dial_rsp
  1364.  * DESCRIPTION
  1365.  *  Receive dial response from VoIP CC.
  1366.  * PARAMETERS
  1367.  *  inMsg           [IN]        Message structure from voip cc
  1368.  * RETURNS
  1369.  *  void
  1370.  *****************************************************************************/
  1371. void mmi_voip_dial_rsp(void *inMsg)
  1372. {
  1373.     /*----------------------------------------------------------------*/
  1374.     /* Local Variables                                                */
  1375.     /*----------------------------------------------------------------*/
  1376.     S32 callId = 0, dialogId = 0;
  1377.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1378.     /*----------------------------------------------------------------*/
  1379.     /* Code Body                                                      */
  1380.     /*----------------------------------------------------------------*/
  1381.     callId = g_voip_cntx_p->call_list_info.processCId;
  1382.     dialogId = g_voip_cntx_p->call_list_info.processDId;
  1383.     g_voip_cntx_p->call_list_info.processCId = -1;
  1384.     g_voip_cntx_p->call_list_info.processDId = -1;
  1385.     if (msgRsp->result == VOIP_OK)
  1386.     {
  1387.         mmi_voip_stop_inbandtone();
  1388.         if (g_voip_cntx_p->call_setting_info.saved_setting.autoRedial == TRUE)
  1389.         {
  1390.             mmi_voip_entry_abort_redial();
  1391.         }        
  1392.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1393.         mmi_voip_log_call_history(callId, dialogId, MMI_VOIP_MO_ORIGIN, TRUE);
  1394.         mmi_voip_go_back_screen_check();
  1395.     }
  1396.     else
  1397.     {
  1398.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1399.         mmi_voip_entry_popup((U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)), IMG_GLOBAL_UNFINISHED);
  1400.     #if 0
  1401. /* under construction !*/
  1402. /* under construction !*/
  1403. /* under construction !*/
  1404. /* under construction !*/
  1405. /* under construction !*/
  1406. /* under construction !*/
  1407.     #endif
  1408.         mmi_voip_go_back_screen_check();
  1409.         /* call not exist error cause is because of race condition, do not apply auto redial */
  1410.         if ((g_voip_cntx_p->call_setting_info.saved_setting.autoRedial == TRUE) && 
  1411.             (mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause) != VOIP_CALL_NOT_EXIST))
  1412.         {
  1413.             /* in case processing previous dial_rsp after abort_req is sent, 
  1414.                redial structure does not exist anymore */
  1415.             if ((g_voip_cntx_p->call_redial_info.currAttempt < g_voip_cntx_p->call_redial_info.maxAttempt) &&
  1416.                 (strlen((S8*)g_voip_cntx_p->call_redial_info.redialUri)))
  1417.             {
  1418.                 mmi_voip_entry_redialing_call();
  1419.                 StartTimer(VOIP_AUTOREDIAL_TIMER, MMI_VOIP_GENERAL_TIMEOUT, mmi_voip_entry_redial);
  1420.             }
  1421.             else
  1422.             {
  1423.                 mmi_voip_entry_abort_redial();
  1424.             }
  1425.         }
  1426.         /* call not exist error cause does not apply auto redial, 
  1427.            but redial structure needs to clear to prevent misuse by next call */
  1428.         else
  1429.         {
  1430.             mmi_voip_entry_abort_redial();
  1431.         }
  1432.     }
  1433. }
  1434. /*****************************************************************************
  1435.  * FUNCTION
  1436.  *  mmi_voip_accept_req
  1437.  * DESCRIPTION
  1438.  *  Send accept request to VoIP CC.
  1439.  * PARAMETERS
  1440.  *  callId      [IN]        Incoming call id that intends to accept
  1441.  * RETURNS
  1442.  *  void
  1443.  *****************************************************************************/
  1444. void mmi_voip_accept_req(S32 callId)
  1445. {
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Local Variables                                                */
  1448.     /*----------------------------------------------------------------*/
  1449.     mmi_voip_call_act_req_struct *msgReq;
  1450.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1451.     /*----------------------------------------------------------------*/
  1452.     /* Code Body                                                      */
  1453.     /*----------------------------------------------------------------*/
  1454.     g_voip_cntx_p->call_list_info.processCId = callId;
  1455.     g_voip_cntx_p->call_list_info.processDId = 0;
  1456.     msgReq->op_code = VOIP_CALL_ACT_ACCEPT_CALL;
  1457.     msgReq->active_call.call_id = callId;
  1458.     msgReq->active_call.dialog_id = 0;
  1459.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1460. }
  1461. /*****************************************************************************
  1462.  * FUNCTION
  1463.  *  mmi_voip_accept_rsp
  1464.  * DESCRIPTION
  1465.  *  Receive accept response from VoIP CC.
  1466.  * PARAMETERS
  1467.  *  inMsg           [IN]        Message structure from voip cc
  1468.  * RETURNS
  1469.  *  void
  1470.  *****************************************************************************/
  1471. void mmi_voip_accept_rsp(void *inMsg)
  1472. {
  1473.     /*----------------------------------------------------------------*/
  1474.     /* Local Variables                                                */
  1475.     /*----------------------------------------------------------------*/
  1476.     S32 callId = 0, dialogId = 0;
  1477.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1478.     /*----------------------------------------------------------------*/
  1479.     /* Code Body                                                      */
  1480.     /*----------------------------------------------------------------*/
  1481.     callId = g_voip_cntx_p->call_list_info.processCId;
  1482.     dialogId = g_voip_cntx_p->call_list_info.processDId;
  1483.     g_voip_cntx_p->call_list_info.processCId = -1;
  1484.     g_voip_cntx_p->call_list_info.processDId = -1;
  1485.     if (msgRsp->result == VOIP_OK)
  1486.     {
  1487.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1488.         mmi_voip_log_call_history(callId, dialogId, MMI_VOIP_MT_ORIGIN, TRUE);
  1489.         mmi_voip_go_back_screen_check();
  1490.     }
  1491.     else
  1492.     {
  1493.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1494.         mmi_voip_entry_popup((U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)), IMG_GLOBAL_UNFINISHED);
  1495.     #if 0
  1496. /* under construction !*/
  1497. /* under construction !*/
  1498. /* under construction !*/
  1499. /* under construction !*/
  1500. /* under construction !*/
  1501. /* under construction !*/
  1502.     #endif
  1503.         mmi_voip_go_back_screen_check();
  1504.     }
  1505. }
  1506. /*****************************************************************************
  1507.  * FUNCTION
  1508.  *  mmi_voip_hold_req
  1509.  * DESCRIPTION
  1510.  *  Send hold request to VoIP CC.
  1511.  * PARAMETERS
  1512.  *  callId      [IN]        Active call id that intends to hold
  1513.  * RETURNS
  1514.  *  void
  1515.  *****************************************************************************/
  1516. void mmi_voip_hold_req(S32 callId)
  1517. {
  1518.     /*----------------------------------------------------------------*/
  1519.     /* Local Variables                                                */
  1520.     /*----------------------------------------------------------------*/
  1521.     mmi_voip_call_act_req_struct *msgReq;
  1522.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1523.     /*----------------------------------------------------------------*/
  1524.     /* Code Body                                                      */
  1525.     /*----------------------------------------------------------------*/
  1526.     g_voip_cntx_p->call_list_info.processCId = callId;
  1527.     g_voip_cntx_p->call_list_info.processDId = VOIP_MAX_NUM_DIALOG;
  1528.     msgReq->op_code = VOIP_CALL_ACT_HOLD_CALL;
  1529.     msgReq->hold_call.call_id = callId;
  1530.     msgReq->hold_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  1531.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1532. }
  1533. /*****************************************************************************
  1534.  * FUNCTION
  1535.  *  mmi_voip_hold_rsp
  1536.  * DESCRIPTION
  1537.  *  Receive hold response from VoIP CC.
  1538.  * PARAMETERS
  1539.  *  inMsg           [IN]        Message structure from voip cc
  1540.  * RETURNS
  1541.  *  void
  1542.  *****************************************************************************/
  1543. void mmi_voip_hold_rsp(void *inMsg)
  1544. {
  1545.     /*----------------------------------------------------------------*/
  1546.     /* Local Variables                                                */
  1547.     /*----------------------------------------------------------------*/
  1548.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1549.     /*----------------------------------------------------------------*/
  1550.     /* Code Body                                                      */
  1551.     /*----------------------------------------------------------------*/
  1552.     g_voip_cntx_p->call_list_info.processCId = -1;
  1553.     g_voip_cntx_p->call_list_info.processDId = -1;
  1554.     if (msgRsp->result == VOIP_OK)
  1555.     {
  1556.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1557.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_HOLD_OK), IMG_GLOBAL_ACTIVATED);
  1558.     #if 0
  1559. /* under construction !*/
  1560. /* under construction !*/
  1561. /* under construction !*/
  1562. /* under construction !*/
  1563. /* under construction !*/
  1564. /* under construction !*/
  1565.     #endif
  1566.         mmi_voip_go_back_screen_check();
  1567.     }
  1568.     else
  1569.     {
  1570.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1571.         mmi_voip_entry_popup((U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)), IMG_GLOBAL_UNFINISHED);
  1572.     #if 0
  1573. /* under construction !*/
  1574. /* under construction !*/
  1575. /* under construction !*/
  1576. /* under construction !*/
  1577. /* under construction !*/
  1578. /* under construction !*/
  1579.     #endif
  1580.         mmi_voip_go_back_screen_check();
  1581.     }
  1582. }
  1583. /*****************************************************************************
  1584.  * FUNCTION
  1585.  *  mmi_voip_retrieve_req
  1586.  * DESCRIPTION
  1587.  *  Send retrieve request to VoIP CC.
  1588.  * PARAMETERS
  1589.  *  callId      [IN]        Held call id that intends to retrieve
  1590.  * RETURNS
  1591.  *  void
  1592.  *****************************************************************************/
  1593. void mmi_voip_retrieve_req(S32 callId)
  1594. {
  1595.     /*----------------------------------------------------------------*/
  1596.     /* Local Variables                                                */
  1597.     /*----------------------------------------------------------------*/
  1598.     mmi_voip_call_act_req_struct *msgReq;
  1599.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1600.     /*----------------------------------------------------------------*/
  1601.     /* Code Body                                                      */
  1602.     /*----------------------------------------------------------------*/
  1603.     g_voip_cntx_p->call_list_info.processCId = callId;
  1604.     g_voip_cntx_p->call_list_info.processDId = VOIP_MAX_NUM_DIALOG;
  1605.     msgReq->op_code = VOIP_CALL_ACT_RETRIEVE_CALL;
  1606.     msgReq->active_call.call_id = callId;
  1607.     msgReq->active_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  1608.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1609. }
  1610. /*****************************************************************************
  1611.  * FUNCTION
  1612.  *  mmi_voip_retrieve_rsp
  1613.  * DESCRIPTION
  1614.  *  Receive retrieve response from VoIP CC.
  1615.  * PARAMETERS
  1616.  *  inMsg           [IN]        Message structure from voip cc
  1617.  * RETURNS
  1618.  *  void
  1619.  *****************************************************************************/
  1620. void mmi_voip_retrieve_rsp(void *inMsg)
  1621. {
  1622.     /*----------------------------------------------------------------*/
  1623.     /* Local Variables                                                */
  1624.     /*----------------------------------------------------------------*/
  1625.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1626.     /*----------------------------------------------------------------*/
  1627.     /* Code Body                                                      */
  1628.     /*----------------------------------------------------------------*/
  1629.     g_voip_cntx_p->call_list_info.processCId = -1;
  1630.     g_voip_cntx_p->call_list_info.processDId = -1;
  1631.     if (msgRsp->result == VOIP_OK)
  1632.     {
  1633.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1634.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_RETRIEVE_OK), IMG_GLOBAL_ACTIVATED);
  1635.     #if 0
  1636. /* under construction !*/
  1637. /* under construction !*/
  1638. /* under construction !*/
  1639. /* under construction !*/
  1640. /* under construction !*/
  1641. /* under construction !*/
  1642.     #endif
  1643.         mmi_voip_go_back_screen_check();
  1644.     }
  1645.     else
  1646.     {
  1647.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1648.         mmi_voip_entry_popup((U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)), IMG_GLOBAL_UNFINISHED);
  1649.     #if 0
  1650. /* under construction !*/
  1651. /* under construction !*/
  1652. /* under construction !*/
  1653. /* under construction !*/
  1654. /* under construction !*/
  1655. /* under construction !*/
  1656.     #endif
  1657.         mmi_voip_go_back_screen_check();
  1658.     }
  1659. }
  1660. /*****************************************************************************
  1661.  * FUNCTION
  1662.  *  mmi_voip_swap_req
  1663.  * DESCRIPTION
  1664.  *  Send swap request to VoIP CC.
  1665.  * PARAMETERS
  1666.  *  activecallId        [IN]        Active call id that intends to hold
  1667.  *  heldcallId          [IN]        Held call id that intends to retrieve
  1668.  * RETURNS
  1669.  *  void
  1670.  *****************************************************************************/
  1671. void mmi_voip_swap_req(S32 activecallId, S32 heldcallId)
  1672. {
  1673.     /*----------------------------------------------------------------*/
  1674.     /* Local Variables                                                */
  1675.     /*----------------------------------------------------------------*/
  1676.     S32 currhiliteTab = 0, callId = 0;
  1677.     mmi_voip_call_act_req_struct *msgReq;
  1678.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1679.     /*----------------------------------------------------------------*/
  1680.     /* Code Body                                                      */
  1681.     /*----------------------------------------------------------------*/
  1682.     currhiliteTab = g_voip_cntx_p->call_misc_info.currhiliteTab;
  1683.     callId = g_voip_cntx_p->call_list_info.call_info[currhiliteTab].callId;
  1684.     /* in case of release call, release current highlight call */
  1685.     g_voip_cntx_p->call_list_info.processCId = callId;
  1686.     g_voip_cntx_p->call_list_info.processDId = VOIP_MAX_NUM_DIALOG;
  1687.     msgReq->op_code = VOIP_CALL_ACT_SWAP_CALL;
  1688.     msgReq->active_call.call_id = heldcallId;
  1689.     msgReq->active_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  1690.     msgReq->hold_call.call_id = activecallId;
  1691.     msgReq->hold_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  1692.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1693. }
  1694. /*****************************************************************************
  1695.  * FUNCTION
  1696.  *  mmi_voip_swap_rsp
  1697.  * DESCRIPTION
  1698.  *  Receive swap response from VoIP CC.
  1699.  * PARAMETERS
  1700.  *  inMsg           [IN]        Message structure from voip cc
  1701.  * RETURNS
  1702.  *  void
  1703.  *****************************************************************************/
  1704. void mmi_voip_swap_rsp(void *inMsg)
  1705. {
  1706.     /*----------------------------------------------------------------*/
  1707.     /* Local Variables                                                */
  1708.     /*----------------------------------------------------------------*/
  1709.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1710.     /*----------------------------------------------------------------*/
  1711.     /* Code Body                                                      */
  1712.     /*----------------------------------------------------------------*/
  1713.     g_voip_cntx_p->call_list_info.processCId = -1;
  1714.     g_voip_cntx_p->call_list_info.processDId = -1;
  1715.     if (msgRsp->result == VOIP_OK)
  1716.     {
  1717.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1718.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_SWAP_OK), IMG_GLOBAL_ACTIVATED);
  1719.     #if 0
  1720. /* under construction !*/
  1721. /* under construction !*/
  1722. /* under construction !*/
  1723. /* under construction !*/
  1724. /* under construction !*/
  1725. /* under construction !*/
  1726.     #endif
  1727.         mmi_voip_go_back_screen_check();
  1728.     }
  1729.     else
  1730.     {
  1731.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1732.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_SWAP_FAIL), IMG_GLOBAL_UNFINISHED);
  1733.     #if 0
  1734. /* under construction !*/
  1735. /* under construction !*/
  1736. /* under construction !*/
  1737. /* under construction !*/
  1738. /* under construction !*/
  1739. /* under construction !*/
  1740.     #endif
  1741.         mmi_voip_go_back_screen_check();
  1742.     }
  1743. }
  1744. /*****************************************************************************
  1745.  * FUNCTION
  1746.  *  mmi_voip_merge_req
  1747.  * DESCRIPTION
  1748.  *  Send merge request to VoIP CC.
  1749.  * PARAMETERS
  1750.  *  activecallId        [IN]        Active call id that will be the first dialog of conference call
  1751.  *  heldcallId          [IN]        Held call id that will be the second dialog of conference call
  1752.  * RETURNS
  1753.  *  void
  1754.  *****************************************************************************/
  1755. void mmi_voip_merge_req(S32 activecallId, S32 heldcallId)
  1756. {
  1757.     /*----------------------------------------------------------------*/
  1758.     /* Local Variables                                                */
  1759.     /*----------------------------------------------------------------*/
  1760.     mmi_voip_call_act_req_struct *msgReq;
  1761.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1762.     /*----------------------------------------------------------------*/
  1763.     /* Code Body                                                      */
  1764.     /*----------------------------------------------------------------*/
  1765.     /* in case of release call, release original held call */
  1766.     g_voip_cntx_p->call_list_info.processCId = heldcallId;
  1767.     g_voip_cntx_p->call_list_info.processDId = VOIP_MAX_NUM_DIALOG;
  1768.     msgReq->op_code = VOIP_CALL_ACT_MERGE_CALL;
  1769.     msgReq->active_call.call_id = activecallId;
  1770.     msgReq->active_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  1771.     msgReq->hold_call.call_id = heldcallId;
  1772.     msgReq->hold_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  1773.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1774. }
  1775. /*****************************************************************************
  1776.  * FUNCTION
  1777.  *  mmi_voip_merge_rsp
  1778.  * DESCRIPTION
  1779.  *  Receive merge response from VoIP CC.
  1780.  * PARAMETERS
  1781.  *  inMsg           [IN]        Message structure from voip cc
  1782.  * RETURNS
  1783.  *  void
  1784.  *****************************************************************************/
  1785. void mmi_voip_merge_rsp(void *inMsg)
  1786. {
  1787.     /*----------------------------------------------------------------*/
  1788.     /* Local Variables                                                */
  1789.     /*----------------------------------------------------------------*/
  1790.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1791.     /*----------------------------------------------------------------*/
  1792.     /* Code Body                                                      */
  1793.     /*----------------------------------------------------------------*/
  1794.     g_voip_cntx_p->call_list_info.processCId = -1;
  1795.     g_voip_cntx_p->call_list_info.processDId = -1;
  1796.     if (msgRsp->result == VOIP_OK)
  1797.     {
  1798.         mmi_voip_update_call_list(msgRsp->call_list, TRUE);
  1799.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_CONFERENCE_OK), IMG_GLOBAL_ACTIVATED);
  1800.     #if 0
  1801. /* under construction !*/
  1802. /* under construction !*/
  1803. /* under construction !*/
  1804. /* under construction !*/
  1805. /* under construction !*/
  1806. /* under construction !*/
  1807.     #endif
  1808.         mmi_voip_go_back_screen_check();
  1809.     }
  1810.     else
  1811.     {
  1812.         mmi_voip_update_call_list(msgRsp->call_list, TRUE);
  1813.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_CONFERENCE_FAIL), IMG_GLOBAL_UNFINISHED);
  1814.     #if 0
  1815. /* under construction !*/
  1816. /* under construction !*/
  1817. /* under construction !*/
  1818. /* under construction !*/
  1819. /* under construction !*/
  1820. /* under construction !*/
  1821.     #endif
  1822.         mmi_voip_go_back_screen_check();
  1823.     }
  1824. }
  1825. /*****************************************************************************
  1826.  * FUNCTION
  1827.  *  mmi_voip_split_req
  1828.  * DESCRIPTION
  1829.  *  Send split request to VoIP CC.
  1830.  * PARAMETERS
  1831.  *  activecallId        [IN]        Active call id that will remain an active call
  1832.  *  helddialogId        [IN]        Unhilite dialog id that will be a held call
  1833.  * RETURNS
  1834.  *  void
  1835.  *****************************************************************************/
  1836. void mmi_voip_split_req(S32 callId, S32 helddialogId)
  1837. {
  1838.     /*----------------------------------------------------------------*/
  1839.     /* Local Variables                                                */
  1840.     /*----------------------------------------------------------------*/
  1841.     mmi_voip_call_act_req_struct *msgReq;
  1842.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1843.     /*----------------------------------------------------------------*/
  1844.     /* Code Body                                                      */
  1845.     /*----------------------------------------------------------------*/
  1846.     g_voip_cntx_p->call_list_info.processCId = callId;
  1847.     g_voip_cntx_p->call_list_info.processDId = helddialogId;
  1848.     msgReq->op_code = VOIP_CALL_ACT_SPLIT_CALL;
  1849.     msgReq->hold_call.call_id = callId;
  1850.     msgReq->hold_call.dialog_id = helddialogId;
  1851.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1852. }
  1853. /*****************************************************************************
  1854.  * FUNCTION
  1855.  *  mmi_voip_split_rsp
  1856.  * DESCRIPTION
  1857.  *  Receive split response from VoIP CC.
  1858.  * PARAMETERS
  1859.  *  inMsg           [IN]        Message structure from voip cc
  1860.  * RETURNS
  1861.  *  void
  1862.  *****************************************************************************/
  1863. void mmi_voip_split_rsp(void *inMsg)
  1864. {
  1865.     /*----------------------------------------------------------------*/
  1866.     /* Local Variables                                                */
  1867.     /*----------------------------------------------------------------*/
  1868.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1869.     /*----------------------------------------------------------------*/
  1870.     /* Code Body                                                      */
  1871.     /*----------------------------------------------------------------*/
  1872.     g_voip_cntx_p->call_list_info.processCId = -1;
  1873.     g_voip_cntx_p->call_list_info.processDId = -1;
  1874.     if (msgRsp->result == VOIP_OK)
  1875.     {
  1876.         mmi_voip_update_call_list(msgRsp->call_list, TRUE);
  1877.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_SPLIT_OK), IMG_GLOBAL_ACTIVATED);
  1878.     #if 0
  1879. /* under construction !*/
  1880. /* under construction !*/
  1881. /* under construction !*/
  1882. /* under construction !*/
  1883. /* under construction !*/
  1884. /* under construction !*/
  1885.     #endif
  1886.         mmi_voip_go_back_screen_check();
  1887.     }
  1888.     else
  1889.     {
  1890.         mmi_voip_update_call_list(msgRsp->call_list, TRUE);
  1891.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_SPLIT_FAIL), IMG_GLOBAL_UNFINISHED);
  1892.     #if 0
  1893. /* under construction !*/
  1894. /* under construction !*/
  1895. /* under construction !*/
  1896. /* under construction !*/
  1897. /* under construction !*/
  1898. /* under construction !*/
  1899.     #endif
  1900.         mmi_voip_go_back_screen_check();
  1901.     }
  1902. }
  1903. /*****************************************************************************
  1904.  * FUNCTION
  1905.  *  mmi_voip_release_req
  1906.  * DESCRIPTION
  1907.  *  Send release request to VoIP CC.
  1908.  * PARAMETERS
  1909.  *  callId          [IN]        Call id that intends to release
  1910.  *  dialogId        [IN]        Dialog id that intends to release
  1911.  * RETURNS
  1912.  *  void
  1913.  *****************************************************************************/
  1914. void mmi_voip_release_req(S32 callId, S32 dialogId)
  1915. {
  1916.     /*----------------------------------------------------------------*/
  1917.     /* Local Variables                                                */
  1918.     /*----------------------------------------------------------------*/
  1919.     mmi_voip_call_act_req_struct *msgReq;
  1920.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  1921.     /*----------------------------------------------------------------*/
  1922.     /* Code Body                                                      */
  1923.     /*----------------------------------------------------------------*/
  1924.     g_voip_cntx_p->call_list_info.processCId = callId;
  1925.     g_voip_cntx_p->call_list_info.processDId = dialogId;
  1926.     if ((callId != -1) && (dialogId != -1)) /* end single */
  1927.     {
  1928.         msgReq->op_code = VOIP_CALL_ACT_REL_CALL;
  1929.         /* distinguish abort call so that voip cc can ignore the action 
  1930.            if the call is connected by remote first */
  1931.         msgReq->abort_call_id = (g_voip_cntx_p->call_misc_info.isAbort == TRUE) ? (callId) : (-1);
  1932.         if (callId != g_voip_cntx_p->call_list_info.maxnumCall)
  1933.         {
  1934.             msgReq->rel_call.call_id = callId;
  1935.             msgReq->rel_call.dialog_id = dialogId;
  1936.         }
  1937.     }
  1938.     else if (callId != -1) /* end conference */
  1939.     {
  1940.         msgReq->op_code = VOIP_CALL_ACT_REL_CALL;
  1941.         msgReq->abort_call_id = -1;
  1942.         msgReq->rel_call.call_id = callId;
  1943.         msgReq->rel_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  1944.     }
  1945.     else /* end all */
  1946.     {
  1947.         msgReq->op_code = VOIP_CALL_ACT_REL_ALL_CALLS;
  1948.         msgReq->abort_call_id = -1;
  1949.     }
  1950.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  1951. }
  1952. /*****************************************************************************
  1953.  * FUNCTION
  1954.  *  mmi_voip_release_rsp
  1955.  * DESCRIPTION
  1956.  *  Receive release response from VoIP CC.
  1957.  * PARAMETERS
  1958.  *  inMsg           [IN]        Message structure from voip cc
  1959.  * RETURNS
  1960.  *  void
  1961.  *****************************************************************************/
  1962. void mmi_voip_release_rsp(void *inMsg)
  1963. {
  1964.     /*----------------------------------------------------------------*/
  1965.     /* Local Variables                                                */
  1966.     /*----------------------------------------------------------------*/
  1967.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  1968.     /*----------------------------------------------------------------*/
  1969.     /* Code Body                                                      */
  1970.     /*----------------------------------------------------------------*/
  1971.     g_voip_cntx_p->call_list_info.processCId = -1;
  1972.     g_voip_cntx_p->call_list_info.processDId = -1;
  1973.     g_voip_cntx_p->call_misc_info.isAbort = FALSE;
  1974.     if (msgRsp->result == VOIP_OK)
  1975.     {
  1976.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1977.         /* force release may not receive call_end_ind, need to adjust screens still */
  1978.         mmi_voip_go_back_screen_check();
  1979.     }
  1980.     else
  1981.     {
  1982.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  1983.         /* in case race condition */
  1984.         mmi_voip_go_back_screen_check();
  1985.     }
  1986. }
  1987. /*****************************************************************************
  1988.  * FUNCTION
  1989.  *  mmi_voip_force_release_req
  1990.  * DESCRIPTION
  1991.  *  Send force release request to VoIP CC.
  1992.  * PARAMETERS
  1993.  *  callId          [IN]        Call id that intends to force release
  1994.  *  dialogId        [IN]        Dialog id that intends to force release
  1995.  * RETURNS
  1996.  *  void
  1997.  *****************************************************************************/
  1998. void mmi_voip_force_release_req(S32 callId, S32 dialogId)
  1999. {
  2000.     /*----------------------------------------------------------------*/
  2001.     /* Local Variables                                                */
  2002.     /*----------------------------------------------------------------*/
  2003.     S32 i = 0, j = 0;
  2004.     mmi_voip_call_act_req_struct *msgReq;
  2005.     /*----------------------------------------------------------------*/
  2006.     /* Code Body                                                      */
  2007.     /*----------------------------------------------------------------*/
  2008.     ClearInputEventHandler(MMI_DEVICE_ALL);
  2009.     ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  2010.     ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  2011.     ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
  2012.     ClearKeyHandler(KEY_END, KEY_REPEAT);
  2013.     if ((callId != -1) && (dialogId != -1))
  2014.     {
  2015.         msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2016.         msgReq->op_code = VOIP_CALL_ACT_FORCE_REL_CALL;
  2017.         /* distinguish abort call so that voip cc can ignore the action 
  2018.            if the call is connected by remote first */
  2019.         msgReq->abort_call_id = (g_voip_cntx_p->call_misc_info.isAbort == TRUE) ? (callId) : (-1);
  2020.         if (callId != g_voip_cntx_p->call_list_info.maxnumCall)
  2021.         {
  2022.             msgReq->rel_call.call_id = callId;
  2023.             msgReq->rel_call.dialog_id = dialogId;
  2024.         }
  2025.         mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2026.     }
  2027.     else if (callId != -1)
  2028.     {
  2029.         for (i = 0; i < VOIP_MAX_NUM_DIALOG; i++)
  2030.         {
  2031.             msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2032.             msgReq->op_code = VOIP_CALL_ACT_FORCE_REL_CALL;
  2033.             msgReq->abort_call_id = -1;
  2034.             msgReq->rel_call.call_id = callId;
  2035.             msgReq->rel_call.dialog_id = i;
  2036.             mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2037.         }
  2038.     }
  2039.     else /* end all */
  2040.     {
  2041.         for (i = 0; i < g_voip_cntx_p->call_list_info.numTotal; i++)
  2042.         {
  2043.             for (j = 0; j < g_voip_cntx_p->call_list_info.call_info[i].numDialog; j++)
  2044.             {
  2045.                 msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2046.                 msgReq->op_code = VOIP_CALL_ACT_FORCE_REL_CALL;
  2047.                 msgReq->abort_call_id = -1;
  2048.                 msgReq->rel_call.call_id = g_voip_cntx_p->call_list_info.call_info[i].callId;
  2049.                 msgReq->rel_call.dialog_id = g_voip_cntx_p->call_list_info.call_info[i].dialog_info[j].dialogId;
  2050.                 mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2051.             }
  2052.         }
  2053.     }
  2054. }
  2055. /*****************************************************************************
  2056.  * FUNCTION
  2057.  *  mmi_voip_force_release_rsp
  2058.  * DESCRIPTION
  2059.  *  Receive force release response from VoIP CC.
  2060.  * PARAMETERS
  2061.  *  inMsg           [IN]        Message structure from voip cc
  2062.  * RETURNS
  2063.  *  void
  2064.  *****************************************************************************/
  2065. void mmi_voip_force_release_rsp(void *inMsg)
  2066. {
  2067.     /*----------------------------------------------------------------*/
  2068.     /* Local Variables                                                */
  2069.     /*----------------------------------------------------------------*/
  2070.     /*----------------------------------------------------------------*/
  2071.     /* Code Body                                                      */
  2072.     /*----------------------------------------------------------------*/
  2073.     /* force release will not receive its response, instead, original release response will receive */
  2074. }
  2075. /*****************************************************************************
  2076.  * FUNCTION
  2077.  *  mmi_voip_background_reject_req
  2078.  * DESCRIPTION
  2079.  *  Send background reject request to VoIP CC.
  2080.  * PARAMETERS
  2081.  *  callId          [IN]        Call id that intends to background reject
  2082.  *  dialogId        [IN]        Dialog id that intends to background reject
  2083.  * RETURNS
  2084.  *  void
  2085.  *****************************************************************************/
  2086. void mmi_voip_background_reject_req(S32 callId, S32 dialogId)
  2087. {
  2088.     /*----------------------------------------------------------------*/
  2089.     /* Local Variables                                                */
  2090.     /*----------------------------------------------------------------*/
  2091.     mmi_voip_call_act_req_struct *msgReq;
  2092.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2093.     /*----------------------------------------------------------------*/
  2094.     /* Code Body                                                      */
  2095.     /*----------------------------------------------------------------*/
  2096.     g_voip_cntx_p->call_list_info.bkrejCId = callId;
  2097.     g_voip_cntx_p->call_list_info.bkrejDId = dialogId;
  2098.     if ((callId != -1) && (dialogId != -1))
  2099.     {
  2100.         msgReq->op_code = VOIP_CALL_ACT_BK_REL_MT_CALL;
  2101.         msgReq->abort_call_id = -1;
  2102.         msgReq->rel_call.call_id = callId;
  2103.         msgReq->rel_call.dialog_id = dialogId;
  2104.     }
  2105.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2106. }
  2107. /*****************************************************************************
  2108.  * FUNCTION
  2109.  *  mmi_voip_background_reject_rsp
  2110.  * DESCRIPTION
  2111.  *  Receive background reject response from VoIP CC.
  2112.  * PARAMETERS
  2113.  *  inMsg           [IN]        Message structure from voip cc
  2114.  * RETURNS
  2115.  *  void
  2116.  *****************************************************************************/
  2117. void mmi_voip_background_reject_rsp(void *inMsg)
  2118. {
  2119.     /*----------------------------------------------------------------*/
  2120.     /* Local Variables                                                */
  2121.     /*----------------------------------------------------------------*/
  2122.     S32 callId = 0, dialogId = 0;
  2123.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  2124.     /*----------------------------------------------------------------*/
  2125.     /* Code Body                                                      */
  2126.     /*----------------------------------------------------------------*/
  2127.     callId = g_voip_cntx_p->call_list_info.bkrejCId;
  2128.     dialogId = g_voip_cntx_p->call_list_info.bkrejDId;
  2129.     g_voip_cntx_p->call_list_info.bkrejCId = -1;
  2130.     g_voip_cntx_p->call_list_info.bkrejDId = -1;
  2131.     if (msgRsp->result == VOIP_OK)
  2132.     {
  2133.         mmi_voip_del_from_call_list(callId, dialogId);
  2134.     }
  2135.     /* call not exist error cause is because of race condition, 
  2136.        need to delete mmi call list to sync with voip cc */
  2137.     else if (mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause) == VOIP_CALL_NOT_EXIST)
  2138.     {
  2139.         mmi_voip_del_from_call_list(callId, dialogId);
  2140.     }
  2141. }
  2142. /*****************************************************************************
  2143.  * FUNCTION
  2144.  *  mmi_voip_background_release_all_req
  2145.  * DESCRIPTION
  2146.  *  Send background release all request to VoIP CC.
  2147.  * PARAMETERS
  2148.  *  void        
  2149.  * RETURNS
  2150.  *  void
  2151.  *****************************************************************************/
  2152. void mmi_voip_background_release_all_req(void)
  2153. {
  2154.     /*----------------------------------------------------------------*/
  2155.     /* Local Variables                                                */
  2156.     /*----------------------------------------------------------------*/
  2157.     mmi_voip_call_act_req_struct *msgReq;
  2158.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2159.     /*----------------------------------------------------------------*/
  2160.     /* Code Body                                                      */
  2161.     /*----------------------------------------------------------------*/
  2162.     msgReq->op_code = VOIP_CALL_ACT_BK_REL_ALL_CALL;
  2163.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2164. }
  2165. /*****************************************************************************
  2166.  * FUNCTION
  2167.  *  mmi_voip_background_release_all_rsp
  2168.  * DESCRIPTION
  2169.  *  Receive background release all response from VoIP CC.
  2170.  * PARAMETERS
  2171.  *  inMsg           [IN]        Message structure from voip cc
  2172.  * RETURNS
  2173.  *  void
  2174.  *****************************************************************************/
  2175. void mmi_voip_background_release_all_rsp(void *inMsg)
  2176. {
  2177.     /*----------------------------------------------------------------*/
  2178.     /* Local Variables                                                */
  2179.     /*----------------------------------------------------------------*/
  2180.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  2181.     
  2182.     /*----------------------------------------------------------------*/
  2183.     /* Code Body                                                      */
  2184.     /*----------------------------------------------------------------*/
  2185.     g_voip_cntx_p->call_list_info.processCId = -1;
  2186.     g_voip_cntx_p->call_list_info.processDId = -1;
  2187.     g_voip_cntx_p->call_list_info.bkrejCId = -1;
  2188.     g_voip_cntx_p->call_list_info.bkrejDId = -1;
  2189.     g_voip_cntx_p->call_misc_info.isAbort = FALSE;
  2190.     if (msgRsp->result == VOIP_OK)
  2191.     {
  2192.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  2193.         mmi_voip_go_back_screen_check();
  2194.     }
  2195.     /* call back gsm to connect gsm */
  2196.     if ((GetTotalCallCount() != 0) && (g_voip_cntx_p->call_list_info.needConn == MMI_VOIP_CALL_CONN_GSM))
  2197.     {
  2198.         PRINT_INFORMATION(("n[mmi_voip_background_release_all_rsp] Ready to Answer GSMn"));
  2199.         g_voip_cntx_p->call_list_info.needConn = MMI_VOIP_CALL_CONN_NONE;
  2200.         mmi_voip_entry_ans_to_conn_gsm();
  2201.     }
  2202.     else if (g_voip_cntx_p->call_list_info.needConn == MMI_VOIP_CALL_CONN_AT)
  2203.     {
  2204.         PRINT_INFORMATION(("n[mmi_voip_background_release_all_rsp] Ask AT to Answer GSMn"));
  2205.         g_voip_cntx_p->call_list_info.needConn = MMI_VOIP_CALL_CONN_NONE;
  2206.         mmi_voip_at_call_ctrl_approve_res_req(TRUE, RMMI_CM_ATA);
  2207.     }
  2208. }
  2209. /*****************************************************************************
  2210.  * FUNCTION
  2211.  *  mmi_voip_transfer_req
  2212.  * DESCRIPTION
  2213.  *  Send blind transfer request to VoIP CC.
  2214.  * PARAMETERS
  2215.  *  callId          [IN]        Call id that intends to transfer
  2216.  *  dialogId        [IN]        Dialog id that intends to transfer
  2217.  * RETURNS
  2218.  *  void
  2219.  *****************************************************************************/
  2220. void mmi_voip_transfer_req(S32 callId, S32 dialogId)
  2221. {
  2222.     /*----------------------------------------------------------------*/
  2223.     /* Local Variables                                                */
  2224.     /*----------------------------------------------------------------*/
  2225.     mmi_voip_call_act_req_struct *msgReq;
  2226.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2227.     /*----------------------------------------------------------------*/
  2228.     /* Code Body                                                      */
  2229.     /*----------------------------------------------------------------*/
  2230.     g_voip_cntx_p->call_list_info.processCId = callId;
  2231.     g_voip_cntx_p->call_list_info.processDId = dialogId;
  2232.     msgReq->op_code = VOIP_CALL_ACT_BLIND_TRANSFER;
  2233.     msgReq->active_call.call_id = callId;
  2234.     msgReq->active_call.dialog_id = dialogId;
  2235.     memcpy(msgReq->target_call, g_voip_cntx_p->call_misc_info.inputUri, VOIP_URI_LEN);
  2236.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2237. }
  2238. /*****************************************************************************
  2239.  * FUNCTION
  2240.  *  mmi_voip_transfer_rsp
  2241.  * DESCRIPTION
  2242.  *  Receive blind transfer response from VoIP CC.
  2243.  * PARAMETERS
  2244.  *  inMsg           [IN]        Message structure from voip cc
  2245.  * RETURNS
  2246.  *  void
  2247.  *****************************************************************************/
  2248. void mmi_voip_transfer_rsp(void *inMsg)
  2249. {
  2250.     /*----------------------------------------------------------------*/
  2251.     /* Local Variables                                                */
  2252.     /*----------------------------------------------------------------*/
  2253.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  2254.     /*----------------------------------------------------------------*/
  2255.     /* Code Body                                                      */
  2256.     /*----------------------------------------------------------------*/
  2257.     g_voip_cntx_p->call_list_info.processCId = -1;
  2258.     g_voip_cntx_p->call_list_info.processDId = -1;
  2259.     if (msgRsp->result == VOIP_OK)
  2260.     {
  2261.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  2262.         mmi_voip_go_back_screen_check();
  2263.     }
  2264.     else
  2265.     {
  2266.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  2267.         mmi_voip_entry_popup((U8*)GetString(STR_ID_VOIP_TRANSFER_FAIL), IMG_GLOBAL_UNFINISHED);
  2268.     #if 0
  2269. /* under construction !*/
  2270. /* under construction !*/
  2271. /* under construction !*/
  2272. /* under construction !*/
  2273. /* under construction !*/
  2274. /* under construction !*/
  2275.     #endif
  2276.         mmi_voip_go_back_screen_check();
  2277.     }
  2278. }
  2279. /*****************************************************************************
  2280.  * FUNCTION
  2281.  *  mmi_voip_dial_sos_req
  2282.  * DESCRIPTION
  2283.  *  Send dial SOS request to VoIP CC.
  2284.  * PARAMETERS
  2285.  *  void
  2286.  * RETURNS
  2287.  *  void
  2288.  *****************************************************************************/
  2289. void mmi_voip_dial_sos_req(void)
  2290. {
  2291.     /*----------------------------------------------------------------*/
  2292.     /* Local Variables                                                */
  2293.     /*----------------------------------------------------------------*/
  2294.     mmi_voip_call_act_req_struct *msgReq;
  2295.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2296.     /*----------------------------------------------------------------*/
  2297.     /* Code Body                                                      */
  2298.     /*----------------------------------------------------------------*/
  2299.     g_voip_cntx_p->call_list_info.processCId = 0;
  2300.     g_voip_cntx_p->call_list_info.processDId = 0;
  2301.     msgReq->op_code = VOIP_CALL_ACT_REL_ALL_AND_DIAL_EMERGENCY;
  2302.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2303. }
  2304. /*****************************************************************************
  2305.  * FUNCTION
  2306.  *  mmi_voip_dial_sos_rsp
  2307.  * DESCRIPTION
  2308.  *  Receive dial SOS response from VoIP CC.
  2309.  * PARAMETERS
  2310.  *  inMsg           [IN]        Message structure from voip cc
  2311.  * RETURNS
  2312.  *  void
  2313.  *****************************************************************************/
  2314. void mmi_voip_dial_sos_rsp(void *inMsg)
  2315. {
  2316.     /*----------------------------------------------------------------*/
  2317.     /* Local Variables                                                */
  2318.     /*----------------------------------------------------------------*/
  2319.     S32 callId = 0, dialogId = 0;
  2320.     mmi_voip_call_act_rsp_struct *msgRsp = (mmi_voip_call_act_rsp_struct*)inMsg;
  2321.     /*----------------------------------------------------------------*/
  2322.     /* Code Body                                                      */
  2323.     /*----------------------------------------------------------------*/
  2324.     callId = g_voip_cntx_p->call_list_info.processCId;
  2325.     dialogId = g_voip_cntx_p->call_list_info.processDId;
  2326.     g_voip_cntx_p->call_list_info.processCId = -1;
  2327.     g_voip_cntx_p->call_list_info.processDId = -1;
  2328.     if (msgRsp->result == VOIP_OK)
  2329.     {
  2330.         mmi_voip_stop_inbandtone();
  2331.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  2332.         mmi_voip_log_call_history(callId, dialogId, MMI_VOIP_MO_ORIGIN, TRUE);
  2333.         mmi_voip_go_back_screen_check();
  2334.     }
  2335.     else
  2336.     {
  2337.         mmi_voip_update_call_list(msgRsp->call_list, FALSE);
  2338.         mmi_voip_entry_popup((U8*)GetString(mmi_voip_get_error_cause(msgRsp->result, msgRsp->cause)), IMG_GLOBAL_UNFINISHED);
  2339.     #if 0
  2340. /* under construction !*/
  2341. /* under construction !*/
  2342. /* under construction !*/
  2343. /* under construction !*/
  2344. /* under construction !*/
  2345. /* under construction !*/
  2346.     #endif
  2347.         mmi_voip_go_back_screen_check();
  2348.     }
  2349. }
  2350. /*****************************************************************************
  2351.  * FUNCTION
  2352.  *  mmi_voip_hold_and_dial_req
  2353.  * DESCRIPTION
  2354.  *  Send hold and dial request to VoIP CC.
  2355.  * PARAMETERS
  2356.  *  callId      [IN]        Active call id that intends to hold
  2357.  * RETURNS
  2358.  *  void
  2359.  *****************************************************************************/
  2360. void mmi_voip_hold_and_dial_req(S32 callId)
  2361. {
  2362.     /*----------------------------------------------------------------*/
  2363.     /* Local Variables                                                */
  2364.     /*----------------------------------------------------------------*/
  2365.     mmi_voip_call_act_req_struct *msgReq;
  2366.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2367.     /*----------------------------------------------------------------*/
  2368.     /* Code Body                                                      */
  2369.     /*----------------------------------------------------------------*/
  2370.     /* not have dialing call id yet so set intended hold call id to voip cc
  2371.        in case of release call, release dialing call still */
  2372.     g_voip_cntx_p->call_list_info.processCId = callId;
  2373.     g_voip_cntx_p->call_list_info.processDId = VOIP_MAX_NUM_DIALOG;
  2374.     msgReq->op_code = VOIP_CALL_ACT_HOLD_AND_DIAL;
  2375.     msgReq->hold_call.call_id = callId;
  2376.     msgReq->hold_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  2377.     memcpy(msgReq->target_call, g_voip_cntx_p->call_misc_info.inputUri, VOIP_URI_LEN);
  2378.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2379. }
  2380. #if 0
  2381. /* under construction !*/
  2382. /* under construction !*/
  2383. /* under construction !*/
  2384. /* under construction !*/
  2385. /* under construction !*/
  2386. /* under construction !*/
  2387. /* under construction !*/
  2388. /* under construction !*/
  2389. /* under construction !*/
  2390. /* under construction !*/
  2391. /* under construction !*/
  2392. /* under construction !*/
  2393. /* under construction !*/
  2394. /* under construction !*/
  2395. /* under construction !*/
  2396. /* under construction !*/
  2397. /* under construction !*/
  2398. /* under construction !*/
  2399. /* under construction !*/
  2400. /* under construction !*/
  2401. /* under construction !*/
  2402. /* under construction !*/
  2403. /* under construction !*/
  2404. /* under construction !*/
  2405. /* under construction !*/
  2406. /* under construction !*/
  2407. /* under construction !*/
  2408. /* under construction !*/
  2409. /* under construction !*/
  2410. /* under construction !*/
  2411. /* under construction !*/
  2412. /* under construction !*/
  2413. /* under construction !*/
  2414. /* under construction !*/
  2415. /* under construction !*/
  2416. /* under construction !*/
  2417. /* under construction !*/
  2418.     #if 0        
  2419. /* under construction !*/
  2420. /* under construction !*/
  2421. /* under construction !*/
  2422. /* under construction !*/
  2423. /* under construction !*/
  2424. /* under construction !*/
  2425.     #endif
  2426. /* under construction !*/
  2427. /* under construction !*/
  2428. /* under construction !*/
  2429. #endif
  2430. /*****************************************************************************
  2431.  * FUNCTION
  2432.  *  mmi_voip_hold_and_accept_req
  2433.  * DESCRIPTION
  2434.  *  Send hold and accept request to VoIP CC.
  2435.  * PARAMETERS
  2436.  *  activecallId        [IN]        Active call id that intends to hold
  2437.  *  mtcallId            [IN]        Incoming call id that intends to accept
  2438.  * RETURNS
  2439.  *  void
  2440.  *****************************************************************************/
  2441. void mmi_voip_hold_and_accept_req(S32 activecallId, S32 mtcallId)
  2442. {
  2443.     /*----------------------------------------------------------------*/
  2444.     /* Local Variables                                                */
  2445.     /*----------------------------------------------------------------*/
  2446.     mmi_voip_call_act_req_struct *msgReq;
  2447.     msgReq = (mmi_voip_call_act_req_struct*)OslConstructDataPtr(sizeof(mmi_voip_call_act_req_struct));
  2448.     /*----------------------------------------------------------------*/
  2449.     /* Code Body                                                      */
  2450.     /*----------------------------------------------------------------*/
  2451.     /* in case of release call, release accepting call */
  2452.     g_voip_cntx_p->call_list_info.processCId = mtcallId;
  2453.     g_voip_cntx_p->call_list_info.processDId = 0;
  2454.     msgReq->op_code = VOIP_CALL_ACT_HOLD_AND_ACCEPT;
  2455.     msgReq->active_call.call_id = mtcallId;
  2456.     msgReq->active_call.dialog_id = 0;
  2457.     msgReq->hold_call.call_id = activecallId;
  2458.     msgReq->hold_call.dialog_id = VOIP_MAX_NUM_DIALOG;
  2459.     mmi_voip_send_message(MOD_MMI, MOD_VOIP, MSG_ID_MMI_VOIP_CALL_ACT_REQ, msgReq, NULL);
  2460. }
  2461. #if 0
  2462. /* under construction !*/
  2463. /* under construction !*/
  2464. /* under construction !*/
  2465. /* under construction !*/
  2466. /* under construction !*/
  2467. /* under construction !*/
  2468. /* under construction !*/
  2469. /* under construction !*/
  2470. /* under construction !*/
  2471. /* under construction !*/
  2472. /* under construction !*/
  2473. /* under construction !*/
  2474. /* under construction !*/
  2475. /* under construction !*/
  2476. /* under construction !*/
  2477. /* under construction !*/
  2478. /* under construction !*/
  2479. /* under construction !*/
  2480. /* under construction !*/
  2481. /* under construction !*/
  2482. /* under construction !*/
  2483. /* under construction !*/
  2484. /* under construction !*/
  2485. /* under construction !*/
  2486. /* under construction !*/
  2487. /* under construction !*/
  2488. /* under construction !*/
  2489. /* under construction !*/
  2490. /* under construction !*/
  2491. /* under construction !*/
  2492. /* under construction !*/
  2493. /* under construction !*/
  2494. /* under construction !*/
  2495. /* under construction !*/
  2496. /* under construction !*/
  2497. /* under construction !*/
  2498.     #if 0
  2499. /* under construction !*/
  2500. /* under construction !*/
  2501. /* under construction !*/
  2502. /* under construction !*/
  2503. /* under construction !*/
  2504. /* under construction !*/
  2505.     #endif
  2506. /* under construction !*/
  2507. /* under construction !*/
  2508. /* under construction !*/
  2509. #endif
  2510. #endif /* __MMI_VOIP__ */