Commit 8fff9809 authored by dukl's avatar dukl

fix bugs for service request procedure

parent 5268a8b9
...@@ -598,6 +598,15 @@ void amf_n1::service_request_handle( ...@@ -598,6 +598,15 @@ void amf_n1::service_request_handle(
ServiceRequest* serReq = new ServiceRequest(); ServiceRequest* serReq = new ServiceRequest();
serReq->decodefrombuffer(nullptr, (uint8_t*) bdata(nas), blength(nas)); serReq->decodefrombuffer(nullptr, (uint8_t*) bdata(nas), blength(nas));
bdestroy(nas); bdestroy(nas);
uint16_t pdu_session_status = 0xffff;
bstring nas_container;
Logger::amf_n1().debug("try to decode pdu-session-status in service_request(service_request)");
if(serReq->getNasMessageContainer(nas_container)){
Logger::amf_n1().debug("try to get pdu-session-status value from nas message container(length: %d)", blength(nas_container));
uint8_t *buf = (uint8_t*)bdata(nas_container);
pdu_session_status = buf[18]<<8 | buf[19];
Logger::amf_n1().debug("Get pdu-session-status value: 0x%x", pdu_session_status);
}
ServiceAccept* serApt = new ServiceAccept(); ServiceAccept* serApt = new ServiceAccept();
serApt->setHeader(PLAIN_5GS_MSG); serApt->setHeader(PLAIN_5GS_MSG);
string supi = "imsi-" + nc.get()->imsi; string supi = "imsi-" + nc.get()->imsi;
...@@ -661,7 +670,11 @@ void amf_n1::service_request_handle( ...@@ -661,7 +670,11 @@ void amf_n1::service_request_handle(
delete serReq; delete serReq;
return; return;
} }
serApt->setPDU_session_status(0x2000); if(pdu_session_status == 0x00){
serApt->setPDU_session_status(0x0000);
}else{
serApt->setPDU_session_status(pdu_session_status);
}
serApt->setPDU_session_reactivation_result(0x0000); serApt->setPDU_session_reactivation_result(0x0000);
uint8_t buffer[BUFFER_SIZE_256]; uint8_t buffer[BUFFER_SIZE_256];
int encoded_size = serApt->encode2buffer(buffer, BUFFER_SIZE_256); int encoded_size = serApt->encode2buffer(buffer, BUFFER_SIZE_256);
......
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
using namespace nas; using namespace nas;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
ServiceRequest::ServiceRequest() {} ServiceRequest::ServiceRequest() {
ie_nas_message_container = nullptr;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
ServiceRequest::~ServiceRequest() {} ServiceRequest::~ServiceRequest() {}
......
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