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(
ServiceRequest* serReq = new ServiceRequest();
serReq->decodefrombuffer(nullptr, (uint8_t*) bdata(nas), blength(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();
serApt->setHeader(PLAIN_5GS_MSG);
string supi = "imsi-" + nc.get()->imsi;
......@@ -661,7 +670,11 @@ void amf_n1::service_request_handle(
delete serReq;
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);
uint8_t buffer[BUFFER_SIZE_256];
int encoded_size = serApt->encode2buffer(buffer, BUFFER_SIZE_256);
......
......@@ -33,7 +33,9 @@
using namespace nas;
//------------------------------------------------------------------------------
ServiceRequest::ServiceRequest() {}
ServiceRequest::ServiceRequest() {
ie_nas_message_container = nullptr;
}
//------------------------------------------------------------------------------
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