Skip to content

Commit

Permalink
Merge pull request #142 from Alonza0314/fix/only-send-N2-PDUSessionRe…
Browse files Browse the repository at this point in the history
…leaseCmd-in-activate

fix: make N2 PDUSession release cmd sent under activate state
  • Loading branch information
ianchen0119 authored Jan 16, 2025
2 parents 8daa2c2 + 1112d04 commit 30c2893
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions internal/sbi/processor/pdu_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,16 @@ func (p *Processor) HandlePDUSessionSMContextUpdate(
p.sendGSMPDUSessionReleaseCommand(smContext, buf)
}

if buf, err = smf_context.
BuildPDUSessionResourceReleaseCommandTransfer(smContext); err != nil {
smContext.Log.Errorf("Build PDUSessionResourceReleaseCommandTransfer failed: %+v", err)
} else {
response.JsonData.N2SmInfoType = models.N2SmInfoType_PDU_RES_REL_CMD
response.BinaryDataN2SmInformation = buf
response.JsonData.N2SmInfo = &models.RefToBinaryData{ContentId: "PDUResourceReleaseCommand"}
// Only send N2 PDU Session Resource Release when UP connection is active
if smContext.UpCnxState == models.UpCnxState_ACTIVATED {
if buf, err = smf_context.
BuildPDUSessionResourceReleaseCommandTransfer(smContext); err != nil {
smContext.Log.Errorf("Build PDUSessionResourceReleaseCommandTransfer failed: %+v", err)
} else {
response.JsonData.N2SmInfoType = models.N2SmInfoType_PDU_RES_REL_CMD
response.BinaryDataN2SmInformation = buf
response.JsonData.N2SmInfo = &models.RefToBinaryData{ContentId: "PDUResourceReleaseCommand"}
}
}

smContext.SetState(smf_context.PFCPModification)
Expand Down

0 comments on commit 30c2893

Please sign in to comment.