1 Star 1 Fork 1

刘昭/amf

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mt.go 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
刘昭 提交于 2022-01-25 19:22 +08:00 . 1.0.1
package producer
import (
"net/http"
"gitee.com/liu-zhao234568/amf/context"
"gitee.com/liu-zhao234568/amf/logger"
"github.com/free5gc/http_wrapper"
"github.com/free5gc/openapi/models"
)
func HandleProvideDomainSelectionInfoRequest(request *http_wrapper.Request) *http_wrapper.Response {
logger.MtLog.Info("Handle Provide Domain Selection Info Request")
ueContextID := request.Params["ueContextId"]
infoClassQuery := request.Query.Get("info-class")
supportedFeaturesQuery := request.Query.Get("supported-features")
ueContextInfo, problemDetails := ProvideDomainSelectionInfoProcedure(ueContextID,
infoClassQuery, supportedFeaturesQuery)
if problemDetails != nil {
return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails)
} else {
return http_wrapper.NewResponse(http.StatusOK, nil, ueContextInfo)
}
}
func ProvideDomainSelectionInfoProcedure(ueContextID string, infoClassQuery string, supportedFeaturesQuery string) (
*models.UeContextInfo, *models.ProblemDetails) {
amfSelf := context.AMF_Self()
ue, ok := amfSelf.AmfUeFindByUeContextID(ueContextID)
if !ok {
problemDetails := &models.ProblemDetails{
Status: http.StatusNotFound,
Cause: "CONTEXT_NOT_FOUND",
}
return nil, problemDetails
}
ueContextInfo := new(models.UeContextInfo)
// TODO: Error Status 307, 403 in TS29.518 Table 6.3.3.3.3.1-3
anType := ue.GetAnType()
if anType != "" && infoClassQuery != "" {
ranUe := ue.RanUe[anType]
ueContextInfo.AccessType = anType
ueContextInfo.LastActTime = ranUe.LastActTime
ueContextInfo.RatType = ue.RatType
ueContextInfo.SupportedFeatures = ranUe.SupportedFeatures
ueContextInfo.SupportVoPS = ranUe.SupportVoPS
ueContextInfo.SupportVoPSn3gpp = ranUe.SupportVoPSn3gpp
}
return ueContextInfo, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liu-zhao234568/amf.git
git@gitee.com:liu-zhao234568/amf.git
liu-zhao234568
amf
amf
v1.3.0

搜索帮助