VOS_VOID IMSA_SMS_ProcNwSmsRpError(const IMSA_IMS_OUTPUT_SMS_EVENT_STRU *pstOutSms) { IMSA_SMS_SMR_MO_STRU *pstSmrMoEntity; IMSA_WARN_LOG("IMSA_SMS_ProcNwSmsRpError: enter."); pstSmrMoEntity = IMSA_SMS_GetSmrMoEntityAddress(); if(IMSA_SMS_SMR_STATE_WAIT_FOR_RP_ACK != pstSmrMoEntity->enState) { IMSA_WARN_LOG("IMSA_SMS_ProcNwSmsReceived: Mo entity is not WAIT_FOR_RP_ACK!"); return; } if(pstOutSms->aucMessage[1] != pstSmrMoEntity->ucMessageReference) { IMSA_WARN_LOG("IMSA_SMS_ProcNwReportReceived: MR is not equel."); return; } /*MO实体状态进行空闲态,停止TI_IMSA_SMS_TR1M保护定时器*/ pstSmrMoEntity->enState = IMSA_SMS_SMR_STATE_IDLE; IMSA_StopTimer(&pstSmrMoEntity->stTR1MTimer); if (IMSA_SMS_TRUE == pstSmrMoEntity->ucMemAvailFlg ) { /* 此过程是mem avail过程 */ /* 对错误原因值的处理,参考GU代码实现,在协议要求在#41时,重传RP-SMMA的基础上, 增加在原因值为#42,47,38时重传RP-SMMA */ if ((IMSA_SMR_ERR_CAUSE_TEMP_FAILURE == pstOutSms->aucMessage[IMSA_SMS_RP_ERROR_OFFSET]) || (IMSA_SMR_ERR_CAUSE_CONGESTION == pstOutSms->aucMessage[IMSA_SMS_RP_ERROR_OFFSET]) || (IMSA_SMR_ERR_CAUSE_RES_UNAVAIL == pstOutSms->aucMessage[IMSA_SMS_RP_ERROR_OFFSET]) || (IMSA_SMR_ERR_CAUSE_NET_OUT_OF_ORDER == pstOutSms->aucMessage[IMSA_SMS_RP_ERROR_OFFSET])) { /* 是temporary error */ IMSA_SMS_MemNotifyRetrans(SMR_SMT_ERROR_RP_ERROR_BEGIN|pstOutSms->aucMessage[IMSA_SMS_RP_ERROR_OFFSET]); /* 调用重发过程的处理 */ } else { /*错误码是RP ERR加上网络携带的错误码*/ IMSA_SMS_SndMsgReportInd(SMR_SMT_ERROR_RP_ERROR_BEGIN|pstOutSms->aucMessage[IMSA_SMS_RP_ERROR_OFFSET], (VOS_UINT8*)pstOutSms->aucMessage,\ pstOutSms->ucMessageLen); pstSmrMoEntity->ucMemAvailFlg = IMSA_SMS_FALSE; /* 清除mem avail标志 */ pstSmrMoEntity->ucRetransFlg = IMSA_SMR_RETRANS_PERMIT; /* 复位重发标志 */ pstSmrMoEntity->enState = IMSA_SMS_SMR_STATE_IDLE; /* 状态迁移到空闲状态 */ } } else { /*错误码是RP ERR加上网络携带的错误码*/ IMSA_SMS_SndMsgReportInd(SMR_SMT_ERROR_RP_ERROR_BEGIN|pstOutSms->aucMessage[IMSA_SMS_RP_ERROR_OFFSET], (VOS_UINT8*)pstOutSms->aucMessage,\ pstOutSms->ucMessageLen); } }
/***************************************************************************** Function Name : IMSA_VcMsgDistr() Description : HIFI消息处理函数 Input : VOS_VOID *pRcvMsg Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-07-22 Draft Enact *****************************************************************************/ VOS_VOID IMSA_VcMsgDistr(const VOS_VOID *pRcvMsg) { /* 定义消息头指针*/ PS_MSG_HEADER_STRU *pHeader = VOS_NULL_PTR; IMSA_CONTROL_MANAGER_STRU *pstControlManager = IMSA_GetControlManagerAddress(); /* 获取消息头指针*/ pHeader = (PS_MSG_HEADER_STRU *) pRcvMsg; /* 关机过程中收到HIFI的消息,直接丢弃 */ if(IMSA_STATUS_STOPING == pstControlManager->enImsaStatus) { IMSA_WARN_LOG("IMSA_VcMsgDistr: Status is Stoping!"); return; } switch(pHeader->ulMsgName) { /*HIFI异常*/ case ID_VC_IMSA_HIFI_EXCEPTION_NTF: IMSA_ProcHifiExceptionNtf((VOS_VOID *)pRcvMsg); break; default: break; } }
/***************************************************************************** Function Name : IMSA_RegProcImsMsgAuth() Description : IMS鉴权消息处理 Input : CSM_OutputService* pstCsmOutputService Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-07-01 Draft Enact *****************************************************************************/ VOS_VOID IMSA_RegProcImsMsgAuth(IMSA_IMS_OUTPUT_SERVICE_EVENT_STRU* pstOutputService) { USIMM_AUTH_DATA_STRU stUsimAuthData ={0}; if(pstOutputService->bitOpAka == 0) { IMSA_WARN_LOG("IMSA_RegProcImsMsgAuth: AKA bit is empty!"); return; } /*保存IMS消息对应的OPID*/ IMSA_SaveRcvImsOpid(pstOutputService->ulOpId); stUsimAuthData.enAuthType = USIMM_IMS_AUTH; stUsimAuthData.unAuthPara.stImsAuth.stAutn.ulDataLen = 16; stUsimAuthData.unAuthPara.stImsAuth.stAutn.pucData = (VOS_UINT8*)&pstOutputService->stAkaPara.ucAkaAutn[0]; stUsimAuthData.unAuthPara.stImsAuth.stRand.ulDataLen = 16; stUsimAuthData.unAuthPara.stImsAuth.stRand.pucData = (VOS_UINT8*)&pstOutputService->stAkaPara.ucAkaRand[0]; /*输入鉴权数据*/ (VOS_VOID)USIMM_AuthReq(PS_PID_IMSA, \ USIMM_ISIM_APP,\ &stUsimAuthData); }
/***************************************************************************** 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_TaskEntry() Description : IMSVA模块TASK入口处理 Input : struct MsgCB* pMsg-----------消息指针 Output : VOS_VOID Return Value : VOS_VOID History : 1. sunbing 49683 2013-07-12 Draft Enact *****************************************************************************/ VOS_VOID IMSVA_TaskEntry(MsgBlock * pMsg) { /* 定义消息头指针*/ PS_MSG_HEADER_STRU *pHeader = VOS_NULL_PTR; /* 判断入口参数是否合法*/ if( VOS_NULL_PTR == pMsg) { return; } /* 获取消息头指针*/ pHeader = (PS_MSG_HEADER_STRU *) pMsg; switch(pHeader->ulSenderPid) { case DSP_PID_VOICE: IMSVA_ProcHifiMsg(pMsg); break; default: IMSA_WARN_LOG("IMSVA_TaskEntry:NORM: Error SenderPid!"); break; } }
/***************************************************************************** Function Name : IMSA_UsimMsgDistr() Description : USIM消息分发函数 Input : VOS_VOID *pRcvMsg Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-06-20 Draft Enact *****************************************************************************/ VOS_VOID IMSA_UsimMsgDistr(const VOS_VOID *pRcvMsg ) { /* 定义消息头指针*/ PS_MSG_HEADER_STRU *pHeader = VOS_NULL_PTR; IMSA_CONTROL_MANAGER_STRU *pstControlManager = IMSA_GetControlManagerAddress(); /* 获取消息头指针*/ pHeader = (PS_MSG_HEADER_STRU *) pRcvMsg; /* 关机过程中收到USIM发送的消息,直接丢弃 */ if(IMSA_STATUS_STOPING == pstControlManager->enImsaStatus) { IMSA_WARN_LOG("IMSA_UsimMsgDistr: Status is Stoping!"); return; } switch(pHeader->ulMsgName) { /*读文件结果*/ case PS_USIM_GET_FILE_RSP: (VOS_VOID)IMSA_ProcReadIsimFileResult((VOS_VOID*)pRcvMsg); break; /*鉴权结果*/ case PS_USIM_AUTHENTICATION_CNF: IMSA_ProcIsimAuthRsp(pRcvMsg); break; default: IMSA_ERR_LOG("IMSA_UsimMsgDistr: Msg id is err."); break; } }
/***************************************************************************** Function Name : IMSA_TafMsgDistr() Description : TAF消息分发函数 TAF这个PID下有多个模块MMA/SPM/APS,需要实现对这个模块消息的分发 Input : VOS_VOID *pRcvMsg Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-06-20 Draft Enact *****************************************************************************/ VOS_VOID IMSA_TafMsgDistr(const VOS_VOID *pRcvMsg ) { /* 定义消息头指针*/ PS_MSG_HEADER_STRU *pHeader = VOS_NULL_PTR; IMSA_CONTROL_MANAGER_STRU *pstControlManager; /* 获取消息头指针*/ pHeader = (PS_MSG_HEADER_STRU *) pRcvMsg; pstControlManager = IMSA_GetControlManagerAddress(); /* 关机过程中收到TAF发送的消息,直接丢弃 */ if(pstControlManager->enImsaStatus == IMSA_STATUS_STOPING) { IMSA_WARN_LOG("IMSA_TafMsgDistr: Status is Stoping!"); return; } /*APS消息*/ if(MN_CALLBACK_PS_CALL == pHeader->ulMsgName) { IMSA_CONN_ProcTafPsEvt((TAF_PS_EVT_STRU*)pRcvMsg); return ; } /*CALL 消息*/ if((pHeader->ulMsgName >= ID_CALL_IMSA_SRVCC_STATUS_NOTIFY) &&(pHeader->ulMsgName <= ID_CALL_IMSA_MSG_TYPE_BUTT)) { IMSA_ProcTafCallMsg(pRcvMsg); return; } /*SPM消息*/ if ((pHeader->ulMsgName >= ID_SPM_IMSA_CALL_ORIG_REQ) && (pHeader->ulMsgName <= ID_SPM_IMSA_MSG_TYPE_BUTT)) { IMSA_ProcSpmCallMsg(pRcvMsg); return; } /*短信消息*/ if((pHeader->ulMsgName >= ID_MSG_IMSA_RP_DATA_REQ ) &&(pHeader->ulMsgName <= ID_IMSA_MSG_TYPE_BUTT)) { IMSA_ProcSmsMsg(pRcvMsg); return; } }
/***************************************************************************** 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(); } }
/***************************************************************************** Function Name : IMSA_TimerMsgDistr() Description : TIMER消息分发函数 Input : VOS_VOID *pRcvMsg Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-06-20 Draft Enact *****************************************************************************/ VOS_VOID IMSA_TimerMsgDistr(const REL_TIMER_MSG *pRcvMsg ) { IMSA_TIMER_ID_ENUM_UINT16 enTimerName; VOS_UINT32 i = IMSA_NULL; IMSA_TIMER_EVT_FUNC pTimerEvtFunc = VOS_NULL_PTR; IMSA_CONTROL_MANAGER_STRU *pstControlManager; enTimerName = (VOS_UINT16)PS_GET_REL_TIMER_NAME(pRcvMsg); pstControlManager = IMSA_GetControlManagerAddress(); /* 关机过程中,除开关机定时器超时,其他的都不处理 */ if((IMSA_STATUS_STOPING == pstControlManager->enImsaStatus) && (TI_IMSA_START_OR_STOP != enTimerName)) { IMSA_WARN_LOG("IMSA_TimerMsgDistr: Status is Stoping!"); return; } /* 在事件处理表中查找处理函数 */ for ( i = 0; i < g_ulImsaTimerEvtFuncTblSize; i++ ) { /*lint -e960*/ if ( enTimerName == g_astImsaTimerEvtFuncTbl[i].ulEvtId ) { /* 事件ID匹配 */ pTimerEvtFunc = g_astImsaTimerEvtFuncTbl[i].pTimerEvtFunc; break; } /*lint +e960*/ } /* 如果处理函数存在则调用 */ if ( VOS_NULL_PTR != pTimerEvtFunc ) { (*pTimerEvtFunc)(pRcvMsg); } else { /*lint -e961*/ IMSA_ERR_LOG1("IMSA_TimerMsgDistr: Unexpected event received! <enTimerName>", enTimerName); /*lint +e961*/ } return; }
/***************************************************************************** Function Name : IMSA_ProcMmaMsg() 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_ProcMmaMsg(const VOS_VOID *pRcvMsg ) { /* 定义消息头指针*/ PS_MSG_HEADER_STRU *pHeader = VOS_NULL_PTR; IMSA_CONTROL_MANAGER_STRU *pstControlManager; /* 获取消息头指针*/ pHeader = (PS_MSG_HEADER_STRU *) pRcvMsg; pstControlManager = IMSA_GetControlManagerAddress(); /* 关机过程中,收到除开关机消息外的消息,都直接丢弃 */ if ((IMSA_STATUS_STOPING == pstControlManager->enImsaStatus) && (ID_MMA_IMSA_START_REQ != pHeader->ulMsgName) && (ID_MMA_IMSA_STOP_REQ != pHeader->ulMsgName)) { IMSA_WARN_LOG("IMSA_ProcMmaMsg: Status is Stoping and msg is not start and stop!"); return; } switch(pHeader->ulMsgName) { case ID_MMA_IMSA_START_REQ: IMSA_ProcMmaMsgStartReq(); break; case ID_MMA_IMSA_STOP_REQ: IMSA_ProcMmaMsgStopReq(); break; case ID_MMA_IMSA_DEREG_REQ: IMSA_ProcMmaMsgDeregReq(); break; case ID_MMA_IMSA_SERVICE_CHANGE_IND: IMSA_ProcMmaMsgServiceChangeInd(pRcvMsg); break; case ID_MMA_IMSA_CAMP_INFO_CHANGE_IND: IMSA_ProcMmaMsgCampInfoChangeInd(pRcvMsg); break; default: break; } }
/***************************************************************************** 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); }
/***************************************************************************** Function Name : IMSA_RegProcImsMsgAuth() Description : IMS鉴权消息处理 Input : CSM_OutputService* pstCsmOutputService Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-07-01 Draft Enact *****************************************************************************/ VOS_VOID IMSA_RegProcImsMsgAuth(IMSA_IMS_OUTPUT_SERVICE_EVENT_STRU* pstOutputService) { USIMM_AUTH_DATA_STRU stUsimAuthData ={0}; VOS_UINT8 ucOpId; if(pstOutputService->bitOpAka == 0) { IMSA_WARN_LOG("IMSA_RegProcImsMsgAuth: AKA bit is empty!"); return; } /*保存IMS消息对应的OPID*/ /* 如果IMS上报的是紧急类型的鉴权请求,则将OPID保存在紧急全局变量中 */ ucOpId = IMSA_AllocUsimOpId(); if (IMSA_TRUE == pstOutputService->ulIsEmergency) { IMSA_SaveRcvImsEmcOpid(pstOutputService->ulOpId); IMSA_SetUsimEmcOpid(ucOpId); stUsimAuthData.ucOpId = IMSA_GetUsimEmcOpid(); } else { IMSA_SaveRcvImsNormOpid(pstOutputService->ulOpId); IMSA_SetUsimNormOpid(ucOpId); stUsimAuthData.ucOpId = IMSA_GetUsimNormOpid(); } stUsimAuthData.enAuthType = USIMM_IMS_AUTH; stUsimAuthData.unAuthPara.stImsAuth.stAutn.ulDataLen = 16; stUsimAuthData.unAuthPara.stImsAuth.stAutn.pucData = (VOS_UINT8*)&pstOutputService->stAkaPara.ucAkaAutn[0]; stUsimAuthData.unAuthPara.stImsAuth.stRand.ulDataLen = 16; stUsimAuthData.unAuthPara.stImsAuth.stRand.pucData = (VOS_UINT8*)&pstOutputService->stAkaPara.ucAkaRand[0]; /*输入鉴权数据*/ (VOS_VOID)USIMM_AuthReq(PS_PID_IMSA, \ USIMM_ISIM_APP,\ &stUsimAuthData); }
/***************************************************************************** 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_SMS_ProcNwSmsErr() Description : 收到IMS协议栈的短信错误的处理函数 Input : HICSM_OutputSms *pstOutSms Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-08-10 Draft Enact *****************************************************************************/ VOS_VOID IMSA_SMS_ProcNwSmsErr(const IMSA_IMS_OUTPUT_SMS_EVENT_STRU *pstOutSms) { IMSA_SMS_SMR_MO_STRU *pstSmrMoEntity; VOS_UINT32 ulErrCode; pstSmrMoEntity = IMSA_SMS_GetSmrMoEntityAddress(); if(IMSA_SMS_SMR_STATE_WAIT_FOR_RP_ACK != pstSmrMoEntity->enState) { IMSA_WARN_LOG("IMSA_SMS_ProcNwSmsErr: Mo entity is not WAIT_FOR_RP_ACK!"); return; } /*MO实体状态进行空闲态,停止TI_IMSA_SMS_TR1M保护定时器*/ pstSmrMoEntity->enState = IMSA_SMS_SMR_STATE_IDLE; pstSmrMoEntity->ucMemAvailFlg = IMSA_SMS_FALSE; /* 清除mem avail标志 */ pstSmrMoEntity->ucRetransFlg = IMSA_SMR_RETRANS_PERMIT; /* 复位重发标志 */ IMSA_StopTimer(&pstSmrMoEntity->stTR1MTimer); ulErrCode = SMR_SMT_ERROR_IMS_ERROR_BEGIN + pstOutSms->stErrorCode.usSipStatusCode; IMSA_SMS_SndMsgReportInd(ulErrCode,VOS_NULL_PTR,0); }
/***************************************************************************** Function Name : IMSA_ProcImsMsgStartOrStopCnf() Description : 处理IMS开机或者关机结果 Input : VOS_VOID Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-06-24 Draft Enact *****************************************************************************/ VOS_VOID IMSA_ProcImsMsgStartOrStopCnf(VOS_VOID) { IMSA_CONTROL_MANAGER_STRU *pstControlManager; IMSA_NORM_LOG("IMSA_ProcImsMsgStartOrStopCnf: Enter!"); pstControlManager = IMSA_GetControlManagerAddress(); /*停止开关机保护定时器*/ IMSA_StopTimer(&pstControlManager->stProtectTimer); /*关机流程*/ if(pstControlManager->enImsaStatus == IMSA_STATUS_STOPING) { /*清除资源*/ IMSA_ClearResource(); /*进入等待开机状态*/ pstControlManager->enImsaStatus = IMSA_STATUS_NULL; IMSA_SndMmaMsgStopCnf(); } else if(pstControlManager->enImsaStatus == IMSA_STATUS_STARTING) { /*进入开机状态*/ pstControlManager->enImsaStatus = IMSA_STATUS_STARTED; IMSA_SndMmaMsgStartCnf(); /* 给IMS配置UE能力 */ IMSA_ConfigUeCapabilityInfo2Ims(); if ((IMSA_OP_TRUE == pstControlManager->stImsaCommonInfo.stImsaUeId.bitOpImpi) && (IMSA_OP_TRUE == pstControlManager->stImsaCommonInfo.stImsaUeId.bitOpTImpu) && (IMSA_OP_TRUE == pstControlManager->stImsaCommonInfo.bitOpHomeNetDomainName)) { /* config account info to ims */ IMSA_ConfigAccoutInfo2Ims(IMSA_REG_TYPE_NORMAL); /* config account info to ims */ IMSA_ConfigAccoutInfo2Ims(IMSA_REG_TYPE_EMC); } /* set imei */ IMSA_ConfigImei2Ims(); /* set retry time */ IMSA_ConfigTimerLength2Ims(); IMSA_ConfigSipPort2Ims(); /* 给IMS配置SIP信息 */ IMSA_ConfigSipInfo2Ims(); IMSA_ConfigVoipInfo2Ims(); IMSA_ConfigCodeInfo2Ims(); IMSA_ConfigSsConfInfo2Ims(); IMSA_ConfigSecurityInfo2Ims(); } else { IMSA_WARN_LOG("IMSA_ProcImsMsgStartOrStopCnf: err stat!"); } }
/***************************************************************************** Function Name : IMSA_SMS_ProcNwSmsReceived() Description : 收到网络的短信内容的处理函数 Input : HICSM_OutputSms *pstOutSms Output : VOS_VOID Return Value : VOS_VOID History : 1.sunbing 49683 2013-08-10 Draft Enact *****************************************************************************/ VOS_VOID IMSA_SMS_ProcNwSmsReceived(const IMSA_IMS_OUTPUT_SMS_EVENT_STRU *pstOutSms) { IMSA_SMS_SMR_MO_STRU *pstSmrMoEntity; IMSA_SMS_SMR_MT_STRU *pstSmrMtEntity; /*根据消息类型处理*/ switch(pstOutSms->aucMessage[0]) { /*MT RP Data*/ case IMSA_SMS_NTM_DATA_TYPE_RP_DATA: pstSmrMtEntity = IMSA_SMS_GetSmrMtEntityAddress(); if(pstSmrMtEntity->enState != IMSA_SMS_SMR_STATE_IDLE) { IMSA_WARN_LOG("IMSA_SMS_ProcNwSmsReceived: Mt entity is not idle!"); break; } /*MT短信,MT实体转状态,保存MR,启动TI_IMSA_SMS_TR2M定时器*/ pstSmrMtEntity->enState = IMSA_SMS_SMR_STATE_WAIT_TO_SND_RP_ACK; pstSmrMtEntity->ucMessageReference = (VOS_UINT8)pstOutSms->aucMessage[1]; IMSA_StartTimer(&pstSmrMtEntity->stTimerInfo); /*短信数据发给MSG*/ IMSA_SMS_SndMsgDataInd((VOS_UINT8*)pstOutSms->aucMessage,\ pstOutSms->ucMessageLen); break; /*MO RP ACK*/ case IMSA_SMS_NTM_DATA_TYPE_RP_ACK: pstSmrMoEntity = IMSA_SMS_GetSmrMoEntityAddress(); if(IMSA_SMS_SMR_STATE_WAIT_FOR_RP_ACK != pstSmrMoEntity->enState) { IMSA_WARN_LOG("IMSA_SMS_ProcNwSmsReceived: Mo entity is not WAIT_FOR_RP_ACK!"); break; } if(pstOutSms->aucMessage[1] != pstSmrMoEntity->ucMessageReference) { IMSA_WARN_LOG("IMSA_SMS_ProcNwReportReceived: MR is not equel."); break; } /*MO实体状态进行空闲态,停止TI_IMSA_SMS_TR1M保护定时器*/ pstSmrMoEntity->enState = IMSA_SMS_SMR_STATE_IDLE; IMSA_StopTimer(&pstSmrMoEntity->stTR1MTimer); if (IMSA_SMS_TRUE == pstSmrMoEntity->ucMemAvailFlg) { /* 此过程是mem avail过程 */ pstSmrMoEntity->ucMemAvailFlg = IMSA_SMS_FALSE; /* 清除mem avail标志 */ pstSmrMoEntity->ucRetransFlg = IMSA_SMR_RETRANS_PERMIT; /* 复位重发标志 */ } IMSA_SMS_SndMsgReportInd(SMR_SMT_ERROR_NO_ERROR, (VOS_UINT8*)pstOutSms->aucMessage,\ pstOutSms->ucMessageLen); IMSA_CMCCDeregProc(); break; case IMSA_SMS_NTM_DATA_TYPE_RP_ERR: IMSA_SMS_ProcNwSmsRpError(pstOutSms); break; default: IMSA_WARN_LOG("IMSA_SMS_ProcNwReportReceived: Msg Type ERR."); break; } }
/***************************************************************************** Function Name : IMSA_MsgHandle() 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_MsgHandle(const VOS_VOID *pRcvMsg ) { /* 定义消息头指针*/ PS_MSG_HEADER_STRU *pHeader = VOS_NULL_PTR; /* 获取消息头指针*/ pHeader = (PS_MSG_HEADER_STRU *) pRcvMsg; IMSA_PrintImsaRevMsg(pHeader,IMSA_GET_IMSA_PRINT_BUF()); IMSA_PrintState(); switch(pHeader->ulSenderPid) { /*TAF有多个模块,需要进一步分发*/ case WUEPS_PID_TAF: IMSA_TafMsgDistr(pRcvMsg); break; case WUEPS_PID_MMA: IMSA_ProcMmaMsg(pRcvMsg); break; case VOS_PID_TIMER: IMSA_TimerMsgDistr((REL_TIMER_MSG *)pRcvMsg); break; case PS_PID_IMSA: IMSA_IntraMsgDistr(pRcvMsg); break; case PS_PID_IMSVA: IMSA_ImsMsgDistr(pRcvMsg); break; /*USIM消息处理*/ case WUEPS_PID_USIM: IMSA_UsimMsgDistr(pRcvMsg); break; /*向USIM注册PID,USIM会通过这个PID通知IMSA*/ case MAPS_PIH_PID: IMSA_PihMsgDistr(pRcvMsg); break; case UEPS_PID_CDS: IMSA_CdsMsgDistr(pRcvMsg); break; case WUEPS_PID_VC: IMSA_VcMsgDistr(pRcvMsg); break; case WUEPS_PID_AT: IMSA_AtMsgDistr(pRcvMsg); break; /*发送对象错误,报警*/ default: IMSA_WARN_LOG("IMSA_MsgHandle:NORM: Error SenderPid!"); break; } }
/***************************************************************************** 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; } }