- xapp.Logger.Info("SubDelFail: SubId: %v, from address: %s. Forwarding response to xApp", payloadSeqNum, transaction.RmrEndpoint)
-
- if transaction.ForwardRespToXapp == true {
- var subDelRespPayload []byte
- subDelRespPayload, err = c.e2ap.PackSubscriptionDeleteResponse(transaction.OrigParams.Payload, payloadSeqNum)
- if err != nil {
- xapp.Logger.Error("SubDelFail:Packing SubDelResp failed. Err: %v", err)
- return
- }
-
- params.Mtype = 12021 // RIC SUBSCRIPTION DELETE RESPONSE
- params.SubId = int(payloadSeqNum)
- params.Xid = transaction.OrigParams.Xid
- params.Meid = transaction.OrigParams.Meid
- params.Src = transaction.OrigParams.Src
- params.PayloadLen = len(subDelRespPayload)
- params.Payload = subDelRespPayload
- params.Mbuf = nil
- xapp.Logger.Info("SubDelFail: Forwarding SubDelFail to xApp: Mtype: %v, SubId: %v, Xid: %v, Meid: %v", params.Mtype, params.SubId, params.Xid, params.Meid)
- err = c.rmrReplyToSender(params)
- if err != nil {
- xapp.Logger.Error("SubDelFail: Failed to send SubDelFail to xApp. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid)
- }
-
- time.Sleep(3 * time.Second)
- }
-
- xapp.Logger.Info("SubDelFail: Deleting transaction record. SubId: %v, Xid: %s", params.SubId, params.Xid)
- transaction.Release()
- if !c.registry.DelSubscription(payloadSeqNum) {
- xapp.Logger.Error("SubDelFail: Failed to release sequency number. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid)
- return
+ sendOk, timedOut := trans.SendEvent(subDelRespMsg, e2tRecvMsgTimeout)
+ if sendOk == false {
+ err = fmt.Errorf("Passing event to transaction failed: sendOk(%t) timedOut(%t)", sendOk, timedOut)
+ xapp.Logger.Error("MSG-SubDelResp: %s", idstring(trans, subs, err))