Ejemplo n.º 1
0
VMINT vm_ivr_call(vm_ivr_call_data* data)
{   
    VMINT result = 0;
    srv_ucm_dial_act_req_struct req;

    memset(&req, 0, sizeof(req));
    if (data->sim_card > vm_sim_max_card_count() || data->sim_card < 1)
    {
        result = -2;
        goto error;
    }

	if (srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_ALL, NULL) > 0)
	{
	    result = -3;
        goto error;
	}
	
    if ((vm_res_save_data(VM_RES_TYPE_IVR, data->user_data, 4, (void*)data->callback, vm_pmng_get_current_handle())) < 0)
	{
		result = -4;
        goto error;
	}
	req.call_type = 1<< ((data->sim_card-1)*8);
	kal_wstrncpy(req.num_uri,data->phone_num,SRV_UCM_MAX_NUM_URI_LEN+1);
	req.module_id = SRV_UCM_MODULE_ORIGIN_COMMON;
	req.is_ip_dial = 0;
	req.phb_data = NULL;
	
	srv_ucm_act_request(SRV_UCM_DIAL_ACT,&req,NULL,_vm_ivr_call_callback);
error:
    MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"vm_ivr_call %d,%d",result,data->sim_card);
    return result;
}
Ejemplo n.º 2
0
S32 CALLCC UcmService::query_call_count(gs_srv_ucm_call_state_enum call_state, gs_srv_ucm_call_type_enum call_type, 
                                                    gs_srv_ucm_index_info_struct *index_list)
{
    //MMI_PRINT(MOD_MRE, TRACE_GROUP_1, "[MRE] UcmService::query_call_count");
    return srv_ucm_query_call_count((srv_ucm_call_state_enum)call_state,(srv_ucm_call_type_enum)call_type,
                                     (srv_ucm_index_info_struct*)index_list);
}
Ejemplo n.º 3
0
/*****************************************************************************
 * FUNCTION
 *  mmi_rmgr_format_notify_timeout_hdlr
 * DESCRIPTION
 *  Post formatting notification handler
 * PARAMETERS
 *  void
 *  para(?)             [IN]        Additional parameter
 *  notify_flag(?)      [IN]        MMI_FMGR_NOTIFY_DRV_POST_FORMAT
 * RETURNS
 *  MMI_BOOL: always return true
 *****************************************************************************/
void mmi_rmgr_format_notify_timeout_hdlr(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MMI_BOOL block_screen = MMI_FALSE;
     mmi_id g_id;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

#ifdef __MMI_UCM__
    if (srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_NO_CSD, NULL) > 0)
    {
        block_screen = MMI_TRUE;

    #ifdef __MMI_BACKGROUND_CALL__
        if (srv_ucm_is_background_call())
        {
            block_screen = MMI_FALSE;
        }
    #endif /* __MMI_BACKGROUND_CALL__ */ 
    }

    if (block_screen)
    {
        return;
    }
#endif /* __MMI_UCM__ */ 

   
   mmi_frm_nmgr_notify_by_app(MMI_SCENARIO_ID_DEFAULT, MMI_EVENT_NON_TONE, mmi_rmgr_format_popup_handler, NULL);
   //mmi_rmgr_list_ro_entry_delete();
}
Ejemplo n.º 4
0
static mmi_ret vm_callout_ucm_callback(mmi_event_struct * param)
{
	//srv_ucm_status_change_evt_struct *evt = (srv_ucm_status_change_evt_struct *)param;
	VMINT resid = -1;
	VM_CALLOUT_RESPONSE_T callout_callback;
	VMWSTR phonenum = NULL;
	VMINT size = 0;

	VMINT callcount = 0;

	callcount = srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_ALL, NULL);
	vm_log_debug("vm_callout_ucm_callback : callcount=%d", callcount);
	if (callcount > 0)
	{
		vm_callout_status = VM_CALLOUT_BUSY;
	}
	else
	{
		vm_callout_status = VM_CALLOUT_IDEL;
		
	}

	if ((resid = vm_res_findfirst(-1, VM_RES_TYPE_CALLOUT)) != VM_RES_NOT_FIND)
	{
		VM_P_HANDLE phandle = vm_res_get_process_handle(VM_RES_TYPE_CALLOUT, resid);
		vm_res_get_callback(VM_RES_TYPE_CALLOUT, resid, (void**)&callout_callback);
		vm_res_get_data(VM_RES_TYPE_CALLOUT, resid, (void**)&phonenum, &size);

		if (vm_pmng_set_ctx(phandle) == VM_PMNG_OP_OK)
		{
			if (callout_callback != NULL)
			{
				callout_callback(phonenum, vm_callout_status);
			}

			vm_pmng_reset_ctx();
		}

		if (vm_callout_status == VM_CALLOUT_IDEL)
		{
			vm_res_release_data(VM_RES_TYPE_CALLOUT, resid);
		}
		
		vm_res_findclose(VM_RES_TYPE_CALLOUT);
		
	}
	return MMI_RET_OK;
}
Ejemplo n.º 5
0
static void vm_callout_initial(void)
{
	VMINT callcount = 0;

	callcount = srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_ALL, NULL);	
	
	if (callcount > 0)
	{
		vm_callout_status = VM_CALLOUT_BUSY;
	}
	else
	{
		vm_callout_status = VM_CALLOUT_IDEL;
	}
	
	mmi_frm_cb_reg_event(EVT_ID_SRV_UCM_STATUS_CHANGE, vm_callout_ucm_callback, NULL);

	vm_res_type_set_notify_callback(VM_RES_TYPE_CALLOUT, vm_callout_process_state_pro);	
	vm_res_type_set_notify_callback(VM_RES_TYPE_IVR, vm_callout_process_state_pro);	
}
Ejemplo n.º 6
0
static void vm_callout_finialize(void)
{
	VMINT callcount = 0;

	vm_res_type_set_notify_callback(VM_RES_TYPE_CALLOUT, NULL);

	mmi_frm_cb_dereg_event(EVT_ID_SRV_UCM_STATUS_CHANGE, vm_callout_ucm_callback, NULL);
	
	callcount = srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_ALL, NULL);	

	if (callcount > 0)
	{
		vm_callout_status = VM_CALLOUT_BUSY;
	}
	else
	{
		vm_callout_status = VM_CALLOUT_IDEL;
	}

	vm_log_debug("vm_callout_finialize : callcount=%d, status=%d", callcount, vm_callout_status);
}
Ejemplo n.º 7
0
/*****************************************************************************
 * FUNCTION
 *  srv_ctm_speech_on_hdlr
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void srv_ctm_speech_on_hdlr(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/    

    if (srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_VOICE_CALL_TYPE_ALL, NULL) != 1)
    {
        return; 
    }

    if ((srv_ctm_p->state == SRV_CTM_STATE_IDLE)
        || (srv_ctm_p->state == SRV_CTM_STATE_CLOSING))
    {
        srv_ctm_open(MMI_TRUE);
    }

}
Ejemplo n.º 8
0
/*****************************************************************************
 * FUNCTION
 *  srv_ctm_switch_tty_status
 * DESCRIPTION
 *  
 * PARAMETERS
 *  is_present      [IN]        
 *  void(?)         [IN]        *
 * RETURNS
 *  void
 *****************************************************************************/
void srv_ctm_switch_tty_status(MMI_BOOL switch_on)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 mode, setting;
    S32 call_count;
    srv_ctm_tty_device_status_struct evt;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    call_count = srv_ucm_query_call_count(SRV_UCM_CALL_STATE_CONNECTED, SRV_UCM_VOICE_CALL_TYPE_ALL, NULL);

    setting = srv_callset_ctm_get_setting();

    MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_SRV_CTM_SWITCH_TTY_STATUS, srv_ctm_p->state, 
        srv_ctm_p->mode_activated, setting);

    if (switch_on)
    {
        if (srv_callset_ctm_get_mode())
        {
            /* CTM on, take as TTY */
            srv_ctm_p->tty_status = MMI_TRUE;
            if ((srv_ctm_p->state != SRV_CTM_STATE_IDLE &&
                    srv_ctm_p->mode_activated == AUD_CTM_DIRECT_MODE)
                || (srv_ctm_p->state == SRV_CTM_STATE_IDLE && call_count >= 1))
            {
                /* plug in, open again */
                if (srv_ctm_p->state != SRV_CTM_STATE_IDLE)
                {
                    srv_ctm_p->state = SRV_CTM_STATE_CLOSING;
                    srv_ctm_med_close_req();
                }

                mode = srv_ctm_derive_mode();

                if (mode != 0xff)
                {
                    srv_ctm_p->state = SRV_CTM_STATE_OPENING;
                    srv_ctm_p->mode_opening = mode;
                    srv_ctm_med_open_req(mode);
                }
            }

            evt.is_plug_in = MMI_TRUE;
            srv_ctm_send_ind(SRV_CTM_IND_TTY_DEVICE_STATUS, &evt);

            if (!srv_ctm_p->ctm_call_mode)
            {
                srv_ctm_p->ctm_call_mode = MMI_TRUE;
                srv_ctm_l4c_set_ctm_status_req(MMI_TRUE);
            }

        }
        else
        {
            /* CTM off, take as headset */
            srv_ctm_p->tty_status = MMI_FALSE;
        }
    }
    else
    {
        srv_ctm_p->tty_status = MMI_FALSE;
        if (srv_callset_ctm_get_mode())
        {
            /* CTM on, TTY to direct */
            if (srv_ctm_p->state != SRV_CTM_STATE_IDLE)
            {
                srv_ctm_p->state = SRV_CTM_STATE_CLOSING;
                srv_ctm_med_close_req();
            }

            if (((setting == SRV_CALLSET_CTM_SETTING_AUTO_DIRECT
                        || setting == SRV_CALLSET_CTM_SETTING_MANUAL_DIRECT)
                    && (srv_ctm_p->mode_activated != AUD_CTM_DIRECT_MODE
                        || srv_ctm_p->state == SRV_CTM_STATE_CLOSING))
                || (srv_ctm_p->state == SRV_CTM_STATE_IDLE && call_count >= 1))
            {
                /* plug out, open again */
                srv_ctm_p->state = SRV_CTM_STATE_OPENING;
                srv_ctm_p->mode_opening = AUD_CTM_DIRECT_MODE;
                srv_ctm_med_open_req(AUD_CTM_DIRECT_MODE);
            }

            evt.is_plug_in = MMI_FALSE;
            srv_ctm_send_ind(SRV_CTM_IND_TTY_DEVICE_STATUS, &evt);

            if (srv_callset_ctm_is_tty_on())
            {
                srv_ctm_p->ctm_call_mode = MMI_FALSE;
                srv_ctm_l4c_set_ctm_status_req(MMI_FALSE);
            }

        }
        else
        {
            /* CTM off, do nothing */
        }
    }
}
Ejemplo n.º 9
0
mmi_ret vm_ivr_handler(mmi_event_struct *param)
{
    mmi_ret result = MMI_RET_OK;
    ivr_callback_data data;
    srv_ucm_act_rsp_struct* rsp = (srv_ucm_act_rsp_struct*)param->user_data;
    VMINT resid = -1;

    data.status = VM_IVR_CALLED_OUT;
    MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"vm_ivr_handler1 %d", param->evt_id);
    if ((resid = vm_res_findfirst(-1, VM_RES_TYPE_IVR)) != VM_RES_NOT_FIND)
	{	    
        VM_P_HANDLE phandle = vm_res_get_process_handle(VM_RES_TYPE_IVR, resid);
        void* user_data;
        VMINT size = 4;
        vm_ivr_cb callback;        

        MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"vm_ivr_handler");
        
        vm_res_get_callback(VM_RES_TYPE_IVR, resid, (void**)&callback);
        vm_res_get_data(VM_RES_TYPE_IVR, resid, (void**)&user_data, &size);
        data.user_data = user_data;
        
	    if (EVT_ID_SRV_UCM_STATUS_CHANGE == param->evt_id)
        {                
            if (srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_ALL, NULL) == 0)
        	{
                MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"1");
                data.status = VM_IVR_CALL_END;
        		if (vm_pmng_set_ctx(phandle) == VM_PMNG_OP_OK)
        		{
        			if (callback != NULL)
        			{
        				callback(&data);
        			}

        			vm_pmng_reset_ctx();
        		}
        		vm_res_release_data(VM_RES_TYPE_IVR, resid);
        		MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"2");
        	}
        	else
        	{
        	    MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"3");
        	    data.status = VM_IVR_CALLED_OUT;
        	    if (vm_pmng_set_ctx(phandle) == VM_PMNG_OP_OK)
        		{
        			if (callback != NULL)
        			{
        				callback(&data);
        			}

        			vm_pmng_reset_ctx();
        		}
        		MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"4");
        	}
        	result = MMI_RET_ERR;
        }
        else if (EVT_ID_SRV_UCM_INDICATION == param->evt_id)
        {
            srv_ucm_ind_evt_struct* evt_struct = (srv_ucm_ind_evt_struct*)param;
            
            if (SRV_UCM_OUTGOING_CALL_IND == evt_struct->ind_type)
            {                
                srv_ucm_outgoing_call_ind_struct* info = (srv_ucm_outgoing_call_ind_struct*)evt_struct->ptr;
                memcpy(&g_vm_ivr_call_info,&info->uid_info,sizeof(g_vm_ivr_call_info));
                MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"vm_ivr_handler%d,%d",g_vm_ivr_call_info.group_id,g_vm_ivr_call_info.call_id);

                result = MMI_RET_ERR;
            }            
            else if (SRV_UCM_INCOMING_CALL_IND == evt_struct->ind_type)
            {    
                srv_ucm_single_call_act_req_struct req;
                
                MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"6");
                data.status = VM_IVR_INTERRUPT;
        		if (vm_pmng_set_ctx(phandle) == VM_PMNG_OP_OK)
        		{
        			if (callback != NULL)
        			{
        				callback(&data);
        			}

        			vm_pmng_reset_ctx();
        		}       

                memcpy(&g_vm_ivr_incoming_data,evt_struct->ptr,sizeof(g_vm_ivr_incoming_data));
                vm_res_release_data(VM_RES_TYPE_IVR, resid);
                
        		StartTimer(0xefda,100,_vm_ivr_handler_timer_cb);
#if 0        		
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif                
        		MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"7");
        		result = MMI_RET_ERR;
            }
            else
            {
                 MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"8");
                result = MMI_RET_ERR;
            }
            
        }
        else if (EVT_ID_SRV_UCM_ACTION_NOTIFY == param->evt_id)
        {
            MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"9");
            result = MMI_RET_ERR;
        }	
        vm_res_findclose(VM_RES_TYPE_IVR);
	}
	MMI_PRINT(MOD_MRE,TRACE_GROUP_9,"vm_ivr_handler end %d,%d",result,data.status);
	return result;    
}