VOS_VOID IMSA_ImsMsgUssdEvent(VOS_VOID *pUssdEvent)
{
    IMSA_IMS_OUTPUT_USSD_EVENT_STRU *pstOutUssd = VOS_NULL_PTR;

    pstOutUssd = (IMSA_IMS_OUTPUT_USSD_EVENT_STRU*)pUssdEvent;

    /*lint -e788*/
    switch (pstOutUssd->enOutputUssdReason)
    {
        case IMSA_IMS_OUTPUT_USSD_REASON_OK:
            IMSA_ProcImsMsgUssdReasonOk(pstOutUssd);
            break;
        case IMSA_IMS_OUTPUT_USSD_REASON_NOTIFY_EVENT:
            IMSA_ProcImsMsgUssdReasonNotify(pstOutUssd);
            break;
        case IMSA_IMS_OUTPUT_USSD_REASON_REQUEST_EVENT:
            IMSA_ProcImsMsgUssdReasonRequest(pstOutUssd);
            break;
        case IMSA_IMS_OUTPUT_USSD_REASON_DISCONNECT_EVENT:
            IMSA_ProcImsMsgUssdReasonDisconnect(pstOutUssd);
            break;
        case IMSA_IMS_OUTPUT_USSD_REASON_ERROR:
            IMSA_ProcImsMsgUssdReasonError(pstOutUssd);
            break;
        default:
            IMSA_INFO_LOG("IMSA_ImsMsgParaEvent: reason is err");
            break;

    }/*lint +e788*/
}
/*****************************************************************************
 Function Name  : IMSA_IntraMsgDistr()
 Description    : IMSA自己发给自己的消息分发函数
 Input          : VOS_VOID *pRcvMsg
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-20  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_IntraMsgDistr(const VOS_VOID *pRcvMsg )
{
    PS_MSG_HEADER_STRU                 *pstImsaIntraMsg = VOS_NULL_PTR;

    /*打印进入该函数*/
    IMSA_INFO_LOG("IMSA_IntraMsgDistr is entered.");

    pstImsaIntraMsg = (PS_MSG_HEADER_STRU*)pRcvMsg;

    switch (pstImsaIntraMsg->ulMsgName)
    {
        /* CONN模块处理的相关消息 */
        case ID_IMSA_CONN_SETUP_REQ:
            IMSA_CONN_ProcConnSetupReq((IMSA_CONN_SETUP_REQ_STRU*)pRcvMsg);
            break;
        case ID_IMSA_CONN_REL_REQ:
            IMSA_CONN_ProcConnRelReq((IMSA_CONN_REL_REQ_STRU*)pRcvMsg);
            break;

        /* SERVICES模块处理的相关消息 */
        case ID_IMSA_REG_REG_IND:
            IMSA_SRV_ProcRegRegIndMsg((IMSA_REG_REG_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_REG_DEREG_IND:
            IMSA_SRV_ProcRegDeregIndMsg((IMSA_REG_DEREG_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CONN_SETUP_IND:
            IMSA_SRV_ProcConnSetupIndMsg((IMSA_CONN_SETUP_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CONN_REL_IND:
            IMSA_SRV_ProcConnRelIndMsg((IMSA_CONN_REL_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CONN_MODIFY_IND:
            IMSA_SRV_ProcConnModifyIndMsg((IMSA_CONN_MODIFY_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CALL_RESULT_ACTION_IND:
            IMSA_SRV_ProcCallRsltActionIndMsg((IMSA_CALL_RESULT_ACTION_IND_STRU *)pRcvMsg);
            break;

        /* 注册模块处理的相关消息 */
        case ID_IMSA_REG_REG_REQ:
            (VOS_VOID)IMSA_RegProcUserRegReqMsg(pRcvMsg);
            break;
        case ID_IMSA_REG_DEREG_REQ:
            (VOS_VOID)IMSA_RegProcUserDeregReqMsg(pRcvMsg);
            break;

        /* 呼叫模块处理的相关消息 */
        case ID_IMSA_NRM_CALL_SRV_STATUS_IND:
            (VOS_VOID)IMSA_CallProcIntraMsgNrmCallSrvStatus(pRcvMsg);
            break;
        case ID_IMSA_EMC_CALL_SRV_STATUS_IND:
            (VOS_VOID)IMSA_CallProcIntraMsgEmcCallSrvStatus(pRcvMsg);
            break;

        default:
            IMSA_WARN_LOG("IMSA_IntraMsgDistr:Illegal Msg id!");
            break;
    }
}
/*****************************************************************************
 Function Name  : IMSA_SndMmaMsgStopCnf()
 Description    : 给MMA发送开机回复消息
 Input          : VOS_VOID
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-21  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_SndMmaMsgStopCnf(VOS_VOID  )
{
    IMSA_MMA_STOP_CNF_STRU           *pstImsaMmaStopCnf;

    IMSA_INFO_LOG("IMSA_SndMmaMsgStopCnf:enter!");

    /*分配空间并检验分配是否成功*/
    pstImsaMmaStopCnf = (VOS_VOID*)IMSA_ALLOC_MSG(sizeof(IMSA_MMA_STOP_CNF_STRU));

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstImsaMmaStopCnf)
    {
        /*打印异常信息*/
        IMSA_ERR_LOG("IMSA_SndMmaMsgStopCnf:ERROR:Alloc Msg fail!");
        return ;
    }

    /*清空*/
    IMSA_MEM_SET( IMSA_GET_MSG_ENTITY(pstImsaMmaStopCnf), 0, IMSA_GET_MSG_LENGTH(pstImsaMmaStopCnf));

    /*填写消息头*/
    IMSA_WRITE_MMA_MSG_HEAD(pstImsaMmaStopCnf, ID_IMSA_MMA_STOP_CNF);

    /*调用消息发送函数 */
    IMSA_SND_MSG(pstImsaMmaStopCnf);
}
/*****************************************************************************
 Function Name  : IMSA_D2ImsMsgSmsEvent()
 Description    : D2IMS短信类型的事件处理函数
 Input          : VOS_VOID *pRcvMsg
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-21  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_ImsMsgSmsEvent(VOS_VOID *pSmsEvent)
{
    IMSA_IMS_OUTPUT_SMS_EVENT_STRU       *pstOutSms;

    pstOutSms = (IMSA_IMS_OUTPUT_SMS_EVENT_STRU*)pSmsEvent;

    if(IMSA_IMS_OUTPUT_SMS_REASON_SMS_RECEIVED == pstOutSms->enOutputSmsReason)
    {
        IMSA_SMS_ProcNwSmsReceived(pstOutSms);
    }
    /*发送消息回复*/
    else if(IMSA_IMS_OUTPUT_SMS_REASON_OK == pstOutSms->enOutputSmsReason)
    {
        IMSA_INFO_LOG("IMSA_ImsMsgSmsEvent: Receive OK!");
    }
    /*错误处理*/
    else if(IMSA_IMS_OUTPUT_SMS_REASON_ERROR == pstOutSms->enOutputSmsReason)
    {
        IMSA_SMS_ProcNwSmsErr(pstOutSms);
    }
    else
    {
    }

}
VOS_VOID IMSA_ProcImsMsgUssdReasonNotify(const IMSA_IMS_OUTPUT_USSD_EVENT_STRU *pstOutUssdEvt)
{
    IMSA_USSD_MANAGER_STRU              *pstUssdManager;
    TAF_SS_USSD_STRING_STRU             stUssdString = {0};

    IMSA_INFO_LOG("IMSA_ProcImsMsgUssdReasonNotify is entered");

    pstUssdManager = IMSA_USSD_GetEntityAddress();

    if (IMSA_USSD_MT_CONN_STATE == pstUssdManager->enUssdState)
    {
        IMSA_INFO_LOG("IMSA_ProcImsMsgUssdReasonNotify:state is err");
        return;
    }

    stUssdString.usCnt = pstOutUssdEvt->usMessageLen;
    IMSA_MEM_CPY(                   stUssdString.aucUssdStr,
                                    pstOutUssdEvt->aucMessage,
                                    pstOutUssdEvt->usMessageLen);

    if (IMSA_USSD_MO_CONN_STATE == pstUssdManager->enUssdState)
    {
        /*停止等待网侧响应定时器*/
        IMSA_StopTimer(&(pstUssdManager->stUssdWaitNetRspTimer));

        (VOS_VOID)IMSA_SendSpmUssdNotifyIndEvt(  pstUssdManager->usClientId,
                                    pstUssdManager->ucOpId,
                                    pstOutUssdEvt->encType,
                                    &stUssdString);
    }
    else
    {
        /*USSD在状态IMSA_USSD_IDLE_STATE的处理*/
        /*网侧主动触发流程*/
        (VOS_VOID)IMSA_SendSpmUssdNotifyIndEvt(  0x3fff,
                                        0,
                                    pstOutUssdEvt->encType,
                                    &stUssdString);
    }


    /*启动等待APP响应定时器*/
    IMSA_StartTimer(&(pstUssdManager->stUssdWaitAppRspTimer));
    pstUssdManager->enUssdState = IMSA_USSD_MT_CONN_STATE;
    return;
}
VOS_VOID IMSA_ProcImsMsgUssdReasonError(const IMSA_IMS_OUTPUT_USSD_EVENT_STRU *pstOutUssdEvt)
{
    IMSA_USSD_MANAGER_STRU              *pstUssdManager;

    IMSA_INFO_LOG("IMSA_ProcImsMsgUssdReasonError is entered");

    pstUssdManager = IMSA_USSD_GetEntityAddress();

    if (IMSA_USSD_MO_CONN_STATE != pstUssdManager->enUssdState)
    {
        IMSA_INFO_LOG("IMSA_ProcImsMsgUssdReasonError: state is err");
        return;
    }

    /*停止等待网侧响应定时器*/
    IMSA_StopTimer(&(pstUssdManager->stUssdWaitNetRspTimer));

    /*IMS本地导致的错误等确认后更新*/
    if ((300 > pstOutUssdEvt->stErrorCode.usSipStatusCode) || (699 < pstOutUssdEvt->stErrorCode.usSipStatusCode))
    {
        /*IMS本地导致的失败*/
        (VOS_VOID)IMSA_SendSpmUssdErrorEvt(  pstUssdManager->usClientId,
                                    pstUssdManager->ucOpId,
                                    pstOutUssdEvt->stErrorCode.usSipStatusCode + TAF_ERR_SS_IMSA_BASE);
    }
    else
    {
        /*网侧导致的失败*/
        /*(VOS_VOID)IMSA_SendSpmUssdReqCnfEvt(   pstUssdManager->usClientId,
                                    pstUssdManager->ucOpId,
                                    (VOS_UINT8)pstOutUssdEvt->stErrorCode.usSipStatusCode);*/
        (VOS_VOID)IMSA_SendSpmUssdErrorEvt(  pstUssdManager->usClientId,
                                    pstUssdManager->ucOpId,
                                    pstOutUssdEvt->stErrorCode.usSipStatusCode + TAF_ERR_SS_IMS_BASE);
    }

    pstUssdManager->enUssdState = IMSA_USSD_IDLE_STATE;

    return;
}
VOS_VOID IMSA_ProcImsMsgUssdReasonDisconnect(IMSA_IMS_OUTPUT_USSD_EVENT_STRU *pstOutUssdEvt)
{
    IMSA_USSD_MANAGER_STRU              *pstUssdManager;

    IMSA_INFO_LOG("IMSA_ProcImsMsgUssdReasonDisconnect is entered");

    pstUssdManager = IMSA_USSD_GetEntityAddress();
    (void)pstOutUssdEvt;

    if (IMSA_USSD_IDLE_STATE == pstUssdManager->enUssdState)
    {
        IMSA_INFO_LOG("IMSA_ProcImsMsgUssdReasonDisconnect:state is err");
        return;
    }

    if (IMSA_USSD_MO_CONN_STATE == pstUssdManager->enUssdState)
    {
        /*停止等待网侧响应定时器*/
        IMSA_StopTimer(&(pstUssdManager->stUssdWaitNetRspTimer));

        (VOS_VOID)IMSA_SendSpmUssdRelCompleteIndEvt(  pstUssdManager->usClientId,
                                    pstUssdManager->ucOpId);

    }
    else
    {
        /*USSD在状态IMSA_USSD_MT_CONN_STATE的处理*/
        /*停止等待APP响应定时器*/
        IMSA_StopTimer(&(pstUssdManager->stUssdWaitAppRspTimer));

        (VOS_VOID)IMSA_SendSpmUssdRelCompleteIndEvt( 0x3fff,
                                    0);
    }

    pstUssdManager->enUssdState = IMSA_USSD_IDLE_STATE;

    return;
}
/*****************************************************************************
 Function Name  : IMSA_ImsMsgServiceEvent()
 Description    : D2IMS服务类型的事件处理函数
 Input          : VOS_VOID *pRcvMsg
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-20  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_ImsMsgServiceEvent(VOS_VOID *pSeriveEvent)
{
    IMSA_IMS_OUTPUT_SERVICE_EVENT_STRU *pstOutSerive = VOS_NULL_PTR;

    pstOutSerive = (IMSA_IMS_OUTPUT_SERVICE_EVENT_STRU*)pSeriveEvent;

    /* 注册相关消息处理 */
    /*lint -e788*/
    switch (pstOutSerive->enOutputServiceReason)
    {
    case IMSA_IMS_OUTPUT_SEVICE_REASON_STATE:
        (VOS_VOID)IMSA_RegProcImsMsgState(pstOutSerive);
        break;

    case IMSA_IMS_OUTPUT_SEVICE_REASON_AUTH_CHALLENGE:
        IMSA_RegProcImsMsgAuth(pstOutSerive);
        break;

    case IMSA_IMS_OUTPUT_SEVICE_REASON_IPSEC_RELEASE:
        IMSA_INFO_LOG("IMSA_ImsMsgServiceEvent: IPSEC_RELEASE.");
        break;

    case IMSA_IMS_OUTPUT_SEVICE_REASON_IPSEC_SETUP:
        IMSA_INFO_LOG("IMSA_ImsMsgServiceEvent: IPSEC_SETUP.");
        break;

    case IMSA_IMS_OUTPUT_SEVICE_REASON_OK:
        IMSA_INFO_LOG("IMSA_ImsMsgServiceEvent: REASON_OK.");
        break;


    default:
        IMSA_WARN_LOG("IMSA_ImsMsgServiceEvent: err sevice reason!");
        break;
    }/*lint +e788*/


}
/*****************************************************************************
 Function Name  : IMSA_ProcMmaMsgStartReq()
 Description    : MMA开机消息处理函数
 Input          : VOS_VOID *pRcvMsg
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-21  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_ProcMmaMsgStartReq(VOS_VOID  )
{
    IMSA_CONTROL_MANAGER_STRU  *pstControlManager;
    static VOS_UINT8            ucD2ImsTaskStart = 0;

    pstControlManager = IMSA_GetControlManagerAddress();

    if(ucD2ImsTaskStart == 0)
    {
        /*初始化D2协议栈*/
        (VOS_VOID)IMSA_ImsInit();

        ucD2ImsTaskStart ++;
    }

    /*判断开机状态,如果已开机,则回复开机成功*/
    if(pstControlManager->enImsaStatus == IMSA_STATUS_STARTED)
    {
        IMSA_SndMmaMsgStartCnf();
        return;
    }

    /*已处于开机过程状态,则丢弃*/
    if(pstControlManager->enImsaStatus == IMSA_STATUS_STARTING)
    {
        IMSA_WARN_LOG("IMSA_ProcMmaMsgStartReq: Status is Starting!");
        return;
    }

    IMSA_StopTimer(&pstControlManager->stProtectTimer);

    /*初始化*/

    /*读取NV*/
    IMSA_ReadImsaNV();

    /*通知IMS开机,转状态*/
    pstControlManager->enImsaStatus = IMSA_STATUS_STARTING;

    IMSA_SndImsMsgStartReq();

    IMSA_StartTimer(&pstControlManager->stProtectTimer);

    /*卡在位,则读取卡信息*/
    if(pstControlManager->enImsaIsimStatus == IMSA_ISIM_STATUS_AVAILABLE)
    {
        IMSA_INFO_LOG("IMSA_ProcMmaMsgStartReq: ISIM is available!");
        IMSA_ReadIsimFile();
    }
}
VOS_VOID IMSA_ProcImsMsgUssdReasonOk(IMSA_IMS_OUTPUT_USSD_EVENT_STRU *pstOutUssdEvt)
{
    IMSA_USSD_MANAGER_STRU              *pstUssdManager;

    IMSA_INFO_LOG("IMSA_ProcImsMsgUssdReasonOk is entered");

    (void)pstOutUssdEvt;
    pstUssdManager = IMSA_USSD_GetEntityAddress();

    if (IMSA_USSD_MO_CONN_STATE == pstUssdManager->enUssdState)
    {

       (VOS_VOID)IMSA_SendSpmUssdDataSndEvt(pstUssdManager->usClientId,
                                    pstUssdManager->ucOpId);
    }
    return;
}
示例#11
0
/*****************************************************************************
 Function Name  : IMSA_ProcMmaMsgStopReq()
 Description    : MMA关机消息处理函数
 Input          : VOS_VOID
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-21  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_ProcMmaMsgStopReq(VOS_VOID  )
{
    IMSA_CONTROL_MANAGER_STRU *pstControlManager;

    IMSA_INFO_LOG("IMSA_ProcMmaMsgStopReq: enter!");

    pstControlManager = IMSA_GetControlManagerAddress();

    /* SRVCC异常(例如关机,DEREG REQ,状态迁离CONN+REG),清缓存 */
    IMSA_SrvccAbormalClearBuff(IMSA_SRVCC_ABNORMAL_STOP_REQ);

    /*判断状态,如果已关机,则回复关机成功*/
    if(pstControlManager->enImsaStatus == IMSA_STATUS_NULL)
    {
        IMSA_SndMmaMsgStopCnf();
        return;
    }

    /*已处于关机状态,则丢弃*/
    if(pstControlManager->enImsaStatus == IMSA_STATUS_STOPING)
    {
        IMSA_WARN_LOG("IMSA_ProcMmaMsgStopReq: Status is Stoping!");
        return;
    }

    /*停止开关机保护定时器*/
    IMSA_StopTimer(&pstControlManager->stProtectTimer);

    /*通知IMS关机,转状态*/
    pstControlManager->enImsaStatus = IMSA_STATUS_STOPING;

    /*关机后,卡在位时,需要将卡状态置为有效,因为可能有卡无效的场景,需要关机后清除状态*/
    if(pstControlManager->enImsaIsimStatus != IMSA_ISIM_STATUS_ABSENT)
    {
        pstControlManager->enImsaIsimStatus = IMSA_ISIM_STATUS_AVAILABLE;
    }

    IMSA_SndImsMsgStopReq();

    /*启动开关机保护定时器*/
    IMSA_StartTimer(&pstControlManager->stProtectTimer);
}
示例#12
0
/*****************************************************************************
 Function Name  : IMSA_IntraMsgDistr()
 Description    : IMSA自己发给自己的消息分发函数
 Input          : VOS_VOID *pRcvMsg
 Output         : VOS_VOID
 Return Value   : VOS_VOID

 History        :
      1.sunbing 49683      2013-06-20  Draft Enact
*****************************************************************************/
VOS_VOID IMSA_IntraMsgDistr(const VOS_VOID *pRcvMsg )
{
    PS_MSG_HEADER_STRU                 *pstImsaIntraMsg = VOS_NULL_PTR;
    IMSA_CONTROL_MANAGER_STRU          *pstControlManager = IMSA_GetControlManagerAddress();

    /*打印进入该函数*/
    IMSA_INFO_LOG("IMSA_IntraMsgDistr is entered.");

    /* 关机过程中收到IMSA的内部消息,直接丢弃 */
    if(IMSA_STATUS_STOPING == pstControlManager->enImsaStatus)
    {
        IMSA_WARN_LOG("IMSA_IntraMsgDistr: Status is Stoping!");
        return;
    }

    pstImsaIntraMsg = (PS_MSG_HEADER_STRU*)pRcvMsg;

    switch (pstImsaIntraMsg->ulMsgName)
    {
        /* CONN模块处理的相关消息 */
        case ID_IMSA_CONN_SETUP_REQ:
            IMSA_CONN_ProcConnSetupReq((IMSA_CONN_SETUP_REQ_STRU*)pRcvMsg);
            break;
        case ID_IMSA_CONN_REL_REQ:
            IMSA_CONN_ProcConnRelReq((IMSA_CONN_REL_REQ_STRU*)pRcvMsg);
            break;

        /* SERVICES模块处理的相关消息 */
        case ID_IMSA_REG_REG_IND:
            IMSA_SRV_ProcRegRegIndMsg((IMSA_REG_REG_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_REG_DEREG_IND:
            IMSA_SRV_ProcRegDeregIndMsg((IMSA_REG_DEREG_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CONN_SETUP_IND:
            IMSA_SRV_ProcConnSetupIndMsg((IMSA_CONN_SETUP_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CONN_REL_IND:
            IMSA_SRV_ProcConnRelIndMsg((IMSA_CONN_REL_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CONN_MODIFY_IND:
            IMSA_SRV_ProcConnModifyIndMsg((IMSA_CONN_MODIFY_IND_STRU *)pRcvMsg);
            break;
        case ID_IMSA_CALL_RESULT_ACTION_IND:
            IMSA_SRV_ProcCallRsltActionIndMsg((IMSA_CALL_RESULT_ACTION_IND_STRU *)pRcvMsg);
            break;

        /* 注册模块处理的相关消息 */
        case ID_IMSA_REG_REG_REQ:
            (VOS_VOID)IMSA_RegProcUserRegReqMsg(pRcvMsg);
            break;
        case ID_IMSA_REG_DEREG_REQ:
            (VOS_VOID)IMSA_RegProcUserDeregReqMsg(pRcvMsg);
            break;

        /* 呼叫模块处理的相关消息 */
        case ID_IMSA_NRM_CALL_SRV_STATUS_IND:
            (VOS_VOID)IMSA_CallProcIntraMsgNrmCallSrvStatus(pRcvMsg);
            break;
        case ID_IMSA_EMC_CALL_SRV_STATUS_IND:
            (VOS_VOID)IMSA_CallProcIntraMsgEmcCallSrvStatus(pRcvMsg);
            break;

        default:
            IMSA_WARN_LOG("IMSA_IntraMsgDistr:Illegal Msg id!");
            break;
    }
}