Commit 9fab36a0 authored by yangjian's avatar yangjian

update UDR

parent 0031f439
...@@ -47,25 +47,25 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std ...@@ -47,25 +47,25 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
} }
if (mysql_num_rows(res)) if (mysql_num_rows(res))
{ {
query="update AuthenticationStatus set nfInstanceId='"+authEvent.getNfInstanceId()+"',"+ \ query="update AuthenticationStatus set nfInstanceId='"+authEvent.getNfInstanceId()+"'"+ \
"success="+(authEvent.isSuccess()?"1":"0")+","+ \ ",success="+(authEvent.isSuccess()?"1":"0")+ \
"timeStamp='"+authEvent.getTimeStamp()+"',"+ \ ",timeStamp='"+authEvent.getTimeStamp()+"'"+ \
"servingNetworkName='"+authEvent.getServingNetworkName()+"',"+ \ ",servingNetworkName='"+authEvent.getServingNetworkName()+"'"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?"authRemovalInd=1,":"authRemovalInd=0,"):""); (authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?",authRemovalInd=1":",authRemovalInd=0"):"");
to_json(j,authEvent.getAuthType()); to_json(j,authEvent.getAuthType());
query += "authType='"+j.dump()+"'"; query += ",authType='"+j.dump()+"'";
query += " where ueid="+ueId; query += " where ueid="+ueId;
} }
else else
{ {
query="insert into AuthenticationStatus set ueid="+ueId+"," \ query="insert into AuthenticationStatus set ueid="+ueId+ \
"nfInstanceId='"+authEvent.getNfInstanceId()+"',"+ \ ",nfInstanceId='"+authEvent.getNfInstanceId()+"'"+ \
"success="+(authEvent.isSuccess()?"1":"0")+","+ \ ",success="+(authEvent.isSuccess()?"1":"0")+ \
"timeStamp='"+authEvent.getTimeStamp()+"',"+ \ ",timeStamp='"+authEvent.getTimeStamp()+"'"+ \
"servingNetworkName='"+authEvent.getServingNetworkName()+"',"+ \ ",servingNetworkName='"+authEvent.getServingNetworkName()+"'"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?"authRemovalInd=1,":"authRemovalInd=0,"):""); (authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?",authRemovalInd=1":",authRemovalInd=0"):"");
to_json(j,authEvent.getAuthType()); to_json(j,authEvent.getAuthType());
query += "authType='"+j.dump()+"'"; query += ",authType='"+j.dump()+"'";
} }
mysql_free_result(res); mysql_free_result(res);
......
...@@ -46,67 +46,66 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(const std::strin ...@@ -46,67 +46,66 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(const std::strin
} }
if (mysql_num_rows(res)) if (mysql_num_rows(res))
{ {
query="update SmfRegistrations set smfInstanceId='"+smfRegistration.getSmfInstanceId()+"',"+ \ query="update SmfRegistrations set smfInstanceId='"+smfRegistration.getSmfInstanceId()+"'"+ \
"pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+"',"+ \ ",pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSmfSetId()+"',":"")+ \ (smfRegistration.smfSetIdIsSet()?",smfSetId='"+smfRegistration.getSmfSetId()+"'":"")+ \
(smfRegistration.supportedFeaturesIsSet()?"supportedFeatures='"+smfRegistration.getSupportedFeatures()+"',":"")+ \ (smfRegistration.supportedFeaturesIsSet()?",supportedFeatures='"+smfRegistration.getSupportedFeatures()+"'":"")+ \
(smfRegistration.dnnIsSet()?"dnn='"+smfRegistration.getDnn()+"',":"")+ \ (smfRegistration.dnnIsSet()?",dnn='"+smfRegistration.getDnn()+"'":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?"emergencyServices=1,":"emergencyServices=0,"):"")+ \ (smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?",emergencyServices=1":",emergencyServices=0"):"")+ \
(smfRegistration.pcscfRestorationCallbackUriIsSet()?"pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"',":"")+ \ (smfRegistration.pcscfRestorationCallbackUriIsSet()?",pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"'":"")+ \
(smfRegistration.pgwFqdnIsSet()?"pgwFqdn='"+smfRegistration.getPgwFqdn()+"',":"")+ \ (smfRegistration.pgwFqdnIsSet()?",pgwFqdn='"+smfRegistration.getPgwFqdn()+"'":"")+ \
(smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?"epdgInd=1,":"epdgInd=0,"):"")+ \ (smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?",epdgInd=1":",epdgInd=0"):"")+ \
(smfRegistration.deregCallbackUriIsSet()?"deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"',":"")+ \ (smfRegistration.deregCallbackUriIsSet()?",deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"'":"")+ \
(smfRegistration.registrationTimeIsSet()?"registrationTime='"+smfRegistration.getRegistrationTime()+"',":""); (smfRegistration.registrationTimeIsSet()?",registrationTime='"+smfRegistration.getRegistrationTime()+"'":"");
if(smfRegistration.registrationReasonIsSet()) if(smfRegistration.registrationReasonIsSet())
{ {
to_json(j,smfRegistration.getRegistrationReason()); to_json(j,smfRegistration.getRegistrationReason());
query += "registrationReason='"+j.dump()+"',"; query += ",registrationReason='"+j.dump()+"'";
} }
if(smfRegistration.contextInfoIsSet()) if(smfRegistration.contextInfoIsSet())
{ {
to_json(j,smfRegistration.getContextInfo()); to_json(j,smfRegistration.getContextInfo());
query += "contextInfo='"+j.dump()+"',"; query += ",contextInfo='"+j.dump()+"'";
} }
to_json(j,smfRegistration.getSingleNssai()); to_json(j,smfRegistration.getSingleNssai());
query += "singleNssai='"+j.dump()+"',"; query += ",singleNssai='"+j.dump()+"'";
to_json(j,smfRegistration.getPlmnId()); to_json(j,smfRegistration.getPlmnId());
query += "plmnId='"+j.dump()+"'"; query += ",plmnId='"+j.dump()+"'";
query += " where ueid="+ueId+" AND subpduSessionId="+std::to_string(pduSessionId); query += " where ueid="+ueId+" AND subpduSessionId="+std::to_string(pduSessionId);
} }
else else
{ {
query="insert into SmfRegistrations set ueid="+ueId+","+ \ query="insert into SmfRegistrations set ueid="+ueId+ \
"subpduSessionId="+std::to_string(pduSessionId)+","+ \ ",subpduSessionId="+std::to_string(pduSessionId)+ \
"pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+"',"+ \ ",pduSessionId="+std::to_string(smfRegistration.getPduSessionId())+ \
"smfInstanceId='"+smfRegistration.getSmfInstanceId()+"',"+ \ ",smfInstanceId='"+smfRegistration.getSmfInstanceId()+"'"+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSmfSetId()+"',":"")+ \ (smfRegistration.smfSetIdIsSet()?",smfSetId='"+smfRegistration.getSmfSetId()+"'":"")+ \
(smfRegistration.supportedFeaturesIsSet()?"supportedFeatures='"+smfRegistration.getSupportedFeatures()+"',":"")+ \ (smfRegistration.supportedFeaturesIsSet()?",supportedFeatures='"+smfRegistration.getSupportedFeatures()+"'":"")+ \
(smfRegistration.dnnIsSet()?"dnn='"+smfRegistration.getDnn()+"',":"")+ \ (smfRegistration.dnnIsSet()?",dnn='"+smfRegistration.getDnn()+"'":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?"emergencyServices=1,":"emergencyServices=0,"):"")+ \ (smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?",emergencyServices=1":",emergencyServices=0"):"")+ \
(smfRegistration.pcscfRestorationCallbackUriIsSet()?"pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"',":"")+ \ (smfRegistration.pcscfRestorationCallbackUriIsSet()?",pcscfRestorationCallbackUri='"+smfRegistration.getPcscfRestorationCallbackUri()+"'":"")+ \
(smfRegistration.pgwFqdnIsSet()?"pgwFqdn='"+smfRegistration.getPgwFqdn()+"',":"")+ \ (smfRegistration.pgwFqdnIsSet()?",pgwFqdn='"+smfRegistration.getPgwFqdn()+"'":"")+ \
(smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?"epdgInd=1,":"epdgInd=0,"):"")+ \ (smfRegistration.epdgIndIsSet()?(smfRegistration.isEpdgInd()?",epdgInd=1":",epdgInd=0"):"")+ \
(smfRegistration.deregCallbackUriIsSet()?"deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"',":"")+ \ (smfRegistration.deregCallbackUriIsSet()?",deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"'":"")+ \
(smfRegistration.deregCallbackUriIsSet()?"deregCallbackUri='"+smfRegistration.getDeregCallbackUri()+"',":"")+ \ (smfRegistration.registrationTimeIsSet()?",registrationTime='"+smfRegistration.getRegistrationTime()+"'":"");
(smfRegistration.registrationTimeIsSet()?"registrationTime='"+smfRegistration.getRegistrationTime()+"',":"");
if(smfRegistration.registrationReasonIsSet()) if(smfRegistration.registrationReasonIsSet())
{ {
to_json(j,smfRegistration.getRegistrationReason()); to_json(j,smfRegistration.getRegistrationReason());
query += "registrationReason='"+j.dump()+"',"; query += ",registrationReason='"+j.dump()+"'";
} }
if(smfRegistration.contextInfoIsSet()) if(smfRegistration.contextInfoIsSet())
{ {
to_json(j,smfRegistration.getContextInfo()); to_json(j,smfRegistration.getContextInfo());
query += "contextInfo='"+j.dump()+"',"; query += ",contextInfo='"+j.dump()+"'";
} }
to_json(j,smfRegistration.getSingleNssai()); to_json(j,smfRegistration.getSingleNssai());
query += "singleNssai='"+j.dump()+"',"; query += ",singleNssai='"+j.dump()+"'";
to_json(j,smfRegistration.getPlmnId()); to_json(j,smfRegistration.getPlmnId());
query += "plmnId='"+j.dump()+"'"; query += ",plmnId='"+j.dump()+"'";
} }
mysql_free_result(res); 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