- if strings.Contains(events[0], "_CONNECTED") {
+ if strings.Contains(events[0], "_CONNECTED") && !strings.Contains(events[0], "_CONNECTED_SETUP_FAILED") {
+ e.control.UpdateCounter(cE2StateChangedToUp)
nbId, err := ExtractNbiIdFromString(events[0])
if err != nil {
xapp.Logger.Error("NotificationCb CONNECTED len(nbId) == 0 ")
nbId, err := ExtractNbiIdFromString(events[0])
if err != nil {
xapp.Logger.Error("NotificationCb CONNECTED len(nbId) == 0 ")
xapp.Logger.Debug("E2 CONNECTED. NbId=%s", nbId)
e.NbIdMap[nbId] = nbId
} else if strings.Contains(events[0], "_DISCONNECTED") {
xapp.Logger.Debug("E2 CONNECTED. NbId=%s", nbId)
e.NbIdMap[nbId] = nbId
} else if strings.Contains(events[0], "_DISCONNECTED") {
nbId, err := ExtractNbiIdFromString(events[0])
if err != nil {
xapp.Logger.Error("NotificationCb DISCONNECTED len(nbId) == 0 ")
nbId, err := ExtractNbiIdFromString(events[0])
if err != nil {
xapp.Logger.Error("NotificationCb DISCONNECTED len(nbId) == 0 ")
if e.isNodeBActive(nbIdentity.InventoryName) == false {
if _, ok := e.NbIdMap[nbIdentity.InventoryName]; ok {
delete(e.NbIdMap, nbIdentity.InventoryName)
if e.isNodeBActive(nbIdentity.InventoryName) == false {
if _, ok := e.NbIdMap[nbIdentity.InventoryName]; ok {
delete(e.NbIdMap, nbIdentity.InventoryName)
xapp.Logger.Debug("E2 connection DISCONNETED: %v", nbIdentity.InventoryName)
// Delete all subscriptions related to InventoryName/nbId
xapp.Logger.Debug("E2 connection DISCONNETED: %v", nbIdentity.InventoryName)
// Delete all subscriptions related to InventoryName/nbId
if _, ok := e.NbIdMap[nbIdentity.InventoryName]; !ok {
e.NbIdMap[nbIdentity.InventoryName] = nbIdentity.InventoryName
if _, ok := e.NbIdMap[nbIdentity.InventoryName]; !ok {
e.NbIdMap[nbIdentity.InventoryName] = nbIdentity.InventoryName