VOS_UINT32  TAF_SPM_SendUsimEconfFdnReq(
    VOS_UINT16                          usClientId,
    struct MsgCB                       *pstMsg
)
{
    TAF_SPM_CALL_ECONF_INFO_STRU       *pstEconfInfoAddr    = VOS_NULL_PTR;
    MN_CALL_CALLED_NUM_STRU            *pstCalledNumber     = VOS_NULL_PTR;
    PS_PB_FDN_NUM_STRU                  stFdnInfo;
    VOS_UINT32                          ulRet;
    VOS_UINT8                           ucIndex;
    VOS_UINT32                          ulSendPara;

    PS_MEM_SET(&stFdnInfo, 0x0, sizeof(stFdnInfo));
    pstEconfInfoAddr    = TAF_SPM_GetCallEconfInfoAddr();

    pstEconfInfoAddr->ucSendSuccNum = 0;
    pstEconfInfoAddr->ucRcvNum      = 0;
    for (ucIndex = 0; ucIndex < pstEconfInfoAddr->ucCallNum; ucIndex++)
    {
        pstEconfInfoAddr->astEconfCheckInfo[ucIndex].ulCheckCnfFlag = VOS_FALSE;

        pstCalledNumber = &pstEconfInfoAddr->astEconfCheckInfo[ucIndex].stCalledNumber;

        stFdnInfo.ulNum1Len = pstCalledNumber->ucNumLen <= MN_CALL_MAX_BCD_NUM_LEN ?
                          pstCalledNumber->ucNumLen : MN_CALL_MAX_BCD_NUM_LEN;

        PS_MEM_CPY(stFdnInfo.aucNum1, pstCalledNumber->aucBcdNum, stFdnInfo.ulNum1Len);

        /* 增强型多方通话情况下,高16位为表示第几个电话号码,低16位为ClinedId */
        ulSendPara = TAF_SPM_ECONF_SET_SEND_PARA(ucIndex, usClientId);

        ulRet = NAS_PBAPI_FdnNumCheck(WUEPS_PID_TAF, 0, ulSendPara, &stFdnInfo);
        if (VOS_OK != ulRet)
        {
            /* 记录为失败 */
            TAF_SPM_RecordEconfCheckRslt(ucIndex, TAF_CS_CAUSE_FDN_CHECK_FAILURE);
        }
        else
        {
            pstEconfInfoAddr->ucSendSuccNum++;
        }
    }

    /* 全部发送失败,则退出 */
    if (0 == pstEconfInfoAddr->ucSendSuccNum)
    {
        /* 上报结果 */
        TAF_SPM_ReportEconfCheckRslt();
        return VOS_FALSE;
    }

    return VOS_TRUE;

}
VOS_UINT32 TAF_SPM_RcvAppReqMsg_Main(
    VOS_UINT32                          ulEventType,
    struct MsgCB                       *pstMsg
)
{
    VOS_UINT16                          usClientId;
    VOS_UINT8                           ucOpId;
    VOS_UINT8                           ucIdleFsmIndex;

    TAF_SPM_GetClientIdWithAppMsg(pstMsg, &usClientId);
    TAF_SPM_GetOpIdWithAppMsg(pstMsg, &ucOpId);

    /* 判断是否有存在空闲状态机 */
    ucIdleFsmIndex = TAF_SPM_GetIdleEntityFsmIndex();

    if (TAF_SPM_INVALID_CLIENT_ID_ENTITY_FSM_INDEX == ucIdleFsmIndex)
    {
        TAF_WARNING_LOG(WUEPS_PID_TAF, "TAF_SPM_RcvAppReqMsg_Main():WARNING: No Idle Entiy Fsm Exist!");

        /* 临时响应改为正式响应 */
        TAF_SPM_SendServiceRequetFail_Main(ulEventType, pstMsg, MN_ERR_CLASS_SPM_BEYOND_CONCURRENCY_CAPABILITY);

#if (FEATURE_ON == FEATURE_IMS)
        TAF_SPM_SetEconfPreRslt(TAF_CS_CAUSE_UNKNOWN);

        TAF_SPM_ReportEconfCheckRslt();
#endif
    }
    else
    {
        /* 设置当前状态机的索引 */
        TAF_SPM_SetCurrEntityFsmAddr(ucIdleFsmIndex);

        /* 设置当前client ID实体状态机的client ID */
        TAF_SPM_SetCurrEntityFsmClientId(usClientId);

        /* 启动service ctrl状态机,进行fdn&CALL control检查 */
        TAF_SPM_FSM_InitEntityFsm(TAF_SPM_FSM_SERVICE_CTRL,
                                  TAF_SPM_GetServiceCtrlFsmDescAddr(),
                                  TAF_SPM_SERVICE_CTRL_STA_INIT);
    }

    return VOS_TRUE;
}
VOS_UINT32 TAF_SPM_ProcEconfCheckResult(VOS_VOID)
{
    TAF_SPM_CALL_ECONF_INFO_STRU       *pstEconfInfoAddr    = VOS_NULL_PTR;
    VOS_UINT32                          ulSuccNum;

    pstEconfInfoAddr    = TAF_SPM_GetCallEconfInfoAddr();
    ulSuccNum           = 0;

    TAF_SPM_GetEconfCheckResultSuccNum(&ulSuccNum);

    /* 全部成功 */
    if (pstEconfInfoAddr->ucCallNum == ulSuccNum)
    {
        /* 不需要给AT上报结果 */
        return VOS_TRUE;
    }
    /* 部分失败或者全部失败 */
    else
    {
        TAF_SPM_ReportEconfCheckRslt();
        return VOS_FALSE;
    }

}
VOS_UINT32  TAF_SPM_SendUsimEconfEnvelopeReq(
    VOS_UINT16                          usClientId,
    struct MsgCB                       *pstMsg
)
{
    TAF_SPM_CALL_ECONF_INFO_STRU       *pstEconfInfoAddr    = VOS_NULL_PTR;
    MN_CALL_CS_DATA_CFG_INFO_STRU       stDataCfgInfo;
    MN_CALL_CALLED_NUM_STRU             stCalledNumber;
    VOS_UINT32                          ulRet;
    VOS_UINT8                           ucIndex;
    MN_CALL_TYPE_ENUM_U8                enCallType;
    MN_CALL_MODE_ENUM_U8                enCallMode;
    VOS_UINT32                          ulSendPara;

    PS_MEM_SET(&stCalledNumber, 0x0, sizeof(stCalledNumber));
    PS_MEM_SET(&stDataCfgInfo, 0x0, sizeof(MN_CALL_CS_DATA_CFG_INFO_STRU));
    pstEconfInfoAddr    = TAF_SPM_GetCallEconfInfoAddr();

    pstEconfInfoAddr->ucSendSuccNum = 0;
    pstEconfInfoAddr->ucRcvNum      = 0;
    enCallType                      = pstEconfInfoAddr->enCallType;
    enCallMode                      = pstEconfInfoAddr->enCallMode;
    PS_MEM_CPY(&stDataCfgInfo, &pstEconfInfoAddr->stDataCfg, sizeof(stDataCfgInfo));

    for (ucIndex = 0; ucIndex < pstEconfInfoAddr->ucCallNum; ucIndex++)
    {
        PS_MEM_CPY(&stCalledNumber,
               &pstEconfInfoAddr->astEconfCheckInfo[ucIndex].stCalledNumber,
               sizeof(MN_CALL_CALLED_NUM_STRU));

        pstEconfInfoAddr->astEconfCheckInfo[ucIndex].ulCheckCnfFlag = VOS_FALSE;

        /* 增强型多方通话情况下,高16位为表示第几个电话号码,低16位为ClinedId */
        ulSendPara = TAF_SPM_ECONF_SET_SEND_PARA(ucIndex, usClientId);

        ulRet = TAF_SPM_SendUsimCallEnvelopeReq(&stCalledNumber,
                                                &stDataCfgInfo,
                                                ulSendPara,
                                                enCallType,
                                                enCallMode);
        if (VOS_FALSE == ulRet)
        {
            /* 记录为失败 */
            TAF_SPM_RecordEconfCheckRslt(ucIndex, TAF_CS_CAUSE_CALL_CTRL_INVALID_PARAMETER);
        }
        else
        {
            pstEconfInfoAddr->ucSendSuccNum++;
        }
    }

    /* 全部发送失败,则退出 */
    if (0 == pstEconfInfoAddr->ucSendSuccNum)
    {
        /* 上报结果 */
        TAF_SPM_ReportEconfCheckRslt();
        return VOS_FALSE;
    }

    return VOS_TRUE;

}