Commit 9fab36a0 authored by yangjian's avatar yangjian

update UDR

parent 0031f439
......@@ -47,25 +47,25 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
}
if (mysql_num_rows(res))
{
query="update AuthenticationStatus set nfInstanceId='"+authEvent.getNfInstanceId()+"',"+ \
"success="+(authEvent.isSuccess()?"1":"0")+","+ \
"timeStamp='"+authEvent.getTimeStamp()+"',"+ \
"servingNetworkName='"+authEvent.getServingNetworkName()+"',"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?"authRemovalInd=1,":"authRemovalInd=0,"):"");
query="update AuthenticationStatus set nfInstanceId='"+authEvent.getNfInstanceId()+"'"+ \
",success="+(authEvent.isSuccess()?"1":"0")+ \
",timeStamp='"+authEvent.getTimeStamp()+"'"+ \
",servingNetworkName='"+authEvent.getServingNetworkName()+"'"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?",authRemovalInd=1":",authRemovalInd=0"):"");
to_json(j,authEvent.getAuthType());
query += "authType='"+j.dump()+"'";
query += ",authType='"+j.dump()+"'";
query += " where ueid="+ueId;
}
else
{
query="insert into AuthenticationStatus set ueid="+ueId+"," \
"nfInstanceId='"+authEvent.getNfInstanceId()+"',"+ \
"success="+(authEvent.isSuccess()?"1":"0")+","+ \
"timeStamp='"+authEvent.getTimeStamp()+"',"+ \
"servingNetworkName='"+authEvent.getServingNetworkName()+"',"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?"authRemovalInd=1,":"authRemovalInd=0,"):"");
query="insert into AuthenticationStatus set ueid="+ueId+ \
",nfInstanceId='"+authEvent.getNfInstanceId()+"'"+ \
",success="+(authEvent.isSuccess()?"1":"0")+ \
",timeStamp='"+authEvent.getTimeStamp()+"'"+ \
",servingNetworkName='"+authEvent.getServingNetworkName()+"'"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?",authRemovalInd=1":",authRemovalInd=0"):"");
to_json(j,authEvent.getAuthType());
query += "authType='"+j.dump()+"'";
query += ",authType='"+j.dump()+"'";
}
mysql_free_result(res);
......
......@@ -46,67 +46,66 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(const std::strin
}
if (mysql_num_rows(res))
{
query="update SmfRegistrations set smfInstanceId='"+smfRegistration.getSmfInstanceId()+"',"+ \
"pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+"',"+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSmfSetId()+"',":"")+ \
(smfRegistration.supportedFeaturesIsSet()?"supportedFeatures='"+smfRegistration.getSupportedFeatures()+"',":"")+ \
(smfRegistration.dnnIsSet()?"dnn='"+smfRegistration.getDnn()+"',":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?"emergencyServices=1,":"emergencyServices=0,"):"")+ \
(smfRegistration.pcscfRestorationCallbackUriIsSet()?"pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"',":"")+ \
(smfRegistration.pgwFqdnIsSet()?"pgwFqdn='"+smfRegistration.getPgwFqdn()+"',":"")+ \
(smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?"epdgInd=1,":"epdgInd=0,"):"")+ \
(smfRegistration.deregCallbackUriIsSet()?"deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"',":"")+ \
(smfRegistration.registrationTimeIsSet()?"registrationTime='"+smfRegistration.getRegistrationTime()+"',":"");
query="update SmfRegistrations set smfInstanceId='"+smfRegistration.getSmfInstanceId()+"'"+ \
",pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+ \
(smfRegistration.smfSetIdIsSet()?",smfSetId='"+smfRegistration.getSmfSetId()+"'":"")+ \
(smfRegistration.supportedFeaturesIsSet()?",supportedFeatures='"+smfRegistration.getSupportedFeatures()+"'":"")+ \
(smfRegistration.dnnIsSet()?",dnn='"+smfRegistration.getDnn()+"'":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?",emergencyServices=1":",emergencyServices=0"):"")+ \
(smfRegistration.pcscfRestorationCallbackUriIsSet()?",pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"'":"")+ \
(smfRegistration.pgwFqdnIsSet()?",pgwFqdn='"+smfRegistration.getPgwFqdn()+"'":"")+ \
(smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?",epdgInd=1":",epdgInd=0"):"")+ \
(smfRegistration.deregCallbackUriIsSet()?",deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"'":"")+ \
(smfRegistration.registrationTimeIsSet()?",registrationTime='"+smfRegistration.getRegistrationTime()+"'":"");
if(smfRegistration.registrationReasonIsSet())
{
to_json(j,smfRegistration.getRegistrationReason());
query += "registrationReason='"+j.dump()+"',";
query += ",registrationReason='"+j.dump()+"'";
}
if(smfRegistration.contextInfoIsSet())
{
to_json(j,smfRegistration.getContextInfo());
query += "contextInfo='"+j.dump()+"',";
query += ",contextInfo='"+j.dump()+"'";
}
to_json(j,smfRegistration.getSingleNssai());
query += "singleNssai='"+j.dump()+"',";
query += ",singleNssai='"+j.dump()+"'";
to_json(j,smfRegistration.getPlmnId());
query += "plmnId='"+j.dump()+"'";
query += ",plmnId='"+j.dump()+"'";
query += " where ueid="+ueId+" AND subpduSessionId="+std::to_string(pduSessionId);
}
else
{
query="insert into SmfRegistrations set ueid="+ueId+","+ \
"subpduSessionId="+std::to_string(pduSessionId)+","+ \
"pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+"',"+ \
"smfInstanceId='"+smfRegistration.getSmfInstanceId()+"',"+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSmfSetId()+"',":"")+ \
(smfRegistration.supportedFeaturesIsSet()?"supportedFeatures='"+smfRegistration.getSupportedFeatures()+"',":"")+ \
(smfRegistration.dnnIsSet()?"dnn='"+smfRegistration.getDnn()+"',":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?"emergencyServices=1,":"emergencyServices=0,"):"")+ \
(smfRegistration.pcscfRestorationCallbackUriIsSet()?"pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"',":"")+ \
(smfRegistration.pgwFqdnIsSet()?"pgwFqdn='"+smfRegistration.getPgwFqdn()+"',":"")+ \
(smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?"epdgInd=1,":"epdgInd=0,"):"")+ \
(smfRegistration.deregCallbackUriIsSet()?"deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"',":"")+ \
(smfRegistration.deregCallbackUriIsSet()?"deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"',":"")+ \
(smfRegistration.registrationTimeIsSet()?"registrationTime='"+smfRegistration.getRegistrationTime()+"',":"");
query="insert into SmfRegistrations set ueid="+ueId+ \
",subpduSessionId="+std::to_string(pduSessionId)+ \
",pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+ \
",smfInstanceId='"+smfRegistration.getSmfInstanceId()+"'"+ \
(smfRegistration.smfSetIdIsSet()?",smfSetId='"+smfRegistration.getSmfSetId()+"'":"")+ \
(smfRegistration.supportedFeaturesIsSet()?",supportedFeatures='"+smfRegistration.getSupportedFeatures()+"'":"")+ \
(smfRegistration.dnnIsSet()?",dnn='"+smfRegistration.getDnn()+"'":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?",emergencyServices=1":",emergencyServices=0"):"")+ \
(smfRegistration.pcscfRestorationCallbackUriIsSet()?",pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"'":"")+ \
(smfRegistration.pgwFqdnIsSet()?",pgwFqdn='"+smfRegistration.getPgwFqdn()+"'":"")+ \
(smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?",epdgInd=1":",epdgInd=0"):"")+ \
(smfRegistration.deregCallbackUriIsSet()?",deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"'":"")+ \
(smfRegistration.registrationTimeIsSet()?",registrationTime='"+smfRegistration.getRegistrationTime()+"'":"");
if(smfRegistration.registrationReasonIsSet())
{
to_json(j,smfRegistration.getRegistrationReason());
query += "registrationReason='"+j.dump()+"',";
query += ",registrationReason='"+j.dump()+"'";
}
if(smfRegistration.contextInfoIsSet())
{
to_json(j,smfRegistration.getContextInfo());
query += "contextInfo='"+j.dump()+"',";
query += ",contextInfo='"+j.dump()+"'";
}
to_json(j,smfRegistration.getSingleNssai());
query += "singleNssai='"+j.dump()+"',";
query += ",singleNssai='"+j.dump()+"'";
to_json(j,smfRegistration.getPlmnId());
query += "plmnId='"+j.dump()+"'";
query += ",plmnId='"+j.dump()+"'";
}
mysql_free_result(res);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment